54Q_DEFINE_THIS_MODULE(
"qf_qeq")
58#if (QP_VERSION < 730U) || (QP_VERSION != ((QP_RELEASE^4294967295U)%0x2710U))
59#error qpc version 7.3.0 or higher required
69void QEQueue_init(
QEQueue *
const me,
70 struct QEvt const **
const qSto,
71 uint_fast16_t
const qLen)
77 #if (QF_EQUEUE_CTR_SIZE == 1U)
98 struct QEvt const *
const e,
99 uint_fast16_t
const margin,
100 uint_fast8_t
const qsId)
120 if (QEvt_getPoolNum_(e) != 0U) {
126 if (me->
nMin > nFree) {
134 QS_2U8_PRE_(QEvt_getPoolNum_(e), e->
refCtr_);
136 QS_EQC_PRE_(me->
nMin);
146 if (me->
head == 0U) {
161 QS_2U8_PRE_(QEvt_getPoolNum_(e), e->
refCtr_);
178 struct QEvt const *
const e,
179 uint_fast8_t
const qsId)
194 if (QEvt_getPoolNum_(e) != 0U) {
200 if (me->
nMin > nFree) {
208 QS_2U8_PRE_(QEvt_getPoolNum_(e), e->
refCtr_);
210 QS_EQC_PRE_(me->
nMin);
216 if (frontEvt != (
QEvt *)0) {
231 uint_fast8_t
const qsId)
243 if (e != (
QEvt *)0) {
251 if (nFree <= me->end) {
253 if (me->
tail == 0U) {
#define Q_UNUSED_PAR(par_)
Helper macro to clearly 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...
Internal (package scope) QP/C 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/C package-scope interface.
QP Functional Safety (FuSa) Subsystem.
#define Q_ASSERT_INCRIT(id_, expr_)
#define Q_INVARIANT_INCRIT(id_, expr_)
#define Q_REQUIRE_INCRIT(id_, expr_)
QEQueueCtr volatile tail
Offset of where next event will be extracted from the buffer.
QEQueueCtr volatile head
Offset to where next event will be inserted into the buffer.
QEQueueCtr end
Offset of the end of the ring buffer from the start of the buffer.
QEQueueCtr nMin
Minimum number of free events ever in the ring buffer.
QEQueueCtr volatile nFree
Number of free events in the ring buffer.
struct QEvt const ** ring
Pointer to the start of the ring buffer.
struct QEvt const *volatile frontEvt
Pointer to event at the front of the queue.
QSignal sig
Signal of the event (see Event Signal)
uint8_t volatile refCtr_
Reference counter (for mutable events and 0 for immutable (static) events)
static uint_fast8_t QEvt_getPoolNum_(QEvt const *const me)
Internal function to get the event pool-number of the given event.
static bool QEvt_verify_(QEvt const *const me)
Internal function to verify the event pointer and the memory marker in the event (QP FuSa Subsystem)