diff --git a/sys/powerpc/aim/locore32.S b/sys/powerpc/aim/locore32.S index 56033fcbaa44..9f84bbf34777 100644 --- a/sys/powerpc/aim/locore32.S +++ b/sys/powerpc/aim/locore32.S @@ -60,6 +60,12 @@ GLOBAL(__endkernel) GLOBAL(tmpstk) .space TMPSTKSZ +#ifdef KDB +#define TRAPSTKSZ 4096 /* 4k trap stack */ +GLOBAL(trapstk) + .space TRAPSTKSZ +#endif + .text .globl btext btext: diff --git a/sys/powerpc/aim/locore64.S b/sys/powerpc/aim/locore64.S index 2d1d160160a2..88856777fb39 100644 --- a/sys/powerpc/aim/locore64.S +++ b/sys/powerpc/aim/locore64.S @@ -65,6 +65,14 @@ GLOBAL(tmpstk) TOC_ENTRY(tmpstk) TOC_ENTRY(can_wakeup) +#ifdef KDB +#define TRAPSTKSZ 4096 /* 4k trap stack */ +GLOBAL(trapstk) + .space TRAPSTKSZ +TOC_ENTRY(trapstk) +#endif + + /* * 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 diff --git a/sys/powerpc/aim/trap_subr32.S b/sys/powerpc/aim/trap_subr32.S index 4f691e7edb5c..2543dd169c54 100644 --- a/sys/powerpc/aim/trap_subr32.S +++ b/sys/powerpc/aim/trap_subr32.S @@ -864,8 +864,8 @@ dbtrap: 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: */ diff --git a/sys/powerpc/aim/trap_subr64.S b/sys/powerpc/aim/trap_subr64.S index 7f655a4cf5f4..ee88fffc6b38 100644 --- a/sys/powerpc/aim/trap_subr64.S +++ b/sys/powerpc/aim/trap_subr64.S @@ -897,8 +897,8 @@ dbtrap: mtsprg3 %r1 GET_TOCBASE(%r1) /* get new SP */ - ld %r1,TOC_REF(tmpstk)(%r1) - addi %r1,%r1,(TMPSTKSZ-48) + ld %r1,TOC_REF(trapstk)(%r1) + addi %r1,%r1,(TRAPSTKSZ-48) FRAME_SETUP(PC_DBSAVE) /* Call C trap code: */