42 #error Source file included in a project NOT based on the QK kernel
45Q_DEFINE_THIS_MODULE(
"qk")
71 QK_priv_.lockCeil = (uint8_t)ceiling;
82 if (prevCeil != 0xFFU) {
100 QK_priv_.lockCeil = (uint8_t)prevCeil;
117 if (QPSet_notEmpty(&
QK_priv_.readySet)) {
119 p = (uint8_t)QPSet_findMax(&
QK_priv_.readySet);
143 uint_fast8_t
const pthre_in)
147 uint8_t p = act->
prio;
149 QPSet_remove(&
QK_priv_.readySet, p);
152 if (QPSet_isEmpty(&
QK_priv_.readySet)) {
157 p = (uint8_t)QPSet_findMax(&
QK_priv_.readySet);
180 uint8_t
const prio_in =
QK_priv_.actPrio;
189#if (defined QF_ON_CONTEXT_SW) || (defined Q_SPY)
190 uint8_t pprev = prio_in;
195 uint8_t pthre_in = 0U;
197 QActive const *
const a = QActive_registry_[prio_in];
207 QActive *
const a = QActive_registry_[p];
211 uint8_t
const pthre = a->
pthre;
217#if (defined QF_ON_CONTEXT_SW) || (defined Q_SPY)
225#ifdef QF_ON_CONTEXT_SW
226 QF_onContextSw(QActive_registry_[pprev], a);
235 QEvt const *
const e = QActive_get_(a);
240#if (QF_MAX_EPOOL > 0U)
256#if (defined QF_ON_CONTEXT_SW) || (defined Q_SPY)
264#ifdef QF_ON_CONTEXT_SW
265 QF_onContextSw(QActive_registry_[pprev],
266 QActive_registry_[prio_in]);
275#ifdef QF_ON_CONTEXT_SW
276 QF_onContextSw(QActive_registry_[pprev], (
QActive *)0);
321#ifdef QF_ON_CONTEXT_SW
327 if (QK_sched_() != 0U) {
342void QActive_start(
QActive *
const me,
345 uint_fast16_t
const qLen,
347 uint_fast16_t
const stkSize,
348 void const *
const par)
363 me->
prio = (uint8_t)(prioSpec & 0xFFU);
364 me->
pthre = (uint8_t)(prioSpec >> 8U);
365 QActive_register_(me);
367 QEQueue_init(&me->
eQueue, qSto, qLen);
375 if (QK_sched_() != 0U) {
uint_fast8_t QSchedStatus
The scheduler lock status for QK_schedLock() and QK_schedUnlock().
#define Q_UNUSED_PAR(par_)
Helper macro to mark unused parameters of functions.
QEvt const * QEvtPtr
Pointer to const event instances passed around in QP/C Framework.
int int_t
Alias for assertion-ID numbers in QP assertions and return from QF_run().
uint16_t QPrioSpec
Priority specification for Active Objects in QP.
#define QF_MAX_ACTIVE
Maximum # Active Objects in the system (1..64).
QP/C Framework in C internal (package-scope) interface.
#define QK_ISR_CONTEXT_()
Port-specific method to check if the QK kernel executes in the ISR context (used internally in QK onl...
#define QF_INT_DISABLE()
Port-specific interrupt disable.
#define QF_INT_ENABLE()
Port-specific interrupt enable.
@ QS_QF_RUN
QF_run() was entered.
@ QS_SCHED_IDLE
scheduler restored the idle task
@ QS_SCHED_LOCK
scheduler was locked
@ QS_SCHED_UNLOCK
scheduler was unlocked
@ QS_SCHED_NEXT
scheduler started next task
QS (QP/Spy software tracing) internal (package-scope) interface.
#define QS_2U8_PRE(data1_, data2_)
Output two pre-formatted unsigned 8-bit integer data elements.
#define QS_U8_PRE(data_)
Output pre-formatted unsigned 8-bit integer data element.
#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).
Active object class (based on the QHsm implementation strategy).
QACTIVE_EQUEUE_TYPE eQueue
Port-dependent event-queue type (often QEQueue).
uint8_t prio
QF-priority [1..QF_MAX_ACTIVE] of this AO.
uint8_t pthre
Preemption-threshold [1..QF_MAX_ACTIVE] of this AO.
struct QAsmVtable const * vptr
Virtual pointer inherited by all QAsm subclasses (see also SAS_QP_OOA).
Virtual table for the QAsm class.
void(* init)(QAsm *const me, void const *const e, uint_fast8_t const qsId)
Virtual function to take the top-most initial transition in the state machine.
void(* dispatch)(QAsm *const me, QEvt const *const e, uint_fast8_t const qsId)
Virtual function to dispatch an event to the state machine.
QK preemptive non-blocking kernel (QK namespace emulated as a "class" in C.
QSchedStatus QK_schedLock(uint8_t const ceiling)
QK selective scheduler lock.
uint_fast8_t QK_sched_(void)
QK scheduler finds the highest-priority AO ready to run.
void QK_activate_(void)
QK activator activates the next active object. The activated AO preempts the currently executing AOs.
uint_fast8_t QK_sched_act_(QActive const *const act, uint_fast8_t const pthre_in)
QK internal helper function to determine whether activation is needed.
void QK_schedUnlock(QSchedStatus const prevCeil)
QK selective scheduler unlock.