···9292{9393}94949595-extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);9696-9795#define copy_segments(tsk, mm) do { } while (0)9896#define release_segments(mm) do { } while (0)9997
+5-19
arch/c6x/kernel/process.c
···104104 halt_loop();105105}106106107107-/*108108- * Create a kernel thread109109- */110110-int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)111111-{112112- struct pt_regs regs = {113113- .a0 = (unsigned long)fn,114114- .a1 = (unsigned long)arg,115115- .tsr = 0, /* kernel mode */116116- };117117-118118- /* Ok, create the new process.. */119119- return do_fork(flags | CLONE_VM | CLONE_UNTRACED, -1, ®s,120120- 0, NULL, NULL);121121-}122122-123107void flush_thread(void)124108{125109}···161177162178 childregs = task_pt_regs(p);163179164164- *childregs = *regs;165165-166166- if (usp == -1) {180180+ if (!regs) {167181 /* case of __kernel_thread: we return to supervisor space */182182+ memset(childregs, 0, sizeof(struct pt_regs));168183 childregs->sp = (unsigned long)(childregs + 1);169184 p->thread.pc = (unsigned long) ret_from_kernel_thread;185185+ childregs->a0 = usp; /* function */186186+ childregs->a1 = ustk_size; /* argument */170187 } else {171188 /* Otherwise use the given stack */189189+ *childregs = *regs;172190 childregs->sp = usp;173191 p->thread.pc = (unsigned long) ret_from_fork;174192 }