diff -Naur -X exclude-files ac_clean/arch/um/include/sysdep-i386/syscalls.h ac/arch/um/include/sysdep-i386/syscalls.h --- ac_clean/arch/um/include/sysdep-i386/syscalls.h Sun May 27 15:42:43 2001 +++ ac/arch/um/include/sysdep-i386/syscalls.h Sun May 27 19:40:39 2001 @@ -32,7 +32,7 @@ [ __NR_setfsgid32 ] = sys_setfsgid, \ [ __NR_pivot_root ] = sys_pivot_root, \ [ __NR_mincore ] = sys_mincore, \ - [ __NR_madvise ] = sys_madvise + [ __NR_madvise ] = sys_madvise, #define LAST_SYSCALL __NR_madvise diff -Naur -X exclude-files ac_clean/arch/um/kernel/Makefile ac/arch/um/kernel/Makefile --- ac_clean/arch/um/kernel/Makefile Sun May 27 15:42:43 2001 +++ ac/arch/um/kernel/Makefile Sun May 27 19:42:13 2001 @@ -2,7 +2,7 @@ OBJS = process.o current.o exec_kern.o exec_user.o init_task.o irq.o \ irq_user.o mem.o ptrace.o reboot.o resource.o \ - segment.o setup.o signal_user.o smp.o syscall_kern.o \ + setup.o signal_user.o smp.o syscall_kern.o \ syscall_user.o sys_call_table.o time.o time_kern.o tlb.o trap_kern.o \ trap_user.o um_arch.o user_util.o diff -Naur -X exclude-files ac_clean/arch/um/kernel/exec_kern.c ac/arch/um/kernel/exec_kern.c --- ac_clean/arch/um/kernel/exec_kern.c Sun May 27 15:42:43 2001 +++ ac/arch/um/kernel/exec_kern.c Sun May 27 19:42:34 2001 @@ -92,6 +92,7 @@ UM_IP(¤t->thread.process_regs) = eip; UM_SP(¤t->thread.process_regs) = esp; UM_ELF_ZERO(¤t->thread.process_regs) = 0; + UM_FIX_EXEC_STACK(esp); } static int execve1(char *file, char **argv, char **env) diff -Naur -X exclude-files ac_clean/arch/um/kernel/process_kern.c ac/arch/um/kernel/process_kern.c --- ac_clean/arch/um/kernel/process_kern.c Sun May 27 18:37:50 2001 +++ ac/arch/um/kernel/process_kern.c Sun May 27 19:43:09 2001 @@ -298,7 +298,7 @@ current->thread.request.u.fork.pid = new_pid; usr1_pid(getpid()); p->thread.process_regs = current->thread.process_regs; - UM_SYSCALL_RET(&p->thread.process_regs) = 0; + UM_SET_SYSCALL_RETURN(&p->thread.process_regs, 0); if(sp != 0) UM_SP(&p->thread.process_regs) = sp; p->thread.extern_pid = new_pid; p->thread.request.op = OP_FORK_FINISH; diff -Naur -X exclude-files ac_clean/arch/um/kernel/ptrace.c ac/arch/um/kernel/ptrace.c --- ac_clean/arch/um/kernel/ptrace.c Sun May 27 15:42:43 2001 +++ ac/arch/um/kernel/ptrace.c Sun May 27 19:45:26 2001 @@ -103,7 +103,7 @@ break; tmp = 0; /* Default return condition */ - if(addr < 17*sizeof(long)){ + if(addr < UM_MAX_REG_OFFSET){ tmp = getreg(child, addr); ret = put_user(tmp,(unsigned long *) data); } @@ -125,7 +125,7 @@ if ((addr & 3) || addr < 0) break; - if (addr < 17*sizeof(long)) { + if (addr < UM_MAX_REG_OFFSET) { ret = putreg(child, addr, data); break; } @@ -192,11 +192,12 @@ #ifdef PTRACE_GETREGS case PTRACE_GETREGS: { /* Get all gp regs from the child. */ - if (!access_ok(VERIFY_WRITE, (unsigned *)data, 17*sizeof(long))) { + if (!access_ok(VERIFY_WRITE, (unsigned *)data, + UM_MAX_REG_OFFSET)) { ret = -EIO; break; } - for ( i = 0; i < 17*sizeof(long); i += sizeof(long) ) { + for ( i = 0; i < UM_MAX_REG_OFFSET; i += sizeof(long) ) { __put_user(getreg(child, i),(unsigned long *) data); data += sizeof(long); } @@ -207,11 +208,12 @@ #ifdef PTRACE_SETREGS case PTRACE_SETREGS: { /* Set all gp regs in the child. */ unsigned long tmp = 0; - if (!access_ok(VERIFY_READ, (unsigned *)data, 17*sizeof(long))) { + if (!access_ok(VERIFY_READ, (unsigned *)data, + UM_MAX_REG_OFFSET)) { ret = -EIO; break; } - for ( i = 0; i < 17*sizeof(long); i += sizeof(long) ) { + for ( i = 0; i < UM_MAX_REG_OFFSET; i += sizeof(long) ) { __get_user(tmp, (unsigned long *) data); putreg(child, i, tmp); data += sizeof(long); diff -Naur -X exclude-files ac_clean/arch/um/kernel/segment.c ac/arch/um/kernel/segment.c --- ac_clean/arch/um/kernel/segment.c Sun May 27 15:42:43 2001 +++ ac/arch/um/kernel/segment.c Wed Dec 31 19:00:00 1969 @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2000 Jeff Dike (jdike@karaya.com) - * Licensed under the GPL - */ - -#include "linux/sched.h" -#include "linux/mm.h" -#include "asm/mmu_context.h" - -void release_segments(struct mm_struct *mm) -{ - struct mm_changes *changes = mm->context.segments; - - if(changes != NULL) free_page((unsigned long) changes); - mm->context.segments = NULL; -} - -void activate_mm(struct mm_struct *old_mm, struct mm_struct *new_mm) -{ - struct mm_changes *new; - - new = NULL; /* (struct mm_changes *) get_free_page(GFP_KERNEL); */ - new_mm->context.segments = new; - if(new == NULL) return; - new->count = 0; - new->barrier = -1; -} - -void copy_segments(struct task_struct *p, struct mm_struct *new_mm) -{ - activate_mm(p->mm, new_mm); - p->thread.mm_changes = 0; -} - -/* - * Overrides for Emacs so that we follow Linus's tabbing style. - * Emacs will notice this stuff at the end of the file and automatically - * adjust the settings for this buffer only. This must remain at the end - * of the file. - * --------------------------------------------------------------------------- - * Local variables: - * c-file-style: "linux" - * End: - */ diff -Naur -X exclude-files ac_clean/arch/um/kernel/sys_call_table.c ac/arch/um/kernel/sys_call_table.c --- ac_clean/arch/um/kernel/sys_call_table.c Sun May 27 15:42:43 2001 +++ ac/arch/um/kernel/sys_call_table.c Sun May 27 19:53:18 2001 @@ -430,7 +430,7 @@ [ __NR_stat64 ] = sys_stat64, [ __NR_lstat64 ] = sys_lstat64, [ __NR_fstat64 ] = sys_fstat64, - ARCH_SYSCALLS, + ARCH_SYSCALLS [ LAST_SYSCALL + 1 ... NR_syscalls ] = (syscall_handler_t *) sys_ni_syscall }; diff -Naur -X exclude-files ac_clean/arch/um/kernel/syscall_user.c ac/arch/um/kernel/syscall_user.c --- ac_clean/arch/um/kernel/syscall_user.c Sun May 27 15:42:43 2001 +++ ac/arch/um/kernel/syscall_user.c Sun May 27 19:45:52 2001 @@ -80,10 +80,10 @@ if((result == -ERESTARTNOHAND) || (result == -ERESTARTSYS) || (result == -ERESTARTNOINTR)) do_signal(NULL, &result, &again); - UM_SYSCALL_RET(regs) = result; + UM_SET_SYSCALL_RETURN(regs, result); set_repeat_syscall(again); syscall_trace(); - syscall_record[index].result = UM_SYSCALL_RET(regs); + syscall_record[index].result = result; gettimeofday(&syscall_record[index].end, NULL); ret_from_sys_call(NULL); if(have_signals(NULL, 0)) probe_stack(UM_SP(regs)); diff -Naur -X exclude-files ac_clean/arch/um/kernel/tlb.c ac/arch/um/kernel/tlb.c --- ac_clean/arch/um/kernel/tlb.c Sun May 27 15:42:43 2001 +++ ac/arch/um/kernel/tlb.c Sun May 27 19:47:24 2001 @@ -147,22 +147,9 @@ } } -int barriers = 0; -int page_changes = 0; -int page_flushes = 0; -int range_flushes = 0; - void flush_tlb_range(struct mm_struct *mm, unsigned long start, unsigned long end) { - if((mm != NULL) && ((mm != current->mm) || - (atomic_read(&mm->mm_count) > 1))){ - struct mm_changes *changes = mm->context.segments; - if(changes != NULL){ - changes->barrier = changes->count; - barriers++; - } - } if(mm == current->mm) fix_range(mm, start, end, 0); } @@ -173,46 +160,13 @@ void flush_tlb_kernel_vm(void) { - if(current->mm != NULL){ - struct mm_changes *changes = current->mm->context.segments; - if((changes == NULL) || - (current->thread.mm_changes < changes->barrier) || - (changes->count - current->thread.mm_changes > - CHANGES_PAGES(changes))){ - range_flushes++; - fix_range(current->mm, 0, STACK_TOP, 0); - if(changes != NULL) - current->thread.mm_changes = changes->count; - } - else { - unsigned long page; - int i; - - for(i=current->thread.mm_changes;icount;i++){ - page_flushes++; - page = CHANGES_PAGE(changes, i); - fix_range(current->mm, page, - page + PAGE_SIZE, 0); - } - current->thread.mm_changes = changes->count; - } - } - fix_range(NULL, start_vm, end_vm, 0); + if(current->mm != NULL) fix_range(current->mm, 0, STACK_TOP, 0); + else fix_range(NULL, start_vm, end_vm, 0); } void flush_tlb_page(struct vm_area_struct *vma, unsigned long address) { address &= PAGE_MASK; -#ifdef notdef - if((vma->vm_mm != current->mm) || - (atomic_read(&vma->vm_mm->mm_count) > 1)){ - struct mm_changes *changes = vma->vm_mm->segments; - if(changes != NULL){ - ADD_CHANGE(changes, address); - page_changes++; - } - } -#endif if(vma->vm_mm == current->mm) fix_range(current->mm, address, address + PAGE_SIZE, 0); } diff -Naur -X exclude-files ac_clean/include/asm-um/mmu_context.h ac/include/asm-um/mmu_context.h --- ac_clean/include/asm-um/mmu_context.h Sun May 27 19:08:45 2001 +++ ac/include/asm-um/mmu_context.h Sun May 27 19:53:21 2001 @@ -3,26 +3,21 @@ #include "linux/sched.h" -#define CHANGES_PAGES(c) (sizeof((c)->pages) / sizeof((c)->pages[0])) -#define CHANGES_PAGE(c, n) ((c)->pages[(n) % CHANGES_PAGES(c)]) -#define ADD_CHANGE(c, p) (CHANGES_PAGE(c, (c)->count++) = (p)) - -struct mm_changes { - int count; - int barrier; - unsigned long pages[(PAGE_SIZE - 2*sizeof(int))/sizeof(unsigned long)]; -}; - #define init_new_context(task, mm) (0) #define get_mmu_context(task) do ; while(0) #define activate_context(tsk) do ; while(0) #define destroy_context(mm) do ; while(0) -extern void activate_mm(struct mm_struct *old, struct mm_struct *new); -extern void switch_mm(struct mm_struct *prev, struct mm_struct *next, - struct task_struct *tsk, unsigned cpu); +extern inline void activate_mm(struct mm_struct *old, struct mm_struct *new) +{ +} + +extern inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, + struct task_struct *tsk, unsigned cpu) +{ +} -static inline void enter_lazy_tlb(struct mm_struct *mm, +extern inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk, unsigned cpu) { } diff -Naur -X exclude-files ac_clean/include/asm-um/processor.h ac/include/asm-um/processor.h --- ac_clean/include/asm-um/processor.h Sun May 27 19:08:44 2001 +++ ac/include/asm-um/processor.h Sun May 27 19:53:21 2001 @@ -171,8 +171,14 @@ extern void release_thread(struct task_struct *); extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); -extern void copy_segments(struct task_struct *p, struct mm_struct * mm); -extern void release_segments(struct mm_struct * mm); +extern inline void release_segments(struct mm_struct *mm) +{ +} + +extern inline void copy_segments(struct task_struct *p, + struct mm_struct *new_mm) +{ +} #define forget_segments() do ; while(0)