42 #error Source file included in a project NOT based on the QK kernel
45Q_DEFINE_THIS_MODULE(
"qk")
64 QS_2U8_PRE((uint8_t)QK_priv_.lockCeil, (uint8_t)ceiling);
71 QK_priv_.lockCeil = ceiling;
82 if (prevCeil != 0xFFU) {
112 if (QPSet_notEmpty(&
QK_priv_.readySet)) {
114 p = QPSet_findMax(&
QK_priv_.readySet);
138 uint_fast8_t
const pthre_in)
142 uint_fast8_t p = act->
prio;
144 QPSet_remove(&
QK_priv_.readySet, p);
147 if (QPSet_isEmpty(&
QK_priv_.readySet)) {
152 p = QPSet_findMax(&
QK_priv_.readySet);
175 uint_fast8_t
const prio_in =
QK_priv_.actPrio;
181#if (defined QF_ON_CONTEXT_SW) || (defined Q_SPY)
182 uint_fast8_t pprev = prio_in;
187 uint_fast8_t pthre_in = 0U;
189 QActive const *
const a = QActive_registry_[prio_in];
192 pthre_in = (uint_fast8_t)a->
pthre;
197 QActive *
const a = QActive_registry_[p];
199 uint_fast8_t
const pthre = (uint_fast8_t)a->
pthre;
205#if (defined QF_ON_CONTEXT_SW) || (defined Q_SPY)
214#ifdef QF_ON_CONTEXT_SW
215 QF_onContextSw(QActive_registry_[pprev], a);
224 QEvt const *
const e = QActive_get_(a);
228#if (QF_MAX_EPOOL > 0U)
242#if (defined QF_ON_CONTEXT_SW) || (defined Q_SPY)
250#ifdef QF_ON_CONTEXT_SW
251 QF_onContextSw(QActive_registry_[pprev],
252 QActive_registry_[prio_in]);
261#ifdef QF_ON_CONTEXT_SW
262 QF_onContextSw(QActive_registry_[pprev], (
QActive *)0);
272 QF_bzero_(&QK_priv_,
sizeof(QK_priv_));
273 QF_bzero_(&QActive_registry_[0],
sizeof(QActive_registry_));
298 QS_beginRec_((uint_fast8_t)QS_QF_RUN);
308#ifdef QF_ON_CONTEXT_SW
314 if (QK_sched_() != 0U) {
333void QActive_start(
QActive *
const me,
336 uint_fast16_t
const qLen,
338 uint_fast16_t
const stkSize,
339 void const *
const par)
348 && (stkSto == (
void *)0));
351 me->
prio = (uint8_t)(prioSpec & 0xFFU);
352 me->
pthre = (uint8_t)(prioSpec >> 8U);
353 QActive_register_(me);
355 QEQueue_init(&me->
eQueue, qSto, qLen);
363 if (QK_sched_() != 0U) {
uint_fast8_t QSchedStatus
#define Q_UNUSED_PAR(par_)
Helper macro to clearly mark unused parameters of functions.
QEvt const * QEvtPtr
Pointer to const event instances passed around in QP 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)
Internal (package scope) QP/C interface.
#define QK_ISR_CONTEXT_()
#define QF_INT_DISABLE()
Disable interrupts.
#define QF_INT_ENABLE()
Enable interrupts.
QS/C dummy public interface.
#define QS_2U8_PRE(data1_, data2_)
#define QS_BEGIN_PRE(rec_, qsId_)
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_OO)
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.
Private attributes of the QK kernel.
uint_fast8_t QK_sched_(void)
uint_fast8_t QK_sched_act_(QActive const *const act, uint_fast8_t const pthre_in)
void QK_schedUnlock(QSchedStatus const prevCeil)