40Q_DEFINE_THIS_MODULE(
"qf_qeq")
45 struct
QEvt const * * const qSto,
46 uint_fast16_t const qLen)
51#if (QF_EQUEUE_CTR_SIZE == 1U)
56 me->frontEvt = (
QEvt *)0;
72 struct QEvt const *
const e,
73 uint_fast16_t
const margin,
74 uint_fast8_t
const qsId)
88 bool status = (
nFree > 0U);
99#if (QF_MAX_EPOOL > 0U)
157 struct QEvt const *
const e,
158 uint_fast8_t
const qsId)
215 uint_fast8_t
const qsId)
226 if (e != (
QEvt *)0) {
232 if (nFree <= me->
end) {
284 nUse = (uint16_t)((uint16_t)me->
end + 1U - (uint16_t)me->
nFree);
293 return (uint16_t)me->
nFree;
300 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.
@ 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.
#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.
#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.
QEQueueCtr nFree
Number of free events in the ring buffer.
QEQueueCtr end
Offset of the end of the ring buffer from the start of the buffer.
uint16_t QEQueue_getUse(QEQueue const *const me)
Obtain the number of entries in use in the queue.
struct QEvt const * frontEvt
Pointer to event at the front of 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.
bool QEQueue_isEmpty(QEQueue const *const me)
Find out if the queue is empty.
struct QEvt const ** ring
Pointer to the start of the ring buffer.
void QEQueue_init(QEQueue *const me, struct QEvt const **const qSto, uint_fast16_t const qLen)
Initialize the native QF event queue.
QEQueueCtr head
Offset to where next event will be inserted into the buffer.
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").
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).