QP/C  7.0.0
Real-Time Embedded Framework
macros.h File Reference

Various macros for configuring and porting QP/C. More...

Go to the source code of this file.

Macros

#define Q_NASSERT
 When defined, Q_NASSERT disables the following macros Q_ASSERT, Q_REQUIRE, Q_ENSURE, Q_INVARIANT, Q_ERROR as well as Q_ASSERT_ID, Q_REQUIRE_ID, Q_ENSURE_ID, Q_INVARIANT_ID, and Q_ERROR_ID do not evaluate the test condition passed as the argument to these macros. More...
 
#define Q_SPY
 When defined, Q_SPY activates the QS software tracing instrumentation. More...
 
#define Q_UTEST
 
#define Q_EVT_CTOR
 
#define QF_THREAD_TYPE   void*
 
#define QF_EQUEUE_TYPE   QEQueue
 
#define QF_OS_OBJECT_TYPE   pthread_cond_t
 
#define QACTIVE_EQUEUE_WAIT_(me_)    (Q_ASSERT((me_)->eQueue.frontEvt != (QEvt *)0))
 
#define QACTIVE_EQUEUE_SIGNAL_(me_)
 
#define QF_EPOOL_TYPE_   QMPool
 
#define QK_ON_CONTEXT_SW
 
#define QXK_ON_CONTEXT_SW
 
#define QF_EPOOL_INIT_(p_, poolSto_, poolSize_, evtSize_)    (QMPool_init(&(p_), (poolSto_), (poolSize_), (QMPoolSize)(evtSize_)))
 
#define QF_EPOOL_EVENT_SIZE_(p_)   ((QEvtSize)(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_)))
 

Macro Definition Documentation

◆ Q_NASSERT

#define Q_NASSERT

The preprocessor switch to disable checking assertions

Note
The notable exceptions are the macros Q_ALLEGE and Q_ALLEGE_ID, that still evaluate the test condition, but do not report assertion failures when the switch Q_NASSERT is defined.

Definition at line 18 of file macros.h.

◆ Q_SPY

#define Q_SPY

The preprocessor switch to activate the QS software tracing instrumentation in the code When Q_SPY is not defined, the QS instrumentation in the code does not generate any code.

Definition at line 27 of file macros.h.

◆ Q_UTEST

#define Q_UTEST

The preprocessor switch to activate the QUTest unit testing instrumentation in the code

Note
This macro requires that Q_SPY be defined as well.

Definition at line 35 of file macros.h.

◆ Q_EVT_CTOR

#define Q_EVT_CTOR

The preprocessor switch to enable constructor in the QEvt class instrumentation in the code

Traceability:
traces to: RQP005

Definition at line 42 of file macros.h.

◆ QF_THREAD_TYPE

#define QF_THREAD_TYPE   void*

This macro defines the type of the thread handle used for AOs

Definition at line 45 of file macros.h.

◆ QF_EQUEUE_TYPE

#define QF_EQUEUE_TYPE   QEQueue

This macro defines the type of the event-queue used for AOs

Definition at line 48 of file macros.h.

◆ QF_OS_OBJECT_TYPE

#define QF_OS_OBJECT_TYPE   pthread_cond_t

This macro defines the type of the OS-Object used for blocking the native QEQueue when the queue is empty

This macro is used when QEQueue is used as the event-queue for AOs but also the AO queue must block when the queue is empty. In that case, QF_OS_OBJECT_TYPE specifies the blocking mechanism. For examle, in the POSIX port, the blocking mechanism is a condition variable.

Definition at line 60 of file macros.h.

◆ QACTIVE_EQUEUE_WAIT_

#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

Note
This is just an example of QACTIVE_EQUEUE_WAIT_() for the QK-port of QF. QK never activates a task that has no events to process, so in this case the macro asserts that the queue is not empty. In other QF ports you need to define the macro appropriately for the underlying kernel/OS you're using.

Definition at line 71 of file macros.h.

◆ QACTIVE_EQUEUE_SIGNAL_

#define QACTIVE_EQUEUE_SIGNAL_ (   me_)
Value:
do { \
QPSet8_insert(&QK_readySet_, (me_)->prio); \
if (QK_intNest_ == 0U) { \
uint_fast8_t p = QK_schedPrio_(); \
if (p != 0U) { \
QK_sched_(p); \
} \
} \
} while (0)

Definition at line 75 of file macros.h.

◆ QF_EPOOL_TYPE_

#define QF_EPOOL_TYPE_   QMPool

This macro defines the type of the event pool used in the QK kernel.

Note
This is a specific implementation for the QK-port of QF. In other QF ports you need to define the macro appropriately for the underlying kernel/OS you're using.

Definition at line 116 of file macros.h.

◆ QK_ON_CONTEXT_SW

#define QK_ON_CONTEXT_SW

This macro enables calling the QK context-switch callback QK_onContextSw()

Definition at line 120 of file macros.h.

◆ QXK_ON_CONTEXT_SW

#define QXK_ON_CONTEXT_SW

This macro enables calling the QXK context-switch callback QXK_onContextSw()

Definition at line 124 of file macros.h.

◆ QF_EPOOL_INIT_

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

Platform-dependent macro defining the event pool initialization

Note
This is an example implementation based on the native QMPool class. In other QF ports, the port might be using a memory pool from the underlying kernel/OS.

Definition at line 133 of file macros.h.

◆ QF_EPOOL_EVENT_SIZE_

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

Platform-dependent macro defining how QF should obtain the event pool block-size

Note
This is a specific implementation for the QK-port of QF. In other QF ports you need to define the macro appropriately for the underlying kernel/OS you're using.

Definition at line 143 of file macros.h.

◆ QF_EPOOL_GET_

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

Platform-dependent macro defining how QF should obtain an event e_ from the event pool p_ with the free margin m_.

Note
This is an example implementation based on the native QMPool class. In other QF ports, the port might be using a memory pool from the underlying kernel/OS.

Definition at line 153 of file macros.h.

◆ QF_EPOOL_PUT_

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

Platform-dependent macro defining how QF should return an event e_ to the event pool p_@note This is an example implementation based on the native QMPool class. In other QF ports, the port might be using a memory pool from the underlying kernel/OS.

Definition at line 164 of file macros.h.