51 #include "qs_dummy.hpp"
56 #error "Source file included in a project NOT based on the QXK kernel"
61Q_DEFINE_THIS_MODULE(
"qxk_mutex")
66#if (QP_VERSION < 730U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
67#error qpcpp version 7.3.0 or higher required
89 m_ao.m_prio =
static_cast<std::uint8_t
>(prioSpec & 0xFFU);
121 if (m_ao.m_eQueue.m_nFree == 0U) {
122 m_ao.m_eQueue.m_nFree = 1U;
130 m_ao.m_osObject = curr;
136 QS_U8_PRE_(
static_cast<std::uint8_t
>(m_ao.m_eQueue.m_head));
137 QS_U8_PRE_(
static_cast<std::uint8_t
>(m_ao.m_eQueue.m_nFree));
140 if (m_ao.m_prio != 0U) {
149 static_cast<std::uint_fast8_t
>(m_ao.m_eQueue.m_head));
151 static_cast<std::uint_fast8_t
>(m_ao.m_prio));
159 curr->
m_prio = m_ao.m_prio;
161 curr->
m_prio_dis =
static_cast<std::uint8_t
>(~curr->m_prio);
166 else if (m_ao.m_osObject == curr) {
173 m_ao.m_eQueue.m_nFree = m_ao.m_eQueue.m_nFree + 1U;
178 QS_U8_PRE_(
static_cast<std::uint8_t
>(m_ao.m_eQueue.m_head));
179 QS_U8_PRE_(
static_cast<std::uint8_t
>(m_ao.m_eQueue.m_nFree));
186 if (m_ao.m_prio != 0U) {
194 std::uint_fast8_t
const p =
195 static_cast<std::uint_fast8_t
>(curr->
m_prio);
209 QS_2U8_PRE_(
static_cast<std::uint8_t
>(m_ao.m_eQueue.m_head),
229 if (m_waitSet.hasElement(p)) {
253 if (curr ==
nullptr) {
284 QS_U8_PRE_(
static_cast<std::uint8_t
>(
m_ao.
m_eQueue.m_head));
285 QS_U8_PRE_(
static_cast<std::uint8_t
>(
m_ao.
m_eQueue.m_nFree));
309 curr->
m_prio_dis =
static_cast<std::uint8_t
>(~curr->m_prio);
324 QS_U8_PRE_(
static_cast<std::uint8_t
>(
m_ao.
m_eQueue.m_head));
325 QS_U8_PRE_(
static_cast<std::uint8_t
>(
m_ao.
m_eQueue.m_nFree));
338 QS_2U8_PRE_(
static_cast<std::uint8_t
>(
m_ao.
m_eQueue.m_head),
347 return curr !=
nullptr;
357 if (curr ==
nullptr) {
362 && (curr !=
nullptr));
377 curr->
m_prio_dis =
static_cast<std::uint8_t
>(~curr->m_prio);
397 QS_2U8_PRE_(
static_cast<std::uint8_t
>(
m_ao.
m_eQueue.m_head),
423 && (thr->
m_prio ==
static_cast<std::uint8_t
>(p))
439 QS_U8_PRE_(
static_cast<std::uint8_t
>(
m_ao.
m_eQueue.m_head));
440 QS_U8_PRE_(
static_cast<std::uint8_t
>(
m_ao.
m_eQueue.m_nFree));
481 QS_U8_PRE_(
static_cast<std::uint8_t
>(
m_ao.
m_eQueue.m_head));
482 QS_U8_PRE_(
static_cast<std::uint8_t
>(
m_ao.
m_eQueue.m_nFree));
Active object class (based on the QHsm implementation strategy)
QACTIVE_EQUEUE_TYPE m_eQueue
static QActive * registry_[QF_MAX_ACTIVE+1U]
void register_() noexcept
QACTIVE_OS_OBJ_TYPE m_osObject
void update_(QPSet *const dis) const noexcept
void remove(std::uint_fast8_t const n) noexcept
std::uint_fast8_t findMax() const noexcept
void insert(std::uint_fast8_t const n) noexcept
bool notEmpty() const noexcept
bool lock(QTimeEvtCtr const nTicks=QXTHREAD_NO_TIMEOUT) noexcept
void init(QPrioSpec const prioSpec) noexcept
eXtended (blocking) thread of the QXK preemptive kernel
bool teDisarm_() noexcept
void teArm_(enum_t const sig, QTimeEvtCtr const nTicks) noexcept
QP::QActive *volatile curr
std::uint_fast8_t volatile actPrio
std::uint_fast8_t volatile lockHolder
std::uint32_t QTimeEvtCtr
@ QS_MTX_BLOCK_ATTEMPT
a mutex blocking was attempted
@ QS_MTX_BLOCK
a mutex blocked a thread
@ QS_MTX_UNLOCK_ATTEMPT
a mutex unlock was attempted
@ QS_MTX_UNLOCK
a mutex was unlocked
@ QS_MTX_LOCK
a mutex was locked
#define Q_STATE_CAST(handler_)
#define QF_CRIT_EXIT_NOP()
Internal (package scope) QP/C++ interface.
#define Q_ACTION_CAST(act_)
#define QXK_ISR_CONTEXT_()
Check if the code executes in the ISR context.
QS/C++ package-scope interface.
QS/C++ port to a 32-bit CPU, generic C++ compiler.
QP Functional Safety (FuSa) Subsystem.
#define Q_ASSERT_INCRIT(id_, expr_)
#define Q_REQUIRE_INCRIT(id_, expr_)
void QXK_activate_() noexcept
#define QXK_PTR_CAST_(type_, ptr_)
std::uint_fast8_t QXK_sched_() noexcept
State object for the QP::QMsm class (QM State Machine).