QP/C++  7.4.0-rc.1
Real-Time Embedded Framework
No Matches
qxk.cpp File Reference
#include "qp_port.hpp"
#include "qp_pkg.hpp"
#include "qsafe.h"
#include "qs_port.hpp"
#include "qs_pkg.hpp"

Go to the source code of this file.


namespace  QP
 QP/C++ framework.
namespace  QP::QXK
 preemptive, dual-mode (non-blocking / blocking) kernel
namespace  QP::QF
 QF Active Object Framework.


QSchedStatus QP::QXK::schedLock (std::uint_fast8_t const ceiling) noexcept
void QP::QXK::schedUnlock (QSchedStatus const stat) noexcept
QP::QActiveQP::QXK::current () noexcept
std::uint_fast8_t QXK_sched_ () noexcept
void QXK_activate_ () noexcept
void QXK_contextSw_ (QP::QActive *const next)
void QXK_threadExit_ ()
void QP::QF::init ()
void QP::QF::stop ()
int_t QP::QF::run ()


QXK_Attr QXK_priv_

Function Documentation

◆ QXK_sched_()

std::uint_fast8_t QXK_sched_ ( )

QXK scheduler finds the highest-priority thread ready to run

The QXK scheduler finds the priority of the highest-priority thread that is ready to run.
the 1-based priority of the the thread (basic or extended) run next, or zero if no eligible thread is found.
Precondition qxk:402
  • check the integrity of readySet_dis (duplicate inverse storage)
QXK_sched_() must be always called with interrupts disabled and returns with interrupts disabled. QXK_sched_() is defined with the "C" linkage (extern "C").

Definition at line 177 of file qxk.cpp.

◆ QXK_activate_()

void QXK_activate_ ( )

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

QXK_activate_() activates ready-to run AOs that are above the initial active priority (QXK_priv_.actPrio).
Precondition qxk:500
  • QXK_priv_.next must be valid and the prio must be in range
QXK_activate_() must be always called with interrupts disabled and returns with interrupts disabled. QXK_activate_() is defined with the "C" linkage (extern "C").

Definition at line 236 of file qxk.cpp.

◆ QXK_contextSw_()

void QXK_contextSw_ ( QP::QActive *const next)

Definition at line 339 of file qxk.cpp.

◆ QXK_threadExit_()

void QXK_threadExit_ ( )

Called when QP::QXThread exits

Called when the extended-thread handler function returns.
Precondition qxk:900
  • must NOT be called from an ISR;
  • must be called from an extended thread
Precondition qxk:901
  • the thread must NOT be holding a scheduler lock
Most thread handler functions are structured as endless loops that never return. But it is also possible to structure threads as one-shot functions that perform their job and return. In that case this function performs cleanup after the thread.

Definition at line 367 of file qxk.cpp.

Variable Documentation

◆ QXK_priv_

QXK_Attr QXK_priv_

Definition at line 174 of file qxk.cpp.