.global vPortRestoreTaskContext\r
\r
\r
-\r
-\r
.macro portSAVE_CONTEXT\r
\r
/* Save the LR and SPSR onto the system mode stack before switching to\r
PUSH {lr}\r
\r
/* Change to supervisor mode to allow reentry. */\r
+ CPS #0x13\r
\r
/* Push used registers. */\r
- PUSH {r0-r4, r12}\r
+ PUSH {r0-r3, r12}\r
\r
/* Increment nesting count. r3 holds the address of ulPortInterruptNesting\r
for future use. r1 holds the original ulPortInterruptNesting value for\r
future use. */\r
LDR r3, ulPortInterruptNestingConst\r
LDR r1, [r3]\r
- ADD r4, r1, #1\r
- STR r4, [r3]\r
+ ADD r0, r1, #1\r
+ STR r0, [r3]\r
\r
/* Ensure bit 2 of the stack pointer is clear. r2 holds the bit 2 value for\r
future use. */\r
- MOV r2, sp\r
- AND r2, r2, #4\r
+ MOV r0, sp\r
+ AND r2, r0, #4\r
SUB sp, sp, r2\r
\r
/* Call the interrupt handler. */\r
ISB\r
\r
/* Write to the EOI register. */\r
- LDR r4, ulICCEOIRConst\r
- LDR r4, [r4]\r
- STR r0, [r4]\r
+ LDR r0, ulICCEOIRConst\r
+ LDR r2, [r0]\r
+ STR r0, [r2]\r
\r
/* Restore the old nesting count. */\r
STR r1, [r3]\r
/* Did the interrupt request a context switch? r1 holds the address of\r
ulPortYieldRequired and r0 the value of ulPortYieldRequired for future\r
use. */\r
- LDR r1, =ulPortYieldRequired\r
+ LDR r1, ulPortYieldRequiredConst\r
LDR r0, [r1]\r
CMP r0, #0\r
BNE switch_before_exit\r
exit_without_switch:\r
/* No context switch. Restore used registers, LR_irq and SPSR before\r
returning. */\r
- POP {r0-r4, r12}\r
+ POP {r0-r3, r12}\r
CPS #IRQ_MODE\r
POP {LR}\r
MSR SPSR_cxsf, LR\r
\r
/* Restore used registers, LR-irq and SPSR before saving the context\r
to the task stack. */\r
- POP {r0-r4, r12}\r
+ POP {r0-r3, r12}\r
CPS #IRQ_MODE\r
POP {LR}\r
MSR SPSR_cxsf, LR\r
vTaskSwitchContextConst: .word vTaskSwitchContext\r
vApplicationIRQHandlerConst: .word vApplicationIRQHandler\r
ulPortInterruptNestingConst: .word ulPortInterruptNesting\r
+ulPortYieldRequiredConst: .word ulPortYieldRequired\r
\r
.end\r
\r