60
61
/* Spin on __secondary_hold_spinloop until it is updated by the boot cpu. */
61
62
/* In the UP case we'll yield() later, and we will not access the paca anyway */
64
iSeries_secondary_wait_paca:
65
66
LOAD_REG_ADDR(r23, __secondary_hold_spinloop)
68
LOAD_REG_ADDR(r3,current_set)
69
sldi r28,r24,3 /* get current_set[cpu#] */
71
addi r1,r3,THREAD_SIZE
72
subi r1,r1,STACK_FRAME_OVERHEAD
74
cmpwi 0,r23,0 /* Keep poking the Hypervisor until */
75
bne 2f /* we're released */
76
/* Let the Hypervisor know we are alive */
70
bne 2f /* go on when the master is ready */
72
/* Keep poking the Hypervisor until we're released */
77
73
/* 8002 is a call to HvCallCfg::getLps, a harmless Hypervisor function */
79
75
rldicr r3,r3,32,15 /* r0 = (r3 << 32) & 0xffff000000000000 */
80
76
li r0,-1 /* r0=-1 indicates a Hypervisor call */
81
77
sc /* Invoke the hypervisor via a system call */
78
b iSeries_secondary_wait_paca
84
LOAD_REG_ADDR(r3, nr_cpu_ids) /* get number of pacas allocated */
85
lwz r3,0(r3) /* nr_cpus= or NR_CPUS can limit */
86
cmpld 0,r24,r3 /* is our cpu number allocated? */
87
bge iSeries_secondary_yield /* no, yield forever */
86
89
/* Load our paca now that it's been allocated */
87
90
LOAD_REG_ADDR(r13, paca)
94
97
mtmsrd r23 /* RI on */
99
iSeries_secondary_smp_loop:
98
100
lbz r23,PACAPROCSTART(r13) /* Test if this processor
101
LOAD_REG_ADDR(r3,current_set)
102
sldi r28,r24,3 /* get current_set[cpu#] */
104
addi r1,r3,THREAD_SIZE
105
subi r1,r1,STACK_FRAME_OVERHEAD
108
beq iSeries_secondary_smp_loop /* Loop until told to go */
103
bne 3f /* go on when we are told */
106
/* Let the Hypervisor know we are alive */
107
/* 8002 is a call to HvCallCfg::getLps, a harmless Hypervisor function */
109
rldicr r3,r3,32,15 /* r0 = (r3 << 32) & 0xffff000000000000 */
110
li r0,-1 /* r0=-1 indicates a Hypervisor call */
111
sc /* Invoke the hypervisor via a system call */
112
mfspr r13,SPRN_SPRG_PACA /* Put r13 back ???? */
113
b iSeries_secondary_smp_loop /* wait for signal to start */
118
LOAD_REG_ADDR(r3,current_set)
119
sldi r28,r24,3 /* get current_set[cpu#] */
121
addi r1,r3,THREAD_SIZE
122
subi r1,r1,STACK_FRAME_OVERHEAD
109
124
b __secondary_start /* Loop until told to go */
110
iSeries_secondary_smp_loop:
111
/* Let the Hypervisor know we are alive */
112
/* 8002 is a call to HvCallCfg::getLps, a harmless Hypervisor function */
114
rldicr r3,r3,32,15 /* r0 = (r3 << 32) & 0xffff000000000000 */
115
#else /* CONFIG_SMP */
125
#endif /* CONFIG_SMP */
127
iSeries_secondary_yield:
116
128
/* Yield the processor. This is required for non-SMP kernels
117
129
which are running on multi-threaded machines. */
119
132
rldicr r3,r3,32,15 /* r3 = (r3 << 32) & 0xffff000000000000 */
120
133
addi r3,r3,18 /* r3 = 0x8000000000000012 which is "yield" */
121
134
li r4,0 /* "yield timed" */
122
135
li r5,-1 /* "yield forever" */
123
#endif /* CONFIG_SMP */
124
136
li r0,-1 /* r0=-1 indicates a Hypervisor call */
125
137
sc /* Invoke the hypervisor via a system call */
126
138
mfspr r13,SPRN_SPRG_PACA /* Put r13 back ???? */
127
b 2b /* If SMP not configured, secondaries
139
b iSeries_secondary_yield /* If SMP not configured, secondaries
128
140
* loop forever */
130
142
/*** ISeries-LPAR interrupt handlers ***/