mcr p15, 0, r0, c1, c0, 0
@ Prepare for interrupts
+ cps #18 @ IRQ Mode
+ ldr sp, =irqstack+0x1000 @ Set up stack
cps #19
ldr sp, =stack+0x10000 @ Set up stack
.long kmain
.comm stack, 0x10000 @ ; 64KiB Stack
+.comm irqstack, 0x1000 @ ; 4KiB Stack
SyscallHandler:
b .
IRQHandler:
sub lr, #4 @ Adjust LR to the correct value
srsdb sp!, #19 @ Switch to supervisor mode (DDI0406B D1.6.5) (actually SRSFD)
- cpsie i, #19
+ cps #19
PUSH_GPRS
@ Restore CPU state
POP_GPRS
+ cpsie i
rfeia sp! @ Pop state (actually RFEFD)
bx lr
DataAbort:
sub lr, #8 @ Adjust LR to the correct value
srsdb sp!, #19 @ Switch to supervisor mode (DDI0406B D1.6.5) (actually SRSFD)
- cpsie i, #19
+ cpsid ifa, #19
PUSH_GPRS
mov r2, lr