QK preemptive non-blocking kernel (QK namespace emulated as a "class" in C). More...
Static Public Member Functions | |
| QSchedStatus | QK_schedLock (uint8_t const ceiling) |
| QK selective scheduler lock. | |
| void | QK_schedUnlock (QSchedStatus const prevCeil) |
| QK selective scheduler unlock. | |
| void | QK_onIdle (void) |
| QK idle callback (customized in BSPs for QK). | |
Static Private Member Functions | |
| uint_fast8_t | QK_sched_ (void) |
| QK scheduler finds the highest-priority AO ready to run. | |
| 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_activate_ (void) |
| QK activator activates the next active object. The activated AO preempts the currently executing AOs. | |
Private Attributes | |
| QPSet | readySet |
| Set of active-objects/threads that are ready to run in the QK kernel. | |
| uint8_t | actPrio |
| Priority of the currently active AO. | |
| uint8_t | nextPrio |
| Next AO priority scheduled by QK. | |
| uint8_t | actThre |
| Preemption threshold of the currently active AO. | |
| uint8_t | lockCeil |
| Scheduler lock-ceiling (0 if scheduler unlocked). | |
| uint8_t | intNest |
| Up-down counter indicating current interrupt nesting (used in some QK ports) . | |
| QK | QK_priv_ |
QK preemptive non-blocking kernel (QK namespace emulated as a "class" in C).
Details
The QK kernel is emulated in C as a "class" with only static members. Its private attributes (such as QK::readySet, QK::actPrio, QK::nextPrio, QK::actThre, QK::lockCeil, and QK::intNest, as well as their Duplicate Inverse Storage in SafeQP) are kept in the single instance QK_priv_ of the QK structure.
See also
Backward Traceability
Forward Traceability
|
staticprivate |
QK scheduler finds the highest-priority AO ready to run.
Details
The QK scheduler finds out the priority of the highest-priority AO that (1) has events to process and (2) has priority that is higher than the system ceiling, which is the larger of the preemption threshold of the running AO and the scheduler-lock ceiling (see [SDS_QP_QK]).
| priority | The QF-priority of the next active object to activate, |
| 0 | if no activation of AO is needed. |
Backward Traceability
Forward Traceability
|
staticprivate |
QK internal helper function to determine whether activation is needed.
Details
| [in] | act | currently executing Active Object |
| [in] | pthre_in | current priority threshold |
| priority | The priority of Active Object to activate |
| 0 | if no activation needed |
Forward Traceability
|
staticprivate |
QK activator activates the next active object. The activated AO preempts the currently executing AOs.
Details
QK_activate_() activates, one after another, the ready-to-run AOs with priorities higher than both the preemption threshold of the preempted context and the scheduler-lock ceiling (see [SDS_QP_QK]).
Backward Traceability
Forward Traceability
|
static |
QK selective scheduler lock.
Details
This function locks the QK scheduler to the specified ceiling: Active Objects with priorities equal to or lower than the ceiling are not activated until the scheduler is unlocked. The lock request only raises the current lock ceiling; a request with a ceiling equal to or lower than the current lock ceiling leaves it unchanged and returns the status 0xFF, for which the unlock has no effect.
| [in] | ceiling | preemption ceiling to which the QK scheduler needs to be locked |
| lock-status | The previous QK Scheduler lock status, which is to be used to unlock the scheduler by restoring its previous lock status in QK_schedUnlock(). |
See also
Usage
The following example shows how to lock and unlock the QK scheduler:
Backward Traceability
Forward Traceability
|
static |
QK selective scheduler unlock.
Details
This function unlocks the QK scheduler to the previous status.
| [in] | prevCeil | previous QK Scheduler lock ceiling returned from QK_schedLock() |
See also
Usage
The following example shows how to lock and unlock the QK scheduler:
Backward Traceability
Forward Traceability
|
static |
QK idle callback (customized in BSPs for QK).
Details
QK_onIdle() is called continuously by the QK idle loop. This callback gives the application an opportunity to enter a power-saving CPU mode, or perform some other idle processing.
Backward Traceability
Forward Traceability
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |