forked from luck/tmp_suning_uos_patched
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>
This commit is contained in:
parent
7b80fb32b3
commit
43f8f9b95b
@ -97,21 +97,10 @@ void show_regs(struct pt_regs * regs)
|
|||||||
/*
|
/*
|
||||||
* Create a kernel thread
|
* Create a kernel thread
|
||||||
*/
|
*/
|
||||||
|
ATTRIB_NORET void kernel_thread_helper(void *arg, int (*fn)(void *))
|
||||||
/*
|
{
|
||||||
* This is the mechanism for creating a new kernel thread.
|
do_exit(fn(arg));
|
||||||
*
|
}
|
||||||
*/
|
|
||||||
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");
|
|
||||||
|
|
||||||
/* Don't use this in BL=1(cli). Or else, CPU resets! */
|
/* Don't use this in BL=1(cli). Or else, CPU resets! */
|
||||||
int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
|
int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
|
||||||
|
Loading…
Reference in New Issue
Block a user