summaryrefslogtreecommitdiff
path: root/code/fe310/eos/event.c
diff options
context:
space:
mode:
Diffstat (limited to 'code/fe310/eos/event.c')
-rw-r--r--code/fe310/eos/event.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/code/fe310/eos/event.c b/code/fe310/eos/event.c
index a1cf591..127e45a 100644
--- a/code/fe310/eos/event.c
+++ b/code/fe310/eos/event.c
@@ -26,11 +26,16 @@ void eos_evtq_init(void) {
}
int eos_evtq_push(unsigned char cmd, unsigned char *buffer, uint16_t len) {
- return eos_msgq_push(&_eos_event_q, cmd, buffer, len);
+ clear_csr(mstatus, MSTATUS_MIE);
+ int ret = eos_msgq_push(&_eos_event_q, cmd, buffer, len);
+ set_csr(mstatus, MSTATUS_MIE);
+ return ret;
}
void eos_evtq_pop(unsigned char *cmd, unsigned char **buffer, uint16_t *len) {
+ clear_csr(mstatus, MSTATUS_MIE);
eos_msgq_pop(&_eos_event_q, cmd, buffer, len);
+ set_csr(mstatus, MSTATUS_MIE);
}
void eos_evtq_bad_handler(unsigned char cmd, unsigned char *buffer, uint16_t len) {
@@ -71,7 +76,7 @@ void eos_evtq_loop(void) {
while(foo) {
clear_csr(mstatus, MSTATUS_MIE);
- eos_evtq_pop(&cmd, &buffer, &len);
+ eos_msgq_pop(&_eos_event_q, &cmd, &buffer, &len);
if (cmd) {
set_csr(mstatus, MSTATUS_MIE);
eos_evtq_handle(cmd, buffer, len);