don't use register 4

This commit is contained in:
Corwin Kuiper 2021-06-24 12:30:40 +01:00
parent 47b02d29cf
commit a959e8e06b

View file

@ -3,12 +3,12 @@
.global InterruptHandlerSimple
.align
InterruptHandlerSimple:
ldr r4, =0x04000200 @ interrupt enable register location
ldr r2, =0x04000200 @ interrupt enable register location
ldrh r1, [r4] @ load 16 bit interrupt enable to r1
ldrh r3, [r4, #2] @ load 16 bit interrupt request to r3
ldrh r1, [r2] @ load 16 bit interrupt enable to r1
ldrh r3, [r2, #2] @ load 16 bit interrupt request to r3
and r0, r1, r3 @ interrupts both enabled and requested
strh r0, [r4, #2] @ store to interrupt request
strh r0, [r2, #2] @ store to interrupt request
ldr r2, =0x03007FF8 @ load bios interrupt request location
ldrh r1, [r2] @ load bios interrupt requests
@ -22,10 +22,10 @@ InterruptHandlerSimple:
@ call the rust interrupt handler with r0 set to the triggered interrupts
ldr r1, =__RUST_INTERRUPT_HANDLER
push {lr, r4-r11}
push {lr, r4-r9}
mov lr, pc
bx r1
pop {lr, r4-r11}
pop {lr, r4-r9}
@ change back to interrupt mode
mrs r2, cpsr