diff options
author | Paul Mundt <lethal@linux-sh.org> | 2008-12-16 22:20:15 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2008-12-22 04:44:44 -0500 |
commit | 43f8f9b95b65dc05368cd82268895b9508b17d50 (patch) | |
tree | a0709b718dfadce2f80bb24c0ab1a27faf3b3016 /arch | |
parent | 7b80fb32b39a51ce3e1afa051f5a616eb8ecbed3 (diff) |
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')
-rw-r--r-- | arch/sh/kernel/process_32.c | 19 |
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) | |||
97 | /* | 97 | /* |
98 | * Create a kernel thread | 98 | * Create a kernel thread |
99 | */ | 99 | */ |
100 | 100 | ATTRIB_NORET void kernel_thread_helper(void *arg, int (*fn)(void *)) | |
101 | /* | 101 | { |
102 | * This is the mechanism for creating a new kernel thread. | 102 | do_exit(fn(arg)); |
103 | * | 103 | } |
104 | */ | ||
105 | extern void kernel_thread_helper(void); | ||
106 | __asm__(".align 5\n" | ||
107 | "kernel_thread_helper:\n\t" | ||
108 | "jsr @r5\n\t" | ||
109 | " nop\n\t" | ||
110 | "mov.l 1f, r1\n\t" | ||
111 | "jsr @r1\n\t" | ||
112 | " mov r0, r4\n\t" | ||
113 | ".align 2\n\t" | ||
114 | "1:.long do_exit"); | ||
115 | 104 | ||
116 | /* Don't use this in BL=1(cli). Or else, CPU resets! */ | 105 | /* Don't use this in BL=1(cli). Or else, CPU resets! */ |
117 | int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) | 106 | int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) |