From: Philipp R. <pr...@ma...> - 2001-03-04 03:34:02
|
I think there's an obvious bug in the current kernel_thread code: --- linuxsh/kernel/arch/sh/kernel/process.c Fri Feb 23 21:43:00 2001 +++ linux-aero/arch/sh/kernel/process.c Sat Mar 3 19:30:37 2001 @@ -138,11 +138,6 @@ /* * This is the mechanism for creating a new kernel thread. - * - * NOTE! Only a kernel-only process(ie the swapper or direct descendants - * who haven't done an "execve()") should use this: it will work within - * a system call from a "real" process, but the process memory space will - * not be free'd until both the parent and the child have exited. */ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) { /* Don't use this in BL=1(cli). Or else, CPU resets! */ @@ -154,7 +149,7 @@ register unsigned long __sc9 __asm__ ("r9") = (long) fn; __asm__("trapa #0x12\n\t" /* Linux/SH system call */ - "tst #0xff, r0\n\t" /* child or parent? */ + "tst r0, r0\n\t" /* child or parent? */ "bf 1f\n\t" /* parent - jump */ "jsr @r9\n\t" /* call fn */ " mov r8, r4\n\t" /* push argument */ Did I miss anything ? |