summaryrefslogtreecommitdiff
path: root/fw/fe310/eos/event.c
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2022-09-04 18:18:59 +0200
committerUros Majstorovic <majstor@majstor.org>2022-09-04 18:18:59 +0200
commitc286437474becda19c255efa3ede6beb0f2292d9 (patch)
tree189a9c91255726c2445946e642e5b23c7363314c /fw/fe310/eos/event.c
parent2b446dda5db1df77b9951d2c1908259076b1fbe1 (diff)
moved critical functions to itim
Diffstat (limited to 'fw/fe310/eos/event.c')
-rw-r--r--fw/fe310/eos/event.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fw/fe310/eos/event.c b/fw/fe310/eos/event.c
index f76384a..9f9a119 100644
--- a/fw/fe310/eos/event.c
+++ b/fw/fe310/eos/event.c
@@ -15,6 +15,7 @@ static EOSMsgItem event_q_array[EOS_EVT_SIZE_Q];
static eos_evt_handler_t evt_handler[EOS_EVT_MAX_EVT + 1];
+__attribute__ ((section (".itim")))
static void evtq_handler(unsigned char type, unsigned char *buffer, uint16_t len) {
unsigned char idx = (type & EOS_EVT_MASK) >> 4;
@@ -37,6 +38,7 @@ int eos_evtq_init(uint8_t wakeup_cause) {
return EOS_OK;
}
+__attribute__ ((section (".itim")))
int eos_evtq_push(unsigned char type, unsigned char *buffer, uint16_t len) {
clear_csr(mstatus, MSTATUS_MIE);
int ret = eos_msgq_push(&_eos_event_q, type, buffer, len);
@@ -44,16 +46,19 @@ int eos_evtq_push(unsigned char type, unsigned char *buffer, uint16_t len) {
return ret;
}
+__attribute__ ((section (".itim")))
int eos_evtq_push_isr(unsigned char type, unsigned char *buffer, uint16_t len) {
return eos_msgq_push(&_eos_event_q, type, buffer, len);
}
+__attribute__ ((section (".itim")))
void eos_evtq_pop(unsigned char *type, unsigned char **buffer, uint16_t *len) {
clear_csr(mstatus, MSTATUS_MIE);
eos_msgq_pop(&_eos_event_q, type, buffer, len);
set_csr(mstatus, MSTATUS_MIE);
}
+__attribute__ ((section (".itim")))
void eos_evtq_pop_isr(unsigned char *type, unsigned char **buffer, uint16_t *len) {
eos_msgq_pop(&_eos_event_q, type, buffer, len);
}
@@ -120,6 +125,7 @@ void eos_evtq_flush_isr(void) {
} while (type);
}
+__attribute__ ((section (".itim")))
void eos_evtq_loop(void) {
int foo = 1;
@@ -128,6 +134,7 @@ void eos_evtq_loop(void) {
}
}
+__attribute__ ((section (".itim")))
void eos_evtq_exec(void) {
unsigned char type;
unsigned char *buffer;
@@ -156,6 +163,7 @@ void eos_evtq_set_handler(unsigned char type, eos_evt_handler_t handler) {
if (idx <= EOS_EVT_MAX_EVT) evt_handler[idx] = handler;
}
+__attribute__ ((section (".itim")))
eos_evt_handler_t eos_evtq_get_handler(unsigned char type) {
unsigned char idx = (type & EOS_EVT_MASK) >> 4;