diff options
Diffstat (limited to 'fw/fe310/eos/msgq.c')
-rw-r--r-- | fw/fe310/eos/msgq.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fw/fe310/eos/msgq.c b/fw/fe310/eos/msgq.c index a483a58..1462ebe 100644 --- a/fw/fe310/eos/msgq.c +++ b/fw/fe310/eos/msgq.c @@ -17,6 +17,7 @@ void eos_msgq_init(EOSMsgQ *msgq, EOSMsgItem *array, uint8_t size) { msgq->array = array; } +__attribute__ ((section (".itim"))) int eos_msgq_push(EOSMsgQ *msgq, unsigned char type, unsigned char *buffer, uint16_t len) { if ((uint8_t)(msgq->idx_w - msgq->idx_r) == msgq->size) return EOS_ERR_FULL; @@ -28,6 +29,7 @@ int eos_msgq_push(EOSMsgQ *msgq, unsigned char type, unsigned char *buffer, uint return EOS_OK; } +__attribute__ ((section (".itim"))) void eos_msgq_pop(EOSMsgQ *msgq, unsigned char *type, unsigned char **buffer, uint16_t *len) { if (msgq->idx_r == msgq->idx_w) { *type = 0; @@ -93,6 +95,7 @@ int eos_msgq_find(EOSMsgQ *msgq, unsigned char type, unsigned char *selector, ui return 0; } +__attribute__ ((section (".itim"))) uint8_t eos_msgq_len(EOSMsgQ *msgq) { return (uint8_t)(msgq->idx_w - msgq->idx_r); } @@ -104,6 +107,7 @@ void eos_bufq_init(EOSBufQ *bufq, unsigned char **array, uint8_t size) { bufq->array = array; } +__attribute__ ((section (".itim"))) int eos_bufq_push(EOSBufQ *bufq, unsigned char *buffer) { if ((uint8_t)(bufq->idx_w - bufq->idx_r) == bufq->size) return EOS_ERR_FULL; @@ -111,12 +115,14 @@ int eos_bufq_push(EOSBufQ *bufq, unsigned char *buffer) { return EOS_OK; } +__attribute__ ((section (".itim"))) unsigned char *eos_bufq_pop(EOSBufQ *bufq) { if (bufq->idx_r == bufq->idx_w) return NULL; return bufq->array[IDX_MASK(bufq->idx_r++, bufq->size)]; } +__attribute__ ((section (".itim"))) uint8_t eos_bufq_len(EOSBufQ *bufq) { return (uint8_t)(bufq->idx_w - bufq->idx_r); } |