|
QP/C
|
QK/C platform-independent public interface. More...
Go to the source code of this file.
Defines | |
| #define | QF_EQUEUE_TYPE QEQueue |
| This macro defines the type of the event queue used for the active objects. | |
| #define | QACTIVE_EQUEUE_WAIT_(me_) (Q_ASSERT((me_)->eQueue.frontEvt != (QEvt *)0)) |
| Platform-dependent macro defining how QF should block the calling task when the QF native queue is empty. | |
| #define | QACTIVE_EQUEUE_SIGNAL_(me_) |
| Platform-dependent macro defining how QF should signal the active object task that an event has just arrived. | |
| #define | QACTIVE_EQUEUE_ONEMPTY_(me_) QPSet64_remove(&QK_readySet_, (me_)->prio) |
| Platform-dependent macro defining the action QF should take when the native QF event queue becomes empty. | |
| #define | QF_EPOOL_TYPE_ QMPool |
| This macro defines the type of the event pool used in this QF port. | |
| #define | QF_EPOOL_INIT_(p_, poolSto_, poolSize_, evtSize_) (QMPool_init(&(p_), (poolSto_), (poolSize_), (QMPoolSize)(evtSize_))) |
| Platform-dependent macro defining the event pool initialization. | |
| #define | QF_EPOOL_EVENT_SIZE_(p_) ((QEvtSize)(p_).blockSize) |
| Platform-dependent macro defining how QF should obtain the event pool block-size. | |
| #define | QF_EPOOL_GET_(p_, e_) ((e_) = (QEvt *)QMPool_get(&(p_))) |
| Platform-dependent macro defining how QF should obtain an event e_ from the event pool p_. | |
| #define | QF_EPOOL_PUT_(p_, e_) (QMPool_put(&(p_), (e_))) |
| Platform-dependent macro defining how QF should return an event e_ to the event pool p_. | |
Typedefs | |
| typedef uint8_t | QMutex |
| QK Mutex type. | |
Functions | |
| void | QK_sched_ (uint8_t p) |
| QK scheduler. | |
| void | QK_schedExt_ (uint8_t p) |
| QK extended scheduler. | |
| uint8_t | QK_schedPrio_ (void) |
| Find the highest-priority task ready to run. | |
| void | QK_init (void) |
| QK initialization. | |
| void | QK_onIdle (void) |
| QK idle callback (customized in BSPs for QK) | |
| char_t const Q_ROM *Q_ROM_VAR | QK_getVersion (void) |
| get the current QK version number string | |
| QMutex | QK_mutexLock (uint8_t const prioCeiling) |
| QK priority-ceiling mutex lock. | |
| void | QK_mutexUnlock (QMutex mutex) |
| QK priority-ceiling mutex unlock. | |
Variables | |
| uint8_t | QK_currPrio_ |
| uint8_t | QK_intNest_ |
QK/C platform-independent public interface.
This header file must be included directly or indirectly in all modules (*.c files) that use QK/C.
Definition in file qk.h.
| #define QACTIVE_EQUEUE_ONEMPTY_ | ( | me_ | ) | QPSet64_remove(&QK_readySet_, (me_)->prio) |
Platform-dependent macro defining the action QF should take when the native QF event queue becomes empty.
The macro is necessary only when the native QF event queue is used. The signaling of task involves unblocking the task if it is blocked.
Definition at line 161 of file qk.h.
Referenced by QActive_get_().
| #define QACTIVE_EQUEUE_SIGNAL_ | ( | me_ | ) |
do { \ QPSet64_insert(&QK_readySet_, (me_)->prio); \ if (QK_intNest_ == (uint8_t)0) { \ uint8_t p = QK_schedPrio_(); \ if (p != (uint8_t)0) { \ QK_sched_(p); \ } \ } \ } while (0)
Platform-dependent macro defining how QF should signal the active object task that an event has just arrived.
The macro is necessary only when the native QF event queue is used. The signaling of task involves unblocking the task if it is blocked.
Definition at line 138 of file qk.h.
Referenced by QActive_postFIFO(), and QActive_postLIFO().
| #define QACTIVE_EQUEUE_WAIT_ | ( | me_ | ) | (Q_ASSERT((me_)->eQueue.frontEvt != (QEvt *)0)) |
Platform-dependent macro defining how QF should block the calling task when the QF native queue is empty.
QK ready-set of active objects
Definition at line 107 of file qk.h.
Referenced by QActive_get_().
| #define QF_EPOOL_EVENT_SIZE_ | ( | p_ | ) | ((QEvtSize)(p_).blockSize) |
Platform-dependent macro defining how QF should obtain the event pool block-size.
Definition at line 192 of file qk.h.
Referenced by QF_poolInit().
| #define QF_EPOOL_GET_ | ( | p_, | |
| e_ | |||
| ) | ((e_) = (QEvt *)QMPool_get(&(p_))) |
| #define QF_EPOOL_INIT_ | ( | p_, | |
| poolSto_, | |||
| poolSize_, | |||
| evtSize_ | |||
| ) | (QMPool_init(&(p_), (poolSto_), (poolSize_), (QMPoolSize)(evtSize_))) |
Platform-dependent macro defining the event pool initialization.
Definition at line 182 of file qk.h.
Referenced by QF_poolInit().
| #define QF_EPOOL_PUT_ | ( | p_, | |
| e_ | |||
| ) | (QMPool_put(&(p_), (e_))) |
Platform-dependent macro defining how QF should return an event e_ to the event pool p_.
Definition at line 210 of file qk.h.
Referenced by QF_gc().
| #define QF_EPOOL_TYPE_ QMPool |
| #define QF_EQUEUE_TYPE QEQueue |
This macro defines the type of the event queue used for the active objects.
| typedef uint8_t QMutex |
QK Mutex type.
QMutex represents the priority-ceiling mutex available in QK.
| char_t const Q_ROM* Q_ROM_VAR QK_getVersion | ( | void | ) |
get the current QK version number string
Definition at line 62 of file qk.c.
References QF_getVersion().
| void QK_init | ( | void | ) |
| QMutex QK_mutexLock | ( | uint8_t const | prioCeiling | ) |
QK priority-ceiling mutex lock.
Lock the QK scheduler up to the priority level prioCeiling.
QMutex mux; . . . mux = QK_mutexLock(PRIO_CEILING); /* access the shared resource */ QK_mutexUnlock(mux); . . .
Definition at line 54 of file qk_mutex.c.
References QK_ceilingPrio_, QS_BEGIN_NOCRIT_, QS_END_NOCRIT_, QS_QK_MUTEX_LOCK, QS_TIME_, and QS_U8_.
| void QK_mutexUnlock | ( | QMutex | mutex | ) |
QK priority-ceiling mutex unlock.
QMutex mux; . . . mux = QK_mutexLock(PRIO_CEILING); /* access the shared resource */ QK_mutexUnlock(mux); . . .
Definition at line 73 of file qk_mutex.c.
References QK_ceilingPrio_, QK_sched_(), QK_schedPrio_(), QS_BEGIN_NOCRIT_, QS_END_NOCRIT_, QS_QK_MUTEX_UNLOCK, QS_TIME_, and QS_U8_.
| void QK_onIdle | ( | void | ) |
QK idle callback (customized in BSPs for QK)
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.
Referenced by QF_run().
| void QK_sched_ | ( | uint8_t | p | ) |
QK scheduler.
Definition at line 70 of file qk_sched.c.
References QActive_get_(), QF_active_, QF_gc(), QF_INT_DISABLE, QF_INT_ENABLE, QK_currPrio_, QK_TLS, QPSet64_findMax, QPSet8_findMax, QS_aoObj_, QS_BEGIN_NOCRIT_, QS_END_NOCRIT_, QS_QK_SCHEDULE, QS_TIME_, QS_U8_, and QActive::super.
Referenced by QK_mutexUnlock().
| void QK_schedExt_ | ( | uint8_t | p | ) |
QK extended scheduler.
Definition at line 48 of file qk_ext.c.
References QActive_get_(), QF_active_, QF_gc(), QF_INT_DISABLE, QF_INT_ENABLE, QK_currPrio_, QK_EXT_SAVE, QK_TLS, QPSet64_findMax, QPSet8_findMax, QS_aoObj_, QS_BEGIN_NOCRIT_, QS_END_NOCRIT_, QS_QK_SCHEDULE, QS_TIME_, QS_U8_, and QActive::super.
| uint8_t QK_schedPrio_ | ( | void | ) |
Find the highest-priority task ready to run.
Definition at line 48 of file qk_sched.c.
References QK_ceilingPrio_, QK_currPrio_, QPSet64_findMax, and QPSet8_findMax.
Referenced by QK_mutexUnlock().
| uint8_t QK_currPrio_ |
current task/interrupt priority
Definition at line 55 of file qk.c.
Referenced by QK_sched_(), QK_schedExt_(), and QK_schedPrio_().
| uint8_t QK_intNest_ |
1.7.6.1