QK/C (preemptive non-blocking kernel) platform-independent public interface. More...
Go to the source code of this file.
Data Structures | |
struct | QK_PrivAttr |
private attributes of the QK kernel More... | |
Macros | |
#define | QF_EQUEUE_TYPE QEQueue |
#define | QF_THREAD_TYPE void* |
#define | QK_ISR_CONTEXT_() (QK_attr_.intNest != 0U) |
Internal macro that reports the execution context (ISR vs. More... | |
#define | QF_SCHED_STAT_ QSchedStatus lockStat_; |
Internal macro to represent the scheduler lock status that needs to be preserved to allow nesting of locks. More... | |
#define | QF_SCHED_LOCK_(prio_) |
Internal macro for selective scheduler locking. More... | |
#define | QF_SCHED_UNLOCK_() |
Internal macro for selective scheduler unlocking. More... | |
#define | QACTIVE_EQUEUE_WAIT_(me_) (Q_ASSERT_ID(110, (me_)->eQueue.frontEvt != (QEvt *)0)) |
#define | QACTIVE_EQUEUE_SIGNAL_(me_) |
#define | QF_EPOOL_TYPE_ QMPool |
#define | QF_EPOOL_INIT_(p_, poolSto_, poolSize_, evtSize_) (QMPool_init(&(p_), (poolSto_), (poolSize_), (evtSize_))) |
#define | QF_EPOOL_EVENT_SIZE_(p_) ((uint_fast16_t)(p_).blockSize) |
#define | QF_EPOOL_GET_(p_, e_, m_, qs_id_) ((e_) = (QEvt *)QMPool_get(&(p_), (m_), (qs_id_))) |
#define | QF_EPOOL_PUT_(p_, e_, qs_id_) (QMPool_put(&(p_), (e_), (qs_id_))) |
Typedefs | |
typedef uint_fast16_t | QSchedStatus |
QK Scheduler locking. More... | |
Functions | |
void | QK_onContextSw (struct QActive *prev, struct QActive *next) |
QK context switch callback (customized in BSPs for QK) More... | |
void | QK_onIdle (void) |
QK idle callback (customized in BSPs for QK) More... | |
uint_fast8_t | QK_sched_ (void) |
QK scheduler finds the highest-priority thread ready to run. More... | |
void | QK_activate_ (void) |
QK activator activates the next active object. More... | |
QSchedStatus | QK_schedLock (uint_fast8_t ceiling) |
QK Scheduler lock. More... | |
void | QK_schedUnlock (QSchedStatus stat) |
QK Scheduler unlock. More... | |
Variables | |
QK_PrivAttr | QK_attr_ |
global private attributes of the QK kernel More... | |
QK/C (preemptive non-blocking kernel) platform-independent public interface.
Definition in file qk.h.
struct QK_PrivAttr |
Data Fields | ||
---|---|---|
uint8_t volatile | actPrio | prio of the active AO |
uint8_t volatile | nextPrio | prio of the next AO to execute |
uint8_t volatile | lockPrio | lock prio (0 == no-lock) |
uint8_t volatile | lockHolder | prio of the AO holding the lock |
uint8_t volatile | intNest | ISR nesting level. |
QPSet | readySet | QK ready-set of AOs. |
#define QK_ISR_CONTEXT_ | ( | ) | (QK_attr_.intNest != 0U) |
#define QF_SCHED_STAT_ QSchedStatus lockStat_; |
#define QF_SCHED_LOCK_ | ( | prio_ | ) |
Internal macro for selective scheduler locking.
#define QF_SCHED_UNLOCK_ | ( | ) |
#define QACTIVE_EQUEUE_WAIT_ | ( | me_ | ) | (Q_ASSERT_ID(110, (me_)->eQueue.frontEvt != (QEvt *)0)) |
#define QACTIVE_EQUEUE_SIGNAL_ | ( | me_ | ) |
#define QF_EPOOL_INIT_ | ( | p_, | |
poolSto_, | |||
poolSize_, | |||
evtSize_ | |||
) | (QMPool_init(&(p_), (poolSto_), (poolSize_), (evtSize_))) |
#define QF_EPOOL_EVENT_SIZE_ | ( | p_ | ) | ((uint_fast16_t)(p_).blockSize) |
#define QF_EPOOL_GET_ | ( | p_, | |
e_, | |||
m_, | |||
qs_id_ | |||
) | ((e_) = (QEvt *)QMPool_get(&(p_), (m_), (qs_id_))) |
#define QF_EPOOL_PUT_ | ( | p_, | |
e_, | |||
qs_id_ | |||
) | (QMPool_put(&(p_), (e_), (qs_id_))) |
typedef uint_fast16_t QSchedStatus |
QK context switch callback (customized in BSPs for QK)
[in] | prev | pointer to the previous thread (active object) (prev==0 means that prev was the QK idle loop) |
[in] | next | pointer to the next thread (active object) (next==0) means that next is the QK idle loop) |
void QK_onIdle | ( | void | ) |
QK idle callback (customized in BSPs for QK)
uint_fast8_t QK_sched_ | ( | void | ) |
QK scheduler finds the highest-priority thread ready to run.
void QK_activate_ | ( | void | ) |
QK activator activates the next active object.
The activated AO preempts the currently executing AOs.
QSchedStatus QK_schedLock | ( | uint_fast8_t | ceiling | ) |
QK Scheduler lock.
[in] | ceiling | priority ceiling to which the QK scheduler needs to be locked |
void QK_schedUnlock | ( | QSchedStatus | stat | ) |
QK Scheduler unlock.
[in] | stat | previous QK Scheduler lock status returned from QK_schedLock() |
|
extern |