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);
239#if (QF_MAX_EPOOL > 0U)
255#if (defined QF_ON_CONTEXT_SW) || (defined Q_SPY)
263#ifdef QF_ON_CONTEXT_SW
264 QF_onContextSw(QActive_registry_[pprev],
265 QActive_registry_[prio_in]);
274#ifdef QF_ON_CONTEXT_SW
275 QF_onContextSw(QActive_registry_[pprev], (
QActive *)0);
320#ifdef QF_ON_CONTEXT_SW
326 if (QK_sched_() != 0U) {
341void QActive_start(
QActive *
const me,
344 uint_fast16_t
const qLen,
346 uint_fast16_t
const stkSize,
347 void const *
const par)
362 me->
prio = (uint8_t)(prioSpec & 0xFFU);
363 me->
pthre = (uint8_t)(prioSpec >> 8U);
364 QActive_register_(me);
366 QEQueue_init(&me->
eQueue, qSto, qLen);
374 if (QK_sched_() != 0U) {
uint_fast8_t QSchedStatus
The scheduler lock status for QK_schedLock() and QK_schedUnlock().
QEvt const * QEvtPtr
Pointer to const event instances passed around in QP/C Framework.
#define QASM_INIT(me_, par_, qsId_)
Virtual call to the top-most initial transition in a state machine.
#define Q_UNUSED_PAR(par_)
Helper macro to mark unused parameters of functions.
int int_t
Alias for assertion-ID numbers in QP assertions and return from QF_run().
#define QASM_DISPATCH(me_, e_, qsId_)
Virtual call to dispatch an event to a state machine.
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.
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.