mirror of
https://github.com/QuantumLeaps/qpc.git
synced 2025-02-04 07:13:16 +08:00
4cd3b4029c
Conflicts: ports/lint/lint_qf.txt ports/posix/gnu/Makefile qf/source/qf_pkg.h qf/source/qmp_get.c qf/source/qmp_put.c
94 lines
3.5 KiB
C
94 lines
3.5 KiB
C
/**
|
|
* \file
|
|
* \brief Internal (package scope) QK/C interface.
|
|
* \ingroup qk
|
|
* \cond
|
|
******************************************************************************
|
|
* Product: QK/C
|
|
* Last updated for version 5.3.0
|
|
* Last updated on 2014-02-24
|
|
*
|
|
* Q u a n t u m L e a P s
|
|
* ---------------------------
|
|
* innovating embedded systems
|
|
*
|
|
* Copyright (C) Quantum Leaps, www.state-machine.com.
|
|
*
|
|
* This program is open source software: you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License as published
|
|
* by the Free Software Foundation, either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* Alternatively, this program may be distributed and modified under the
|
|
* terms of Quantum Leaps commercial licenses, which expressly supersede
|
|
* the GNU General Public License and are specifically designed for
|
|
* licensees interested in retaining the proprietary status of their code.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*
|
|
* Contact information:
|
|
* Web: www.state-machine.com
|
|
* Email: info@state-machine.com
|
|
******************************************************************************
|
|
* \endcond
|
|
*/
|
|
#ifndef qk_pkg_h
|
|
#define qk_pkg_h
|
|
|
|
/* QF-specific critical section */
|
|
#ifndef QF_CRIT_STAT_TYPE
|
|
/*! This is an internal macro for defining the critical section
|
|
* status type. */
|
|
/**
|
|
* The purpose of this macro is to enable writing the same code for the
|
|
* case when critical section status type is defined and when it is not.
|
|
* If the macro #QF_CRIT_STAT_TYPE is defined, this internal macro
|
|
* provides the definition of the critical section status variable.
|
|
* Otherwise this macro is empty.
|
|
* \sa #QF_CRIT_STAT_TYPE
|
|
*/
|
|
#define QF_CRIT_STAT_
|
|
|
|
/*! This is an internal macro for entering a critical section. */
|
|
/**
|
|
* The purpose of this macro is to enable writing the same code for the
|
|
* case when critical section status type is defined and when it is not.
|
|
* If the macro #QF_CRIT_STAT_TYPE is defined, this internal macro
|
|
* invokes #QF_CRIT_ENTRY passing the key variable as the parameter.
|
|
* Otherwise #QF_CRIT_ENTRY is invoked with a dummy parameter.
|
|
* \sa #QF_CRIT_ENTRY
|
|
*/
|
|
#define QF_CRIT_ENTRY_() QF_CRIT_ENTRY(dummy)
|
|
|
|
/*! This is an internal macro for exiting a critical section. */
|
|
/**
|
|
* The purpose of this macro is to enable writing the same code for the
|
|
* case when critical section status type is defined and when it is not.
|
|
* If the macro #QF_CRIT_STAT_TYPE is defined, this internal macro
|
|
* invokes #QF_CRIT_EXIT passing the key variable as the parameter.
|
|
* Otherwise #QF_CRIT_EXIT is invoked with a dummy parameter.
|
|
* \sa #QF_CRIT_EXIT
|
|
*/
|
|
#define QF_CRIT_EXIT_() QF_CRIT_EXIT(dummy)
|
|
|
|
#else
|
|
#define QF_CRIT_STAT_ QF_CRIT_STAT_TYPE critStat_;
|
|
#define QF_CRIT_ENTRY_() QF_CRIT_ENTRY(critStat_)
|
|
#define QF_CRIT_EXIT_() QF_CRIT_EXIT(critStat_)
|
|
#endif
|
|
|
|
/* package-scope objects... */
|
|
#ifndef QK_NO_MUTEX
|
|
/*! QK mutex prio.ceiling */
|
|
extern uint_fast8_t volatile QK_ceilingPrio_;
|
|
#endif
|
|
|
|
#endif /* qk_pkg_h */
|
|
|