QP/C++  7.3.4
Real-Time Embedded Framework
Loading...
Searching...
No Matches
qk.hpp File Reference

QK/C++ (preemptive non-blocking kernel) platform-independent public interface. More...

Go to the source code of this file.

Classes

class  QK_Attr
 Private attributes of the QK kernel. More...
 

Namespaces

namespace  QP
 QP/C++ framework.
 
namespace  QP::QK
 preemptive, non-blocking kernel
 

Macros

#define QF_SCHED_STAT_   QSchedStatus lockStat_;
 
#define QF_SCHED_LOCK_(ceil_)
 
#define QF_SCHED_UNLOCK_()
 
#define QACTIVE_EQUEUE_WAIT_(me_)    Q_ASSERT_INCRIT(320, (me_)->m_eQueue.m_frontEvt != nullptr)
 
#define QACTIVE_EQUEUE_SIGNAL_(me_)
 
#define QF_EPOOL_TYPE_   QMPool
 
#define QF_EPOOL_INIT_(p_, poolSto_, poolSize_, evtSize_)    (p_).init((poolSto_), (poolSize_), (evtSize_))
 
#define QF_EPOOL_EVENT_SIZE_(p_)   ((p_).getBlockSize())
 
#define QF_EPOOL_GET_(p_, e_, m_, qsId_)    ((e_) = static_cast<QEvt *>((p_).get((m_), (qsId_))))
 
#define QF_EPOOL_PUT_(p_, e_, qsId_)   ((p_).put((e_), (qsId_)))
 

Typedefs

using QP::QSchedStatus = std::uint_fast8_t
 

Functions

QSchedStatus QP::QK::schedLock (std::uint_fast8_t const ceiling) noexcept
 
void QP::QK::schedUnlock (QSchedStatus const prevCeil) noexcept
 
void QP::QK::onIdle ()
 
std::uint_fast8_t QK_sched_ () noexcept
 
void QK_activate_ () noexcept
 

Variables

QK_Attr QK_priv_
 

Detailed Description

QK/C++ (preemptive non-blocking kernel) platform-independent public interface.

Traceability
  • DVP-QP-MC4-D04_08

Definition in file qk.hpp.

Macro Definition Documentation

◆ QF_SCHED_STAT_

#define QF_SCHED_STAT_   QSchedStatus lockStat_;

Definition at line 124 of file qk.hpp.

◆ QF_SCHED_LOCK_

#define QF_SCHED_LOCK_ ( ceil_)
Value:
do { \
if (QK_ISR_CONTEXT_()) { \
lockStat_ = 0xFFU; \
} else { \
lockStat_ = QK::schedLock((ceil_)); \
} \
} while (false)
#define QK_ISR_CONTEXT_()
Definition qp_port.hpp:111

Definition at line 127 of file qk.hpp.

◆ QF_SCHED_UNLOCK_

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

Definition at line 136 of file qk.hpp.

◆ QACTIVE_EQUEUE_WAIT_

#define QACTIVE_EQUEUE_WAIT_ ( me_)     Q_ASSERT_INCRIT(320, (me_)->m_eQueue.m_frontEvt != nullptr)

Definition at line 143 of file qk.hpp.

◆ QACTIVE_EQUEUE_SIGNAL_

#define QACTIVE_EQUEUE_SIGNAL_ ( me_)
Value:
do { \
static_cast<std::uint_fast8_t>((me_)->m_prio)); \
if (!QK_ISR_CONTEXT_()) { \
if (QK_sched_() != 0U) { \
QK_activate_(); \
} \
} \
} while (false)
QP::QPSet readySet_dis
Definition qk.hpp:86
QP::QPSet readySet
Definition qk.hpp:78
void update_(QPSet *const dis) const noexcept
Definition qp.hpp:681
void insert(std::uint_fast8_t const n) noexcept
Definition qp.hpp:646
QK_Attr QK_priv_
Definition qk.cpp:158
std::uint_fast8_t QK_sched_() noexcept
Definition qk.cpp:161

Definition at line 148 of file qk.hpp.

◆ QF_EPOOL_TYPE_

#define QF_EPOOL_TYPE_   QMPool

Definition at line 177 of file qk.hpp.

◆ QF_EPOOL_INIT_

#define QF_EPOOL_INIT_ ( p_,
poolSto_,
poolSize_,
evtSize_ )    (p_).init((poolSto_), (poolSize_), (evtSize_))

Definition at line 180 of file qk.hpp.

◆ QF_EPOOL_EVENT_SIZE_

#define QF_EPOOL_EVENT_SIZE_ ( p_)    ((p_).getBlockSize())

Definition at line 184 of file qk.hpp.

◆ QF_EPOOL_GET_

#define QF_EPOOL_GET_ ( p_,
e_,
m_,
qsId_ )    ((e_) = static_cast<QEvt *>((p_).get((m_), (qsId_))))

Definition at line 187 of file qk.hpp.

◆ QF_EPOOL_PUT_

#define QF_EPOOL_PUT_ ( p_,
e_,
qsId_ )   ((p_).put((e_), (qsId_)))

Definition at line 191 of file qk.hpp.

Function Documentation

◆ QK_sched_()

QK_sched_ ( )
noexcept

QK scheduler finds the highest-priority AO ready to run

Description
The QK scheduler finds out the priority of the highest-priority AO that (1) has events to process and (2) has priority that is above the current priority.
Returns
The QF-priority of the next active object to activate, or zero if no activation of AO is needed.
Precondition qk:400
  • check the internal integrity (duplicate inverse storage)
Attention
QK_sched_() must be always called with interrupts disabled and returns with interrupts disabled. QK_sched_() is defined with the "C" linkage (extern "C").

Definition at line 161 of file qk.cpp.

◆ QK_activate_()

QK_activate_ ( )
noexcept

QK activator activates the next active object. The activated AO preempts the currently executing AOs.

Description
QK_activate_() activates ready-to run AOs that are above the initial preemption-threshold.
Precondition qk:500
  • QK_attr_.actPrio and QK_attr_.nextPrio must be in range
Attention
QK_activate_() must be always called with interrupts disabled and returns with interrupts disabled. QK_activate_() is defined with the "C" linkage (extern "C")

Definition at line 206 of file qk.cpp.

Variable Documentation

◆ QK_priv_

QK_Attr QK_priv_
extern

Definition at line 158 of file qk.cpp.