summaryrefslogtreecommitdiff
path: root/code/fe310/eos/timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'code/fe310/eos/timer.c')
-rw-r--r--code/fe310/eos/timer.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/code/fe310/eos/timer.c b/code/fe310/eos/timer.c
index 915be6f..5e1b381 100644
--- a/code/fe310/eos/timer.c
+++ b/code/fe310/eos/timer.c
@@ -4,6 +4,7 @@
#include "encoding.h"
#include "platform.h"
+#include "msgq.h"
#include "event.h"
#include "timer.h"
@@ -14,6 +15,8 @@ static eos_timer_fptr_t timer_ext_handler = NULL;
volatile uint64_t timer_next = 0;
volatile uint64_t timer_next_evt = 0;
+extern EOSMsgQ _eos_event_q;
+
void eos_timer_handle(void) {
volatile uint64_t *mtime = (uint64_t *) (CLINT_CTRL_ADDR + CLINT_MTIME);
volatile uint64_t *mtimecmp = (uint64_t *) (CLINT_CTRL_ADDR + CLINT_MTIMECMP);
@@ -28,7 +31,7 @@ void eos_timer_handle(void) {
}
}
if (timer_next_evt && (timer_next_evt <= now)) {
- eos_evtq_push(EOS_EVT_TIMER, NULL, 0);
+ eos_msgq_push(&_eos_event_q, EOS_EVT_TIMER, NULL, 0);
timer_next_evt = 0;
}
*mtimecmp = (timer_next && timer_next_evt) ? MIN(timer_next, timer_next_evt) : (timer_next ? timer_next : timer_next_evt);