stkarm/src/interrupt.s

28 lines
478 B
ArmAsm

.text
.global setVectorBAR
setVectorBAR:
/* Disable interrupts */
cpsid if
/* Enable BAR remapping (clears bit 13 of SCTLR) */
mrc p15, 0, r0, c1, c0, 0
and r0, #0xffffdfff
mcr p15, 0, r0, c1, c0, 0
/* Sets VBAR with custom vector table's address */
ldr r0, =vectab
mcr p15, 0, r0, c12, c0, 0
/* Re-Enables interrupts */
cpsie if
mov pc, lr
.global getVectorBAR
getVectorBAR:
mrc p15, 0, r0, c12, c0, 0
mov pc, lr