From c286437474becda19c255efa3ede6beb0f2292d9 Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Sun, 4 Sep 2022 18:18:59 +0200 Subject: moved critical functions to itim --- fw/fe310/eos/event.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'fw/fe310/eos/event.c') 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; -- cgit v1.2.3