QP/C++  8.0.0
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_)   (static_cast<void>(0))
 
#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.

Backward 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 116 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 119 of file qk.hpp.

◆ QF_SCHED_UNLOCK_

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

Definition at line 128 of file qk.hpp.

◆ QACTIVE_EQUEUE_WAIT_

#define QACTIVE_EQUEUE_WAIT_ ( me_)    (static_cast<void>(0))

Definition at line 135 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
Definition qk.hpp:70
QP::QPSet readySet_dis
Definition qk.hpp:78
void update_(QPSet *const dis) const noexcept
Definition qp.hpp:641
void insert(std::uint_fast8_t const n) noexcept
Definition qp.hpp:606
QK_Attr QK_priv_
Definition qk.cpp:149
std::uint_fast8_t QK_sched_() noexcept
Definition qk.cpp:152

Definition at line 139 of file qk.hpp.

◆ QF_EPOOL_TYPE_

#define QF_EPOOL_TYPE_   QMPool

Definition at line 168 of file qk.hpp.

◆ QF_EPOOL_INIT_

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

Definition at line 171 of file qk.hpp.

◆ QF_EPOOL_EVENT_SIZE_

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

Definition at line 175 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 178 of file qk.hpp.

◆ QF_EPOOL_PUT_

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

Definition at line 182 of file qk.hpp.

Function Documentation

◆ QK_sched_()

std::uint_fast8_t QK_sched_ ( )
noexcept

QK scheduler finds the highest-priority AO ready to run

Details
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 152 of file qk.cpp.

◆ QK_activate_()

void QK_activate_ ( )
noexcept

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

Details
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 197 of file qk.cpp.

Variable Documentation

◆ QK_priv_

QK_Attr QK_priv_
extern

Definition at line 149 of file qk.cpp.