summaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/process_32.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2008-12-17 04:20:15 +0100
committerPaul Mundt <lethal@linux-sh.org>2008-12-22 10:44:44 +0100
commit43f8f9b95b65dc05368cd82268895b9508b17d50 (patch)
treea0709b718dfadce2f80bb24c0ab1a27faf3b3016 /arch/sh/kernel/process_32.c
parentsh: Kill off mv_heartbeat() from the machvec. (diff)
downloadlinux-43f8f9b95b65dc05368cd82268895b9508b17d50.tar.xz
linux-43f8f9b95b65dc05368cd82268895b9508b17d50.zip
sh: Simplify kernel_thread_helper() for sh32.
This can use the same implementation as sh64, the generated assembly is the same between the new and old version, so there is not much point in leaving it open coded in inline assembly. This is preparatory work for future consolidation of the _32/_64 variants. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/process_32.c')
-rw-r--r--arch/sh/kernel/process_32.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/arch/sh/kernel/process_32.c b/arch/sh/kernel/process_32.c
index 130817affa64..ddafbbbab2ab 100644
--- a/arch/sh/kernel/process_32.c
+++ b/arch/sh/kernel/process_32.c
@@ -97,21 +97,10 @@ void show_regs(struct pt_regs * regs)
/*
* Create a kernel thread
*/
-
-/*
- * This is the mechanism for creating a new kernel thread.
- *
- */
-extern void kernel_thread_helper(void);
-__asm__(".align 5\n"
- "kernel_thread_helper:\n\t"
- "jsr @r5\n\t"
- " nop\n\t"
- "mov.l 1f, r1\n\t"
- "jsr @r1\n\t"
- " mov r0, r4\n\t"
- ".align 2\n\t"
- "1:.long do_exit");
+ATTRIB_NORET void kernel_thread_helper(void *arg, int (*fn)(void *))
+{
+ do_exit(fn(arg));
+}
/* Don't use this in BL=1(cli). Or else, CPU resets! */
int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)