summaryrefslogtreecommitdiff
path: root/fw/fe310/eos/soc/timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'fw/fe310/eos/soc/timer.c')
-rw-r--r--fw/fe310/eos/soc/timer.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/fw/fe310/eos/soc/timer.c b/fw/fe310/eos/soc/timer.c
index 0573e84..f26f601 100644
--- a/fw/fe310/eos/soc/timer.c
+++ b/fw/fe310/eos/soc/timer.c
@@ -5,23 +5,22 @@
#include "platform.h"
#include "eos.h"
-#include "msgq.h"
#include "event.h"
#include "timer.h"
#define MIN(X, Y) (((X) < (Y)) ? (X) : (Y))
#define MAX(X, Y) (((X) > (Y)) ? (X) : (Y))
-static eos_timer_handler_t timer_handler[EOS_TIMER_MAX_ETYPE + 1];
+static eos_evt_simple_handler_t timer_handler[EOS_TIMER_MAX_ETYPE + 1];
static uint64_t timer_next[EOS_TIMER_MAX_ETYPE + 1];
-static void timer_handle_evt(unsigned char type, unsigned char *buffer, uint16_t len) {
- unsigned char idx = (type & ~EOS_EVT_MASK);
+static void timer_handle_evt(unsigned char type, EOSMessage *msg, uint16_t len) {
+ unsigned char idx = type & ~EOS_EVT_MASK;
if (idx && (idx <= EOS_TIMER_MAX_ETYPE) && timer_handler[idx]) {
- timer_handler[idx](type);
+ timer_handler[idx](type & ~EOS_EVT_MASK);
} else {
- eos_evtq_bad_handler(type, buffer, len);
+ eos_evtq_bad_handler(type, msg, len);
}
}
@@ -63,7 +62,7 @@ int eos_timer_init(void) {
return EOS_OK;
}
-void eos_timer_set_handler(unsigned char evt, eos_timer_handler_t handler) {
+void eos_timer_set_handler(unsigned char evt, eos_evt_simple_handler_t handler) {
uint64_t *mtimecmp = (uint64_t *) (CLINT_CTRL_ADDR + CLINT_MTIMECMP);
if (!evt && (*mtimecmp != 0)) clear_csr(mie, MIP_MTIP);