40Q_DEFINE_THIS_MODULE(
"qf_qeq")
46 uint_fast16_t const qLen)
51#if (QF_EQUEUE_CTR_SIZE == 1U)
56 me->frontEvt.e = (
QEvt *)0;
72 struct QEvt const *
const e,
73 uint_fast16_t
const margin,
74 uint_fast8_t
const qsId)
95#if (QF_MAX_EPOOL > 0U)
153 struct QEvt const *
const e,
154 uint_fast8_t
const qsId)
210 uint_fast8_t
const qsId)
221 if (e != (
QEvt *)0) {
227 if (nFree <= me->
end) {
279 nUse = (uint16_t)((uint16_t)me->
end + 1U - (uint16_t)me->
nFree);
288 return (uint16_t)me->
nFree;
295 return (uint16_t)me->
nMin;
uint16_t QEQueueCtr
The data type to store the ring-buffer counters.
#define Q_UNUSED_PAR(par_)
Helper macro to mark unused parameters of functions.
#define QF_NO_MARGIN
Special value of margin that causes asserting failure in case event allocation or event posting fails...
QP/C Framework in C internal (package-scope) interface.
#define QF_CRIT_ENTRY()
Port-specific critical section entry.
#define QF_CRIT_EXIT()
Port-specific critical section exit.
#define QF_CRIT_STAT
Define the critical section status that was present before entering the critical section.
@ QS_QF_EQUEUE_GET_LAST
get the last event from the queue
@ QS_QF_EQUEUE_POST_ATTEMPT
attempt to post evt to QEQueue failed
@ QS_QF_EQUEUE_POST_LIFO
an event was posted (LIFO) to a raw queue
@ QS_QF_EQUEUE_GET
get an event and queue still not empty
@ QS_QF_EQUEUE_POST
an event was posted (FIFO) to a raw queue
QS (QP/Spy software tracing) internal (package-scope) interface. \clearpage .
#define QS_OBJ_PRE(obj_)
Output pre-formatted object pointer element.
#define QS_EQC_PRE(ctr_)
Output pre-formatted event queue counter data element.
#define QS_SIG_PRE(sig_)
Output pre-formatted event signal data element.
#define QS_2U8_PRE(data1_, data2_)
Output two pre-formatted unsigned 8-bit integer data elements.
#define QS_END_PRE()
Pre-formatted QS trace record end.
#define QS_BEGIN_PRE(rec_, qsId_)
Pre-formatted QS trace record begin.
QP Functional Safety (FuSa) Subsystem (fault detection).
#define Q_ASSERT_INCRIT(id_, expr_)
General-purpose assertion with user-specified ID number (in critical section).
#define Q_REQUIRE_INCRIT(id_, expr_)
Assertion for checking a precondition (in critical section).
uint16_t QEQueue_getFree(QEQueue const *const me)
Obtain the number of free entries still available in the queue.
void QEQueue_init(QEQueue *const me, QEvtPtr *const qSto, uint_fast16_t const qLen)
Initialize the native QF event queue.
QEQueueCtr nFree
Number of free events in the ring buffer \clearpage .
QEQueueCtr end
Offset of the end of the ring buffer from the start of the buffer \clearpage .
uint16_t QEQueue_getUse(QEQueue const *const me)
Obtain the number of entries in use in the queue.
struct QEvt const * QEQueue_get(QEQueue *const me, uint_fast8_t const qsId)
Obtain an event from the "raw" thread-safe queue.
QEQueueCtr nMin
Minimum number of free events ever in the ring buffer.
QEQueueCtr tail
Offset of where next event will be extracted from the buffer \clearpage .
bool QEQueue_isEmpty(QEQueue const *const me)
Find out if the queue is empty.
QEvtPtr * ring
Pointer to the start of the ring buffer \clearpage .
QEQueueCtr head
Offset to where next event will be inserted into the buffer \clearpage .
void QEQueue_postLIFO(QEQueue *const me, struct QEvt const *const e, uint_fast8_t const qsId)
Post an event to the "raw" thread-safe event queue (LIFO).
uint16_t QEQueue_getMin(QEQueue const *const me)
Obtain the minimum number of free entries ever in the queue (a.k.a. "low-watermark").
QEvtPtr frontEvt
Pointer to event at the front of the queue.
bool QEQueue_post(QEQueue *const me, struct QEvt const *const e, uint_fast16_t const margin, uint_fast8_t const qsId)
Post an event to the "raw" thread-safe event queue (FIFO).
uint32_t refCtr_
Event reference counter.
uint32_t poolNum_
Event pool number of this event.
uint32_t sig
Event signal (see Event Signal).
The data type to store in the event queue ring-buffer.