summaryrefslogtreecommitdiff
path: root/code/fe310/eos/interrupt.c
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2018-03-16 14:15:39 +0100
committerUros Majstorovic <majstor@majstor.org>2018-03-16 14:15:39 +0100
commitb1c3ee27894d33d9fcfca4ea4d0ccfb6d4cfc83e (patch)
tree16bfe6ba0da03cf94dec735076d2de1eac9fc761 /code/fe310/eos/interrupt.c
parent8755ad4c0b0652f16d3505ed72ed3d8310a35c6f (diff)
fixed race conditions
Diffstat (limited to 'code/fe310/eos/interrupt.c')
-rw-r--r--code/fe310/eos/interrupt.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/code/fe310/eos/interrupt.c b/code/fe310/eos/interrupt.c
index b8c6540..28bd8d1 100644
--- a/code/fe310/eos/interrupt.c
+++ b/code/fe310/eos/interrupt.c
@@ -26,6 +26,12 @@ uintptr_t eos_intr_handle(uintptr_t int_num) {
return int_num;
}
+void handle_m_ext_interrupt(void) {
+ plic_source int_num = PLIC_claim_interrupt(&plic);
+ eos_intr_handle(int_num);
+ PLIC_complete_interrupt(&plic, int_num);
+}
+
void eos_intr_init(void) {
for (int i = 0; i < PLIC_NUM_INTERRUPTS; i++){
ext_interrupt_handler[i] = NULL;