summaryrefslogtreecommitdiffstats
path: root/arch/c6x/kernel
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-09-22 18:23:49 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-10-01 00:59:09 -0400
commit5687580bcb758ddc95be9894f592a65034e77401 (patch)
tree46e8da685de52b6a72f83d857dd5aaced2657520 /arch/c6x/kernel
parent680a14535c330481517d3f95b2277353a14b8442 (diff)
downloadlinux-stable-5687580bcb758ddc95be9894f592a65034e77401.tar.gz
linux-stable-5687580bcb758ddc95be9894f592a65034e77401.tar.bz2
linux-stable-5687580bcb758ddc95be9894f592a65034e77401.zip
c6x: switch to generic kernel_thread()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/c6x/kernel')
-rw-r--r--arch/c6x/kernel/process.c24
1 files changed, 5 insertions, 19 deletions
diff --git a/arch/c6x/kernel/process.c b/arch/c6x/kernel/process.c
index f98616d92f2d..2770d9a9a84e 100644
--- a/arch/c6x/kernel/process.c
+++ b/arch/c6x/kernel/process.c
@@ -104,22 +104,6 @@ void machine_power_off(void)
halt_loop();
}
-/*
- * Create a kernel thread
- */
-int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
-{
- struct pt_regs regs = {
- .a0 = (unsigned long)fn,
- .a1 = (unsigned long)arg,
- .tsr = 0, /* kernel mode */
- };
-
- /* Ok, create the new process.. */
- return do_fork(flags | CLONE_VM | CLONE_UNTRACED, -1, &regs,
- 0, NULL, NULL);
-}
-
void flush_thread(void)
{
}
@@ -177,14 +161,16 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
childregs = task_pt_regs(p);
- *childregs = *regs;
-
- if (usp == -1) {
+ if (!regs) {
/* case of __kernel_thread: we return to supervisor space */
+ memset(childregs, 0, sizeof(struct pt_regs));
childregs->sp = (unsigned long)(childregs + 1);
p->thread.pc = (unsigned long) ret_from_kernel_thread;
+ childregs->a0 = usp; /* function */
+ childregs->a1 = ustk_size; /* argument */
} else {
/* Otherwise use the given stack */
+ *childregs = *regs;
childregs->sp = usp;
p->thread.pc = (unsigned long) ret_from_fork;
}