diff options
Diffstat (limited to 'software/first/setup_timer_irq.S')
-rw-r--r-- | software/first/setup_timer_irq.S | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/software/first/setup_timer_irq.S b/software/first/setup_timer_irq.S index c3e7513..bba356d 100644 --- a/software/first/setup_timer_irq.S +++ b/software/first/setup_timer_irq.S @@ -1,6 +1,7 @@ .section .text .align 2 .global setup_timer_irq +.global wait_for_irq .include "gpio.inc" .include "memory_map.inc" @@ -97,3 +98,13 @@ exit: lw a0, 4(sp) # restore first argument to function addi sp, sp, 28 # deallocate stack frame mret # exit IRQ handler + + +wait_for_irq: + csrr t0, mip + csrr t1, mcause + csrr t2, mtvec + csrr t3, mstatus + csrr t4, mie + wfi + ret |