\r
portRESTORE_CONTEXT\r
\r
- /* Won't progress to here. */\r
-\r
- /* Save interrupt context on the stack to allow nesting */\r
- SUB lr, lr, #4\r
- STMFD sp!, {lr}\r
- MRS lr, SPSR\r
- STMFD sp!, {r0, lr}\r
-\r
- /* Write in the IVR to support Protect Mode */\r
- LDR lr, =AT91C_BASE_AIC\r
- LDR r0, [r14, #AIC_IVR]\r
- STR lr, [r14, #AIC_IVR]\r
-\r
- /* Branch to interrupt handler in Supervisor mode */\r
- MSR CPSR_c, #ARM_MODE_SVC\r
- STMFD sp!, {r1-r3, r12, lr}\r
- MOV lr, pc\r
- BX r0\r
- LDMIA sp!, {r1-r3, r12, lr}\r
- MSR CPSR_c, #ARM_MODE_IRQ | I_BIT\r
-\r
- /* Acknowledge interrupt */\r
- LDR lr, =AT91C_BASE_AIC\r
- STR lr, [r14, #AIC_EOICR]\r
-\r
- /* Restore interrupt context and branch back to calling code */\r
- LDMIA sp!, {r0, lr}\r
- MSR SPSR_cxsf, lr\r
- LDMIA sp!, {pc}^\r
-\r
-\r
/*\r
After a reset, execution starts here, the mode is ARM, supervisor\r
with interrupts disabled.\r