Index: sys/powerpc/aim/locore32.S =================================================================== --- sys/powerpc/aim/locore32.S +++ sys/powerpc/aim/locore32.S @@ -59,6 +59,10 @@ GLOBAL(tmpstk) .space TMPSTKSZ +#define TRAPSTKSZ 4096 /* 4k trap stack */ +GLOBAL(trapstk) + .space TRAPSTKSZ + .text .globl btext btext: Index: sys/powerpc/aim/locore64.S =================================================================== --- sys/powerpc/aim/locore64.S +++ sys/powerpc/aim/locore64.S @@ -64,6 +64,11 @@ TOC_ENTRY(tmpstk) TOC_ENTRY(can_wakeup) +#define TRAPSTKSZ 4096 +GLOBAL(trapstk) + .space TRAPSTKSZ +TOC_ENTRY(trapstk) + /* * Entry point for bootloaders that do not fully implement ELF and start * at the beginning of the image (kexec, notably). In its own section so Index: sys/powerpc/aim/trap_subr32.S =================================================================== --- sys/powerpc/aim/trap_subr32.S +++ sys/powerpc/aim/trap_subr32.S @@ -864,8 +864,8 @@ mtsprg3 %r1 lwz %r1,TRAP_TOCBASE(0) /* get new SP */ - lwz %r1,tmpstk@got(%r1) - addi %r1,%r1,TMPSTKSZ-16 + lwz %r1,trapstk@got(%r1) + addi %r1,%r1,TRAPSTKSZ-16 FRAME_SETUP(PC_DBSAVE) /* Call C trap code: */ Index: sys/powerpc/aim/trap_subr64.S =================================================================== --- sys/powerpc/aim/trap_subr64.S +++ sys/powerpc/aim/trap_subr64.S @@ -873,9 +873,9 @@ andi. %r1,%r1,0xff00 mtsprg3 %r1 - ld %r1,TRAP_TOCBASE(0) /* get new SP */ - ld %r1,TOC_REF(tmpstk)(%r1) - addi %r1,%r1,(TMPSTKSZ-48) + GET_TOCBASE(%r1) + ld %r1,TOC_REF(trapstk)(%r1) + addi %r1,%r1,(TRAPSTKSZ-48) FRAME_SETUP(PC_DBSAVE) /* Call C trap code: */