|
QP/C
|
00001 /***************************************************************************** 00002 * Product: QF/C 00003 * Last Updated for Version: 4.4.00 00004 * Date of the Last Update: Jan 17, 2012 00005 * 00006 * Q u a n t u m L e a P s 00007 * --------------------------- 00008 * innovating embedded systems 00009 * 00010 * Copyright (C) 2002-2012 Quantum Leaps, LLC. All rights reserved. 00011 * 00012 * This software may be distributed and modified under the terms of the GNU 00013 * General Public License version 2 (GPL) as published by the Free Software 00014 * Foundation and appearing in the file GPL.TXT included in the packaging of 00015 * this file. Please note that GPL Section 2[b] requires that all works based 00016 * on this software must also be made publicly available under the terms of 00017 * the GPL ("Copyleft"). 00018 * 00019 * Alternatively, this software may be distributed and modified under the 00020 * terms of Quantum Leaps commercial licenses, which expressly supersede 00021 * the GPL and are specifically designed for licensees interested in 00022 * retaining the proprietary status of their code. 00023 * 00024 * Contact information: 00025 * Quantum Leaps Web site: http://www.quantum-leaps.com 00026 * e-mail: info@quantum-leaps.com 00027 *****************************************************************************/ 00028 #ifndef qf_pkg_h 00029 #define qf_pkg_h 00030 00037 #include "qf_port.h" /* QF port */ 00038 00039 /* QF-specific critical section */ 00040 #ifndef QF_CRIT_STAT_TYPE 00041 00051 #define QF_CRIT_STAT_ 00052 00062 #define QF_CRIT_ENTRY_() QF_CRIT_ENTRY(dummy) 00063 00073 #define QF_CRIT_EXIT_() QF_CRIT_EXIT(dummy) 00074 00075 #else 00076 #define QF_CRIT_STAT_ QF_CRIT_STAT_TYPE critStat_; 00077 #define QF_CRIT_ENTRY_() QF_CRIT_ENTRY(critStat_) 00078 #define QF_CRIT_EXIT_() QF_CRIT_EXIT(critStat_) 00079 #endif 00080 00081 /* package-scope objects ---------------------------------------------------*/ 00082 extern QTimeEvt *QF_timeEvtListHead_; 00083 extern QF_EPOOL_TYPE_ QF_pool_[QF_MAX_EPOOL]; 00084 extern uint8_t QF_maxPool_; 00085 extern QSubscrList *QF_subscrList_; 00086 extern QSignal QF_maxSignal_; 00088 /*..........................................................................*/ 00091 typedef struct QFreeBlockTag { 00092 struct QFreeBlockTag *next; 00093 } QFreeBlock; 00094 00095 /* internal helper macros --------------------------------------------------*/ 00097 #define QF_EVT_POOL_ID_(e_) ((e_)->poolId_) 00098 00100 #define QF_EVT_REF_CTR_(e_) ((e_)->refCtr_) 00101 00103 #define QF_EVT_REF_CTR_INC_(e_) (++((QEvent *)(e_))->refCtr_) 00104 00106 #define QF_EVT_REF_CTR_DEC_(e_) (--((QEvent *)(e_))->refCtr_) 00107 00109 #define QF_PTR_AT_(base_, i_) (base_[i_]) 00110 00111 #endif /* qf_pkg_h */ 00112 00113 /****************************************************************************/ 00114 #ifdef Q_SPY /* QS software tracing enabled? */ 00115 00116 #include "qs_port.h" /* include QS port */ 00117 00118 #if (QF_EQUEUE_CTR_SIZE == 1) 00119 00124 #define QS_EQC_(ctr_) QS_u8_(ctr_) 00125 #elif (QF_EQUEUE_CTR_SIZE == 2) 00126 #define QS_EQC_(ctr_) QS_u16_(ctr_) 00127 #elif (QF_EQUEUE_CTR_SIZE == 4) 00128 #define QS_EQC_(ctr_) QS_u32_(ctr_) 00129 #else 00130 #error "QF_EQUEUE_CTR_SIZE not defined" 00131 #endif 00132 00133 00134 #if (QF_EVENT_SIZ_SIZE == 1) 00135 00140 #define QS_EVS_(size_) QS_u8_(size_) 00141 #elif (QF_EVENT_SIZ_SIZE == 2) 00142 #define QS_EVS_(size_) QS_u16_(size_) 00143 #elif (QF_EVENT_SIZ_SIZE == 4) 00144 #define QS_EVS_(size_) QS_u32_(size_) 00145 #endif 00146 00147 00148 #if (QF_MPOOL_SIZ_SIZE == 1) 00149 00154 #define QS_MPS_(size_) QS_u8_(size_) 00155 #elif (QF_MPOOL_SIZ_SIZE == 2) 00156 #define QS_MPS_(size_) QS_u16_(size_) 00157 #elif (QF_MPOOL_SIZ_SIZE == 4) 00158 #define QS_MPS_(size_) QS_u32_(size_) 00159 #endif 00160 00161 #if (QF_MPOOL_CTR_SIZE == 1) 00162 00167 #define QS_MPC_(ctr_) QS_u8_(ctr_) 00168 #elif (QF_MPOOL_CTR_SIZE == 2) 00169 #define QS_MPC_(ctr_) QS_u16_(ctr_) 00170 #elif (QF_MPOOL_CTR_SIZE == 4) 00171 #define QS_MPC_(ctr_) QS_u32_(ctr_) 00172 #endif 00173 00174 00175 #if (QF_TIMEEVT_CTR_SIZE == 1) 00176 00181 #define QS_TEC_(ctr_) QS_u8_(ctr_) 00182 #elif (QF_TIMEEVT_CTR_SIZE == 2) 00183 #define QS_TEC_(ctr_) QS_u16_(ctr_) 00184 #elif (QF_TIMEEVT_CTR_SIZE == 4) 00185 #define QS_TEC_(ctr_) QS_u32_(ctr_) 00186 #endif 00187 00188 #else 00189 00190 #include "qs_dummy.h" /* disable the QS software tracing */ 00191 00192 #endif /* Q_SPY */
1.7.6.1