66#define QXTHREAD_NO_TIMEOUT ((QTimeEvtCtr)0)
125uint_fast8_t QXK_sched_(
void);
129void QXK_activate_(
void);
133void QXK_contextSw_(
QActive *
const next);
137void QXK_threadExit_(
void);
164 uint_fast8_t
const tickRate);
170bool QXThread_delayCancel(
QXThread *
const me);
178void QXThread_block_(
QXThread const *
const me);
181void QXThread_unblock_(
QXThread const *
const me);
184void QXThread_timeout_(
QActive *
const act);
187void QXThread_teArm_(
QXThread *
const me,
192bool QXThread_teDisarm_(
QXThread *
const me);
201 uint_fast16_t
const stkSize);
225 uint_fast8_t
const count,
226 uint_fast8_t
const max_count);
260bool QXMutex_lock(
QXMutex *
const me,
264bool QXMutex_tryLock(
QXMutex *
const me);
267void QXMutex_unlock(
QXMutex *
const me);
273#define QXTHREAD_START(me_, prioSpec_, qSto_, qLen_, stkSto_, stkSize_, par_) QACTIVE_START((me_), (prioSpec_), (qSto_), (qLen_), \
274 (stkSto_), (stkSize_), (par_))
277#define QXTHREAD_POST_X(me_, e_, margin_, sender_) \
278 QACTIVE_POST_X(&(me_)->super, (e_), (margin_), (sender_))
288#define QF_SCHED_STAT_ QSchedStatus lockStat_;
291#define QF_SCHED_LOCK_(ceil_) do { \
292 if (QXK_ISR_CONTEXT_()) { \
295 lockStat_ = QXK_schedLock((ceil_)); \
300#define QF_SCHED_UNLOCK_() do { \
301 if (lockStat_ != 0xFFU) { \
302 QXK_schedUnlock(lockStat_); \
307#define QACTIVE_EQUEUE_WAIT_(me_) \
308 Q_ASSERT_INCRIT(310, (me_)->eQueue.frontEvt != (QEvt *)0)
312#define QACTIVE_EQUEUE_SIGNAL_(me_) do { \
313 QPSet_insert(&QXK_priv_.readySet, (uint_fast8_t)(me_)->prio); \
314 QPSet_update_(&QXK_priv_.readySet, &QXK_priv_.readySet_dis); \
315 if (!QXK_ISR_CONTEXT_()) { \
316 if (QXK_sched_() != 0U) { \
325#define QACTIVE_EQUEUE_SIGNAL_(me_) do { \
326 QPSet_insert(&QXK_priv_.readySet, (uint_fast8_t)(me_)->prio); \
327 if (!QXK_ISR_CONTEXT_()) { \
328 if (QXK_sched_() != 0U) { \
337#define QXTHREAD_EQUEUE_SIGNAL_(me_) do { \
338 if (me->super.temp.obj == QXK_PTR_CAST_(QMState*, &me->eQueue)) { \
339 (void)QXThread_teDisarm_(QXTHREAD_CAST_(me)); \
340 QPSet_insert(&QXK_priv_.readySet, (uint_fast8_t)me->prio); \
341 QPSet_update_(&QXK_priv_.readySet, &QXK_priv_.readySet_dis); \
342 if (!QXK_ISR_CONTEXT_()) { \
343 (void)QXK_sched_(); \
351#define QXTHREAD_EQUEUE_SIGNAL_(me_) do { \
352 if (me->super.temp.obj == QXK_PTR_CAST_(QMState*, &me->eQueue)) { \
353 (void)QXThread_teDisarm_(QXTHREAD_CAST_(me)); \
354 QPSet_insert(&QXK_priv_.readySet, (uint_fast8_t)me->prio); \
355 if (!QXK_ISR_CONTEXT_()) { \
356 (void)QXK_sched_(); \
363#define QXK_PTR_CAST_(type_, ptr_) ((type_)(ptr_))
366#define QXTHREAD_CAST_(ptr_) ((QXThread *)(ptr_))
372#define QF_EPOOL_TYPE_ QMPool
375#define QF_EPOOL_INIT_(p_, poolSto_, poolSize_, evtSize_) \
376 (QMPool_init(&(p_), (poolSto_), (poolSize_), (evtSize_)))
379#define QF_EPOOL_EVENT_SIZE_(p_) ((uint_fast16_t)(p_).blockSize)
382#define QF_EPOOL_GET_(p_, e_, m_, qs_id_) \
383 ((e_) = (QEvt *)QMPool_get(&(p_), (m_), (qs_id_)))
386#define QF_EPOOL_PUT_(p_, e_, qs_id_) \
387 (QMPool_put(&(p_), (e_), (qs_id_)))
void(* QXThreadHandler)(struct QXThread *const me)
uint_fast16_t QSchedStatus
Active object class (based on the QHsm implementation strategy)
Set of Active Objects of up to QF_MAX_ACTIVE elements.
Private attributes of the QXK kernel.
struct QActive *volatile curr
uint_fast8_t volatile lockHolder
uint_fast8_t volatile lockCeil
struct QActive *volatile next
struct QActive *volatile prev
uint_fast8_t volatile actPrio
QXK dual-mode kernel (QXK namespace emulated as a "class" in C)
QSchedStatus QXK_schedLock(uint_fast8_t const ceiling)
Blocking Mutex of the QXK preemptive kernel.
void QXMutex_init(QXMutex *const me, QPrioSpec const prioSpec)
Counting Semaphore of the QXK preemptive kernel.
void QXSemaphore_init(QXSemaphore *const me, uint_fast8_t const count, uint_fast8_t const max_count)
eXtended (blocking) thread of the QXK preemptive kernel
void QXThread_stackInit_(QActive *const me, QXThreadHandler const handler, void *const stkSto, uint_fast16_t const stkSize)
void QXThread_ctor(QXThread *const me, QXThreadHandler const handler, uint_fast8_t const tickRate)
QXThread const * QXThread_dummy