2 * 64-bit switch cpu code
4 * Copyright IBM Corp. 2009
8 #include <asm/asm-offsets.h>
9 #include <asm/lowcore.h>
10 #include <asm/ptrace.h>
12 # smp_switch_to_cpu switches to destination cpu and executes the passed function
13 # Parameter: %r2 - function to call
14 # %r3 - function parameter
17 # %r6 - destination cpu
21 .globl smp_switch_to_cpu
23 stmg %r6,%r15,__SF_GPRS(%r15)
25 aghi %r15,-STACK_FRAME_OVERHEAD
26 stg %r1,__SF_BACKCHAIN(%r15)
29 1: sigp %r0,%r6,__SIGP_RESTART /* start destination CPU */
30 brc 2,1b /* busy, try again */
31 2: sigp %r0,%r5,__SIGP_STOP /* stop current CPU */
32 brc 2,2b /* busy, try again */
35 .globl smp_restart_cpu
39 1: sigp %r0,%r5,__SIGP_SENSE /* Wait for calling CPU */
40 brc 10,1b /* busy, accepted (status 0), running */
41 tmll %r0,0x40 /* Test if calling CPU is stopped */
43 ltgr %r4,%r4 /* New stack ? */
48 .section .data,"aw",@progbits