QP/C  7.0.1
Real-Time Embedded Framework
qxk.h File Reference

QXK/C (preemptive dual-mode kernel) platform-independent public interface. More...

#include "qequeue.h"
#include "qmpool.h"
#include "qpset.h"

Go to the source code of this file.

Classes

class  QXK
 The QXK kernel class. More...
 

Macros

#define QF_EQUEUE_TYPE   QEQueue
 
#define QF_OS_OBJECT_TYPE   void*
 
#define QF_THREAD_TYPE   void*
 
#define QXK_TLS(type_)   ((type_)QXK_current()->thread)
 
#define QXK_ISR_CONTEXT_()   (QXK_attr_.intNest != 0U)
 
#define QF_SCHED_STAT_   QSchedStatus lockStat_;
 
#define QF_SCHED_LOCK_(prio_)
 
#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_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
 

Detailed Description

Date
Last updated on: 2022-06-14
Version
Last updated for: Version 7.0.1, 2022-06-30 (planned)

Definition in file qxk.h.

Macro Definition Documentation

◆ QF_EQUEUE_TYPE

#define QF_EQUEUE_TYPE   QEQueue

Definition at line 44 of file qxk.h.

◆ QF_OS_OBJECT_TYPE

#define QF_OS_OBJECT_TYPE   void*

Definition at line 49 of file qxk.h.

◆ QF_THREAD_TYPE

#define QF_THREAD_TYPE   void*

Definition at line 52 of file qxk.h.

◆ QXK_TLS

#define QXK_TLS (   type_)    ((type_)QXK_current()->thread)

Access Thread-Local Storage (TLS) and cast it on the given type_

Definition at line 55 of file qxk.h.

◆ QXK_ISR_CONTEXT_

#define QXK_ISR_CONTEXT_ ( )    (QXK_attr_.intNest != 0U)

Internal macro that reports the execution context (ISR vs. thread)

Returns
true if the code executes in the ISR context and false otherwise

Definition at line 234 of file qxk.h.

◆ QF_SCHED_STAT_

#define QF_SCHED_STAT_   QSchedStatus lockStat_;

Internal macro to represent the scheduler lock status that needs to be preserved to allow nesting of locks.

Definition at line 241 of file qxk.h.

◆ QF_SCHED_LOCK_

#define QF_SCHED_LOCK_ (   prio_)
Value:
do { \
if (QXK_ISR_CONTEXT_()) { \
lockStat_ = 0xFFU; \
} else { \
lockStat_ = QXK_schedLock((prio_)); \
} \
} while (false)
#define QXK_ISR_CONTEXT_()
Definition: qxk.h:234
QSchedStatus QXK_schedLock(uint_fast8_t ceiling)
Definition: qxk.c:156

Internal macro for selective scheduler locking.

Definition at line 244 of file qxk.h.

◆ QF_SCHED_UNLOCK_

#define QF_SCHED_UNLOCK_ ( )
Value:
do { \
if (lockStat_ != 0xFFU) { \
QXK_schedUnlock(lockStat_); \
} \
} while (false)

Internal macro for selective scheduler unlocking.

Definition at line 253 of file qxk.h.

◆ QACTIVE_EQUEUE_WAIT_

#define QACTIVE_EQUEUE_WAIT_ (   me_)     (Q_ASSERT_ID(110, (me_)->eQueue.frontEvt != (QEvt *)0))

Definition at line 259 of file qxk.h.

◆ QACTIVE_EQUEUE_SIGNAL_

#define QACTIVE_EQUEUE_SIGNAL_ (   me_)
Value:
do { \
QPSet_insert(&QXK_attr_.readySet, (uint_fast8_t)(me_)->dynPrio); \
if (!QXK_ISR_CONTEXT_()) { \
if (QXK_sched_() != 0U) { \
QXK_activate_(); \
} \
} \
} while (false)
QPSet readySet
Definition: qxk.h:72
QXK QXK_attr_
Definition: qxk.h:78
uint_fast8_t QXK_sched_(void)
Definition: qxk.c:227

Definition at line 262 of file qxk.h.

◆ QF_EPOOL_TYPE_

#define QF_EPOOL_TYPE_   QMPool

Definition at line 272 of file qxk.h.

◆ QF_EPOOL_INIT_

#define QF_EPOOL_INIT_ (   p_,
  poolSto_,
  poolSize_,
  evtSize_ 
)     (QMPool_init(&(p_), (poolSto_), (poolSize_), (evtSize_)))

Definition at line 273 of file qxk.h.

◆ QF_EPOOL_EVENT_SIZE_

#define QF_EPOOL_EVENT_SIZE_ (   p_)    ((uint_fast16_t)(p_).blockSize)

Definition at line 275 of file qxk.h.

◆ QF_EPOOL_GET_

#define QF_EPOOL_GET_ (   p_,
  e_,
  m_,
  qs_id_ 
)     ((e_) = (QEvt *)QMPool_get(&(p_), (m_), (qs_id_)))

Definition at line 276 of file qxk.h.

◆ QF_EPOOL_PUT_

#define QF_EPOOL_PUT_ (   p_,
  e_,
  qs_id_ 
)     (QMPool_put(&(p_), (e_), (qs_id_)))

Definition at line 278 of file qxk.h.

Typedef Documentation

◆ QSchedStatus

typedef uint_fast16_t QSchedStatus

The scheduler lock status

Definition at line 165 of file qxk.h.