@@ -36,6 +36,9 @@
#define GET_CPU() \
clrrdi %r13,%r1,STACK_SHIFT
+#define GET_CPU_REG(stack_reg) \
+ clrrdi %r13,stack_reg,STACK_SHIFT
+
#define SAVE_GPR(reg,sp) std %r##reg,STACK_GPR##reg(sp)
#define REST_GPR(reg,sp) ld %r##reg,STACK_GPR##reg(sp)
@@ -837,9 +840,8 @@ opal_boot_trampoline:
.balign 0x10
.global opal_entry
opal_entry:
- /* Get our per CPU stack */
- mfspr %r12,SPR_PIR
- GET_STACK(%r12,%r12)
+ /* Lets stick to caller's stack. */
+ mr %r12,%r1
stdu %r12,-STACK_FRAMESIZE(%r12)
/* Save caller r1, establish new r1 */
@@ -864,7 +866,9 @@ opal_entry:
std %r12,STACK_LR(%r1)
/* Get the CPU thread */
- GET_CPU()
+ mfspr %r12,SPR_PIR
+ GET_STACK(%r12,%r12)
+ GET_CPU_REG(%r12)
/* Store token in CPU thread */
std %r0,CPUTHREAD_CUR_TOKEN(%r13)