QP/C++  7.0.1
Real-Time Embedded Framework
qv.hpp
Go to the documentation of this file.
1//============================================================================
2// QP/C++ Real-Time Embedded Framework (RTEF)
3// Copyright (C) 2005 Quantum Leaps, LLC. All rights reserved.
4//
5// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-QL-commercial
6//
7// This software is dual-licensed under the terms of the open source GNU
8// General Public License version 3 (or any later version), or alternatively,
9// under the terms of one of the closed source Quantum Leaps commercial
10// licenses.
11//
12// The terms of the open source GNU General Public License version 3
13// can be found at: <www.gnu.org/licenses/gpl-3.0>
14//
15// The terms of the closed source Quantum Leaps commercial licenses
16// can be found at: <www.state-machine.com/licensing>
17//
18// Redistributions in source code must retain this top-level comment block.
19// Plagiarizing this software to sidestep the license obligations is illegal.
20//
21// Contact information:
22// <www.state-machine.com>
23// <info@state-machine.com>
24//============================================================================
30
31#ifndef QV_HPP
32#define QV_HPP
33
34#include "qequeue.hpp" // QV kernel uses the native QF event queue
35#include "qmpool.hpp" // QV kernel uses the native QF memory pool
36#include "qpset.hpp" // QV kernel uses the native QF priority set
37
38//============================================================================
39// QF configuration for QK
40
41// QV event-queue used for AOs
42#define QF_EQUEUE_TYPE QEQueue
43
44//============================================================================
45namespace QP {
46
59class QV {
60public:
72 static void onIdle(void);
73};
74
75} // namespace QP
76
77//============================================================================
78extern "C" {
79 extern QP::QPSet QV_readySet_;
80} // extern "C"
81
82//============================================================================
83// interface used only inside QF, but not in applications
84
85#ifdef QP_IMPL
86
87 // QV-specific scheduler locking (not needed in QV)
88 #define QF_SCHED_STAT_
89 #define QF_SCHED_LOCK_(dummy) (static_cast<void>(0))
90 #define QF_SCHED_UNLOCK_() (static_cast<void>(0))
91
92 // QV-specific native event queue operations...
93 #define QACTIVE_EQUEUE_WAIT_(me_) \
94 Q_ASSERT_ID(110, (me_)->m_eQueue.m_frontEvt != nullptr)
95 #define QACTIVE_EQUEUE_SIGNAL_(me_) \
96 (QV_readySet_.insert(static_cast<std::uint_fast8_t>((me_)->m_prio)))
97
98 // QV-specific native QF event pool operations...
99 #define QF_EPOOL_TYPE_ QMPool
100 #define QF_EPOOL_INIT_(p_, poolSto_, poolSize_, evtSize_) \
101 (p_).init((poolSto_), (poolSize_), (evtSize_))
102 #define QF_EPOOL_EVENT_SIZE_(p_) ((p_).m_blockSize)
103 #define QF_EPOOL_GET_(p_, e_, m_, qs_id_) \
104 ((e_) = static_cast<QEvt *>((p_).get((m_), (qs_id_))))
105 #define QF_EPOOL_PUT_(p_, e_, qs_id_) ((p_).put((e_), (qs_id_)))
106
107#endif // QP_IMPL
108
109#endif // QV_HPP
QV non-preemptive (cooperative) run-to-completion kernel.
Definition: qv.hpp:59
static void onIdle(void)
QV idle callback (customized in BSPs for QV)
namespace associated with the QP/C++ framework
Definition: exa_native.dox:1
platform-independent fast "raw" thread-safe event queue interface
platform-independent memory pool QP::QMPool interface.
platform-independent priority sets of 8 or 64 elements.
QP::QPSet QV_readySet_
ready set of AOs
Definition: qv.cpp:59
Priority Set of up to 64 elements.
Definition: qpset.hpp:133