41 #include "qf_port.hpp"
53 #error "Source file included in a project NOT based on the QXK kernel"
187 void const *
const par)
196 && (stkSto ==
nullptr)
199 m_eQueue.init(qSto, qLen);
200 m_osObject =
nullptr;
307 && (lockPrio > prevPrio));
369 if (next->m_osObject ==
nullptr) {
429 #if (defined QXK_ON_CONTEXT_SW) || (defined Q_SPY)
452 #if (defined QXK_ON_CONTEXT_SW) || (defined Q_SPY)
455 #ifdef QXK_ON_CONTEXT_SW
481 if (a->m_eQueue.isEmpty()) {
503 if (a->m_osObject ==
nullptr) {
528 #if (defined QXK_ON_CONTEXT_SW) || (defined Q_SPY)
546 #ifdef QXK_ON_CONTEXT_SW
565 if (curr ==
nullptr) {
unsigned int uint_fast16_t
fast at-least 16-bit unsigned int
unsigned char uint8_t
exact-width 8-bit unsigned int
unsigned int uint_fast8_t
fast at-least 8-bit unsigned int
QActive active object (based on QP::QHsm implementation)
std::uint8_t m_prio
QF priority (1..QF_MAX_ACTIVE) of this active object.
virtual void start(std::uint_fast8_t const prio, QEvt const **const qSto, std::uint_fast16_t const qLen, void *const stkSto, std::uint_fast16_t const stkSize, void const *const par)
Starts execution of an active object and registers the object with the framework.
QEvt const * get_(void) noexcept
Get an event from the event queue of an active object.
static void onStartup(void)
Startup QF callback.
static void init(void)
QF initialization.
static void onCleanup(void)
Cleanup QF callback.
static int_t run(void)
Transfers control to QF to run the application.
static QTimeEvt timeEvtHead_[QF_MAX_TICK_RATE]
heads of linked lists of time events, one for every clock tick rate
static void gc(QEvt const *const e) noexcept
Recycle a dynamic event.
static void bzero(void *const start, std::uint_fast16_t const len) noexcept
Clear a specified region of memory to zero.
static void add_(QActive *const a) noexcept
Register an active object to be managed by the framework.
static void stop(void)
Function invoked by the application layer to stop the QF application and return control to the OS/Ker...
static QActive * active_[QF_MAX_ACTIVE+1U]
array of registered active objects
virtual void dispatch(QEvt const *const e, std::uint_fast8_t const qs_id)
Dispatches an event to QHsm.
virtual void init(void const *const e, std::uint_fast8_t const qs_id)
executes the top-most initial transition in QP::QHsm
static QSchedStatus schedLock(std::uint_fast8_t const ceiling) noexcept
QXK selective scheduler lock.
static void schedUnlock(QSchedStatus const stat) noexcept
QXK selective scheduler unlock.
static void onIdle(void)
QXK idle callback (customized in BSPs for QXK)
namespace associated with the QP/C++ framework
@ QS_QF_RUN
QF_run() was entered.
@ QS_SCHED_IDLE
scheduler became idle
@ QS_SCHED_LOCK
scheduler was locked
@ QS_SCHED_UNLOCK
scheduler was unlocked
@ QS_SCHED_NEXT
scheduler found next task to execute
@ QS_SCHED_RESUME
scheduler resumed previous task (not idle)
enum_t QF_maxPubSignal_
the maximum published signal
static QXKIdleThread l_idleThread
std::uint_fast8_t QF_maxPool_
static void initial_events(void)
process all events posted during initialization */
std::uint_fast16_t QSchedStatus
The scheduler lock status.
QSubscrList * QF_subscrList_
the subscriber list array
Customizable and memory-efficient assertions for embedded systems.
#define Q_DEFINE_THIS_MODULE(name_)
Define the user-specified module name for assertions in this file.
#define Q_ASSERT_ID(id_, test_)
General purpose assertion with user-specified assertion-id.
#define Q_ENSURE_ID(id_, test_)
Assertion for checking postconditions with user-specified assertion-id.
int int_t
typedef for assertions-ids and line numbers in assertions.
#define Q_REQUIRE_ID(id_, test_)
Assertion for checking preconditions with user-specified assertion-id.
#define QF_CRIT_STAT_
This is an internal macro for defining the critical section status type.
#define QF_CRIT_X_()
This is an internal macro for exiting a critical section.
#define QF_CRIT_E_()
This is an internal macro for entering a critical section.
#define QS_FLUSH()
Flush the QS trace data to the host.
Dummy definitions of the QS macros that avoid code generation from the QS instrumentation.
#define QS_U8_PRE_(data_)
#define QS_BEGIN_NOCRIT_PRE_(rec_, qs_id_)
#define QS_END_NOCRIT_PRE_()
#define QS_2U8_PRE_(data1_, data2_)
Internal (package scope) QS/C++ interface.
QS/C++ port to a 32-bit CPU, generic compiler.
#define QF_MAX_ACTIVE
The maximum number of active objects in the application.
QP::QActive * QXK_current(void) noexcept
return the currently executing active-object/thread
void QXK_activate_(void)
QXK activator activates the next active object. The activated AO preempts.
std::uint_fast8_t QXK_sched_(void) noexcept
QXK scheduler finds the highest-priority thread ready to run.
QXK_Attr QXK_attr_
global attributes of the QXK kernel
std::uint8_t volatile lockPrio
lock prio (0 == no-lock)
std::uint8_t volatile lockHolder
prio of the lock holder
void QXK_onContextSw(QP::QActive *prev, QP::QActive *next)
QXK context switch callback (customized in BSPs for QXK)
#define QXK_ISR_CONTEXT_()
Internal port-specific macro that reports the execution context.
QP::QActive * idleThread
pointer to the idle thread
QP::QActive *volatile next
next thread to execute
std::uint8_t volatile actPrio
prio of the active basic thread
QP::QPSet readySet
ready-set of all threads
QP::QActive *volatile curr
currently executing thread
attributes of the QXK kernel
Internal (package scope) QXK/C++ interface.
#define QXK_CONTEXT_SWITCH_()
trigger context switch (used internally in QXK only)
bool hasElement(std::uint_fast8_t const n) const noexcept
the function evaluates to TRUE if the priority set has the element n.
void rmove(std::uint_fast8_t const n) noexcept
remove element n from the set, n = 1..QF_MAX_ACTIVE
std::uint_fast8_t findMax(void) const noexcept