X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fcris%2Farch-v10%2Fkernel%2Fprocess.c;h=9024966dac3021088cbcdaf832272c359758a6ee;hb=refs%2Fheads%2Fvserver;hp=d0993bf720183e8530afe4faaee046b9d7aa012a;hpb=c7b5ebbddf7bcd3651947760f423e3783bbe6573;p=linux-2.6.git diff --git a/arch/cris/arch-v10/kernel/process.c b/arch/cris/arch-v10/kernel/process.c index d0993bf72..9024966da 100644 --- a/arch/cris/arch-v10/kernel/process.c +++ b/arch/cris/arch-v10/kernel/process.c @@ -1,4 +1,4 @@ -/* $Id: process.c,v 1.6 2004/05/11 12:28:25 starvik Exp $ +/* $Id: process.c,v 1.12 2004/12/27 11:18:32 starvik Exp $ * * linux/arch/cris/kernel/process.c * @@ -11,7 +11,6 @@ * This file handles the architecture-dependent parts of process handling.. */ -#include #include #include #include @@ -34,6 +33,15 @@ void default_idle(void) #endif } +/* + * Free current thread data structures etc.. + */ + +void exit_thread(void) +{ + /* Nothing needs to be done. */ +} + /* if the watchdog is enabled, we can simply disable interrupts and go * into an eternal loop, and the watchdog will reset the CPU after 0.1s * if on the other hand the watchdog wasn't enabled, we just enable it and wait @@ -70,7 +78,7 @@ void hard_reset_now (void) */ unsigned long thread_saved_pc(struct task_struct *t) { - return (unsigned long)user_regs(t->thread_info)->irp; + return task_pt_regs(t)->irp; } static void kernel_thread_helper(void* dummy, int (*fn)(void *), void * arg) @@ -92,9 +100,11 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) regs.r11 = (unsigned long)fn; regs.r12 = (unsigned long)arg; regs.irp = (unsigned long)kernel_thread_helper; + regs.dccr = 1 << I_DCCR_BITNR; /* Ok, create the new process.. */ - return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, ®s, 0, NULL, NULL); + return do_fork(flags | CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD, + 0, ®s, 0, NULL, NULL); } /* setup the child's kernel stack with a pt_regs and switch_stack on it. @@ -118,12 +128,12 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp, * remember that the task_struct doubles as the kernel stack for the task */ - childregs = user_regs(p->thread_info); + childregs = task_pt_regs(p); *childregs = *regs; /* struct copy of pt_regs */ p->set_child_tid = p->clear_child_tid = NULL; - + childregs->r10 = 0; /* child returns 0 after a fork/clone */ /* put the switch stack right below the pt_regs */ @@ -214,13 +224,6 @@ asmlinkage int sys_execve(const char *fname, char **argv, char **envp, return error; } -/* - * These bracket the sleeping functions.. - */ - -#define first_sched ((unsigned long)__sched_text_start) -#define last_sched ((unsigned long)__sched_text_end) - unsigned long get_wchan(struct task_struct *p) { #if 0 @@ -241,8 +244,8 @@ unsigned long get_wchan(struct task_struct *p) if (ebp < stack_page || ebp > 8184+stack_page) return 0; eip = *(unsigned long *) (ebp+4); - if (eip < first_sched || eip >= last_sched) - return eip; + if (!in_sched_functions(eip)) + return eip; ebp = *(unsigned long *) ebp; } while (count++ < 16); #endif