_get_stack_pointer:
// Can be called from C
str sp, [sp] // Store the stack pointer value onto the stack
ldr r0, [sp] // Load the stack pointer value into r0
mov pc, lr // Return from function
_enable_interrupts:
// Can be called from C
mrs r0, cpsr // Move CPSR into r0
// [C]urrent [P]rogram [S]tatus [R]egister
mov r1, #CPSR_IRQ_INHIBIT // Move CPSR_IRQ_INHIBIT into r1
bic r0, r0, r1 // Clear the CPSR_IRQ_INHIBIT bit from CPSR
msr cpsr_c, r0 // Move r0 into CPSR
mov pc, lr // Return from function
_disable_interrupts:
// Can be called from C
mrs r0, cpsr // Move CPSR into r0
// [C]urrent [P]rogram [S]tatus [R]egister
mov r1, #CPSR_IRQ_INHIBIT // Move CPSR_IRQ_INHIBIT into r1
orr r0, r0, r1 // Set the CPSR_IRQ_INHIBIT bit in CPSR
msr cpsr_c, r0 // Move r0 into CPSR
mov pc, lr // Return from function