s390: fold kernel_thread_helper() into ret_from_fork()
... and don't bother with syscall return path in case of kernel threads. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -331,14 +331,26 @@ ENTRY(ret_from_fork)
|
||||
l %r12,__LC_THREAD_INFO
|
||||
l %r13,__LC_SVC_NEW_PSW+4
|
||||
tm __PT_PSW+1(%r11),0x01 # forking a kernel thread ?
|
||||
jo 0f
|
||||
st %r15,__PT_R15(%r11) # store stack pointer for new kthread
|
||||
0: l %r1,BASED(.Lschedule_tail)
|
||||
je 1f
|
||||
l %r1,BASED(.Lschedule_tail)
|
||||
basr %r14,%r1 # call schedule_tail
|
||||
TRACE_IRQS_ON
|
||||
ssm __LC_SVC_NEW_PSW # reenable interrupts
|
||||
j sysc_tracenogo
|
||||
|
||||
1: # it's a kernel thread
|
||||
st %r15,__PT_R15(%r11) # store stack pointer for new kthread
|
||||
l %r1,BASED(.Lschedule_tail)
|
||||
basr %r14,%r1 # call schedule_tail
|
||||
TRACE_IRQS_ON
|
||||
ssm __LC_SVC_NEW_PSW # reenable interrupts
|
||||
lm %r9,%r11,__PT_R9(%r11) # load gprs
|
||||
ENTRY(kernel_thread_starter)
|
||||
la %r2,0(%r10)
|
||||
basr %r14,%r9
|
||||
la %r2,0
|
||||
br %r11 # do_exit
|
||||
|
||||
#
|
||||
# kernel_execve function needs to deal with pt_regs that is not
|
||||
# at the usual place
|
||||
|
Reference in New Issue
Block a user