.macro portSAVE_CONTEXT\r
\r
/* Make room for the context. */ \r
- addiu sp, sp, -portCONTEXT_SIZE\r
\r
/* Get interrupts above the kernel priority enabled again ASAP. First\r
save the current status so we can manipulate it, and the cause and EPC\r
registers so we capture their original values in case of interrupt nesting. */\r
\r
mfc0 k0, _CP0_CAUSE\r
+ addiu sp, sp, -portCONTEXT_SIZE\r
sw k0, portCAUSE_STACK_LOCATION(sp)\r
mfc0 k1, _CP0_STATUS\r
- sw k1, portSTATUS_STACK_LOCATION(sp)\r
-\r
/* Also save s6 so we can use it during this interrupt. Any\r
nesting interrupts should maintain the values of this register\r
accross the ISR. */\r
sw s6, 44(sp)\r
+ sw k1, portSTATUS_STACK_LOCATION(sp)\r
+\r
\r
/* s6 holds the EPC value, we may want this during the context switch. */\r
mfc0 s6, _CP0_EPC\r