File tree Expand file tree Collapse file tree 3 files changed +28
-16
lines changed Expand file tree Collapse file tree 3 files changed +28
-16
lines changed Original file line number Diff line number Diff line change @@ -331,14 +331,26 @@ ENTRY(ret_from_fork)
331
331
l %r12 ,__LC_THREAD_INFO
332
332
l %r13 ,__LC_SVC_NEW_PSW+4
333
333
tm __PT_PSW+1 (%r11 ),0x01 # forking a kernel thread ?
334
- jo 0f
335
- st %r15 ,__PT_R15(%r11 ) # store stack pointer for new kthread
336
- 0: l %r1,BASED(.Lschedule_tail)
334
+ je 1f
335
+ l %r1,BASED(.Lschedule_tail)
337
336
basr %r14 ,%r1 # call schedule_tail
338
337
TRACE_IRQS_ON
339
338
ssm __LC_SVC_NEW_PSW # reenable interrupts
340
339
j sysc_tracenogo
341
340
341
+ 1: # it's a kernel thread
342
+ st %r15 ,__PT_R15(%r11 ) # store stack pointer for new kthread
343
+ l %r1,BASED(.Lschedule_tail)
344
+ basr %r14 ,%r1 # call schedule_tail
345
+ TRACE_IRQS_ON
346
+ ssm __LC_SVC_NEW_PSW # reenable interrupts
347
+ lm %r9 ,%r11 ,__PT_R9(%r11 ) # load gprs
348
+ ENTRY(kernel_thread_starter)
349
+ la %r2,0 (%r10 )
350
+ basr %r14 ,%r9
351
+ la %r2,0
352
+ br %r11 # do_exit
353
+
342
354
#
343
355
# kernel_execve function needs to deal with pt_regs that is not
344
356
# at the usual place
Original file line number Diff line number Diff line change @@ -352,12 +352,22 @@ ENTRY(ret_from_fork)
352
352
la %r11 ,STACK_FRAME_OVERHEAD(%r15 )
353
353
lg %r12 ,__LC_THREAD_INFO
354
354
tm __PT_PSW+1 (%r11 ),0x01 # forking a kernel thread ?
355
- jo 0f
356
- stg %r15 ,__PT_R15(%r11 ) # store stack pointer for new kthread
357
- 0: brasl %r14 ,schedule_tail
355
+ je 1f
356
+ brasl %r14 ,schedule_tail
358
357
TRACE_IRQS_ON
359
358
ssm __LC_SVC_NEW_PSW # reenable interrupts
360
359
j sysc_tracenogo
360
+ 1: # it's a kernel thread
361
+ stg %r15 ,__PT_R15(%r11 ) # store stack pointer for new kthread
362
+ brasl %r14 ,schedule_tail
363
+ TRACE_IRQS_ON
364
+ ssm __LC_SVC_NEW_PSW # reenable interrupts
365
+ lmg %r9 ,%r11 ,__PT_R9(%r11 ) # load gprs
366
+ ENTRY(kernel_thread_starter)
367
+ la %r2,0 (%r10 )
368
+ basr %r14 ,%r9
369
+ la %r2,0
370
+ br %r11 # do_exit
361
371
362
372
#
363
373
# kernel_execve function needs to deal with pt_regs that is not
Original file line number Diff line number Diff line change @@ -98,16 +98,6 @@ void cpu_idle(void)
98
98
99
99
extern void __kprobes kernel_thread_starter (void );
100
100
101
- asm(
102
- ".section .kprobes.text, \"ax\"\n"
103
- ".global kernel_thread_starter\n"
104
- "kernel_thread_starter:\n"
105
- " la 2,0(10)\n"
106
- " basr 14,9\n"
107
- " la 2,0\n"
108
- " br 11\n"
109
- ".previous\n" );
110
-
111
101
int kernel_thread (int (* fn )(void * ), void * arg , unsigned long flags )
112
102
{
113
103
struct pt_regs regs ;
You can’t perform that action at this time.
0 commit comments