diff --git a/arch/mips/src/pic32mx/excptmacros.h b/arch/mips/src/pic32mx/excptmacros.h index f759e4e9e1f..4fdc8afaf55 100644 --- a/arch/mips/src/pic32mx/excptmacros.h +++ b/arch/mips/src/pic32mx/excptmacros.h @@ -72,7 +72,7 @@ * my_exception: * EXCPT_PROLOGUE t0 - Save registers on stack, enable nested interrupts * move a0, sp - Pass register save structure as the parameter 1 - * USE_INTSTACK t0, t1, t2 - Switch to the interrupt stack + * USE_INTSTACK t0, t1, t2, t3 - Switch to the interrupt stack * jal handler - Handle the exception IN=old regs OUT=new regs * di - Disable interrupts * RESTORE_STACK t0, t1 - Undo the operations of USE_STACK @@ -368,7 +368,7 @@ * * On Entry: * sp - Current value of the user stack pointer - * tmp1, tmp2, and tmp3 are registers that can be used temporarily. + * tmp1, tmp2, tmp3, and tmp4 are registers that can be used temporarily. * All interrupts should still be disabled. * * At completion: @@ -378,7 +378,7 @@ * ********************************************************************************************/ - .macro USE_INTSTACK, tmp1, tmp2, tmp3 + .macro USE_INTSTACK, tmp1, tmp2, tmp3, tmp4 #if CONFIG_ARCH_INTERRUPTSTACK > 3 #ifdef CONFIG_PIC32MX_NESTED_INTERRUPTS @@ -398,9 +398,9 @@ */ la \tmp3, g_intstackbase - lw \tmp, (\tmp3) - sw sp, (\tmp3) - move sp, \tmp3 + lw \tmp4, (\tmp3) + sw sp, (\tmp4) + move sp, \tmp4 #ifdef CONFIG_PIC32MX_NESTED_INTERRUPTS 1: diff --git a/arch/mips/src/pic32mx/pic32mx-head.S b/arch/mips/src/pic32mx/pic32mx-head.S index 2a6f43230a6..b5e19f39d80 100644 --- a/arch/mips/src/pic32mx/pic32mx-head.S +++ b/arch/mips/src/pic32mx/pic32mx-head.S @@ -490,8 +490,8 @@ __start: _exception_handler: EXCPT_PROLOGUE t0 /* Save registers on stack, enable nested interrupts */ move a0, sp /* Pass register save structure as the parameter 1 */ - USE_INTSTACK t0, t1, t2 /* Switch to the interrupt stack */ - la t0, pic32mx_exception /* Call pic32mx_exception(regs) */ + USE_INTSTACK t0, t1, t2, t3 /* Switch to the interrupt stack */ + la t0, pic32mx_exception /* Call pic32mx_exception(regs) */ jalr ra, t0 nop #ifdef CONFIG_PIC32MX_NESTED_INTERRUPTS @@ -515,7 +515,7 @@ _exception_handler: _int_handler: EXCPT_PROLOGUE t0 /* Save registers on stack, enable nested interrupts */ move a0, sp /* Pass register save structure as the parameter 1 */ - USE_INTSTACK t0, t1, t2 /* Switch to the interrupt stack */ + USE_INTSTACK t0, t1, t2, t3 /* Switch to the interrupt stack */ la t0, pic32mx_decodeirq /* Call pic32mx_decodeirq(regs) */ jalr ra, t0 nop @@ -541,7 +541,7 @@ _int_handler: _nmi_handler: EXCPT_PROLOGUE t0 /* Save registers on stack, enable nested interrupts */ move a0, sp /* Pass register save structure as the parameter 1 */ - USE_INTSTACK t0, t1, t2 /* Switch to the interrupt stack */ + USE_INTSTACK t0, t1, t2, t3 /* Switch to the interrupt stack */ la t0, pic32mx_donmi /* Call up_donmi(regs) */ jalr ra, t0 nop diff --git a/arch/mips/src/pic32mz/pic32mz-excptmacros.h b/arch/mips/src/pic32mz/pic32mz-excptmacros.h index d52b1be162a..2ddb5b464f9 100644 --- a/arch/mips/src/pic32mz/pic32mz-excptmacros.h +++ b/arch/mips/src/pic32mz/pic32mz-excptmacros.h @@ -72,7 +72,7 @@ * my_exception: * EXCPT_PROLOGUE t0 - Save registers on stack, enable nested interrupts * move a0, sp - Pass register save structure as the parameter 1 - * USE_INTSTACK t0, t1, t2 - Switch to the interrupt stack + * USE_INTSTACK t0, t1, t2, t3 - Switch to the interrupt stack * jal handler - Handle the exception IN=old regs OUT=new regs * di - Disable interrupts * RESTORE_STACK t0, t1 - Undo the operations of USE_STACK @@ -368,7 +368,7 @@ * * On Entry: * sp - Current value of the user stack pointer - * tmp1, tmp2, and tmp3 are registers that can be used temporarily. + * tmp1, tmp2, tmp3, and tmp4 are registers that can be used temporarily. * All interrupts should still be disabled. * * At completion: @@ -378,7 +378,7 @@ * ********************************************************************************************/ - .macro USE_INTSTACK, tmp1, tmp2, tmp3 + .macro USE_INTSTACK, tmp1, tmp2, tmp3, tmp4 #if CONFIG_ARCH_INTERRUPTSTACK > 3 #ifdef CONFIG_PIC32MZ_NESTED_INTERRUPTS @@ -398,9 +398,9 @@ */ la \tmp3, g_intstackbase - lw \tmp, (\tmp3) - sw sp, (\tmp3) - move sp, \tmp3 + lw \tmp4, (\tmp3) + sw sp, (\tmp4) + move sp, \tmp4 #ifdef CONFIG_PIC32MZ_NESTED_INTERRUPTS 1: diff --git a/arch/mips/src/pic32mz/pic32mz-head.S b/arch/mips/src/pic32mz/pic32mz-head.S index fae8eb73e6c..b04ab231f13 100644 --- a/arch/mips/src/pic32mz/pic32mz-head.S +++ b/arch/mips/src/pic32mz/pic32mz-head.S @@ -561,8 +561,8 @@ __start: _exception_handler: EXCPT_PROLOGUE t0 /* Save registers on stack, enable nested interrupts */ move a0, sp /* Pass register save structure as the parameter 1 */ - USE_INTSTACK t0, t1, t2 /* Switch to the interrupt stack */ - la t0, pic32mz_exception /* Call pic32mz_exception(regs) */ + USE_INTSTACK t0, t1, t2, t3 /* Switch to the interrupt stack */ + la t0, pic32mz_exception /* Call pic32mz_exception(regs) */ jalr ra, t0 nop #ifdef CONFIG_PIC32MZ_NESTED_INTERRUPTS @@ -590,7 +590,7 @@ _exception_handler: _int_handler: EXCPT_PROLOGUE t0 /* Save registers on stack, enable nested interrupts */ move a0, sp /* Pass register save structure as the parameter 1 */ - USE_INTSTACK t0, t1, t2 /* Switch to the interrupt stack */ + USE_INTSTACK t0, t1, t2, t3 /* Switch to the interrupt stack */ la t0, pic32mz_decodeirq /* Call pic32mz_decodeirq(regs) */ jalr ra, t0 nop @@ -620,7 +620,7 @@ _int_handler: _nmi_handler: EXCPT_PROLOGUE t0 /* Save registers on stack, enable nested interrupts */ move a0, sp /* Pass register save structure as the parameter 1 */ - USE_INTSTACK t0, t1, t2 /* Switch to the interrupt stack */ + USE_INTSTACK t0, t1, t2, t3 /* Switch to the interrupt stack */ la t0, pic32mz_donmi /* Call up_donmi(regs) */ jalr ra, t0 nop