2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
6 #include "linux/kernel.h"
8 #include "asm/signal.h"
9 #include "asm/ptrace.h"
10 #include "asm/uaccess.h"
11 #include "asm/pgalloc.h"
12 #include "asm/tlbflush.h"
13 #include "user_util.h"
14 #include "kern_util.h"
16 #include "time_user.h"
22 static int exec_tramp(void *sig_stack)
24 init_new_thread_stack(sig_stack, NULL);
25 init_new_thread_signals(1);
26 os_stop_process(os_getpid());
30 void flush_thread_tt(void)
35 stack = alloc_stack(0, 0);
38 "flush_thread : failed to allocate temporary stack\n");
42 new_pid = start_fork_tramp((void *) current->thread.kernel_stack,
43 stack, 0, exec_tramp);
46 "flush_thread : new thread failed, errno = %d\n",
51 if(current_thread->cpu == 0)
52 forward_interrupts(new_pid);
53 current->thread.request.op = OP_EXEC;
54 current->thread.request.u.exec.pid = new_pid;
55 unprotect_stack((unsigned long) current_thread);
56 os_usr1_process(os_getpid());
60 protect_memory(uml_reserved, high_physmem - uml_reserved, 1, 1, 0, 1);
61 task_protections((unsigned long) current_thread);
66 void start_thread_tt(struct pt_regs *regs, unsigned long eip,
70 flush_tlb_mm(current->mm);
71 PT_REGS_IP(regs) = eip;
72 PT_REGS_SP(regs) = esp;
73 PT_FIX_EXEC_STACK(esp);
77 * Overrides for Emacs so that we follow Linus's tabbing style.
78 * Emacs will notice this stuff at the end of the file and automatically
79 * adjust the settings for this buffer only. This must remain at the end
81 * ---------------------------------------------------------------------------
83 * c-file-style: "linux"