| OLD | NEW |
| 1 //------------------------------------------------------------------------------ | 1 //------------------------------------------------------------------------------ |
| 2 // <copyright file="a_debug.h" company="Atheros"> | 2 // <copyright file="a_debug.h" company="Atheros"> |
| 3 // Copyright (c) 2004-2008 Atheros Corporation. All rights reserved. | 3 // Copyright (c) 2004-2010 Atheros Corporation. All rights reserved. |
| 4 // | 4 // |
| 5 // This program is free software; you can redistribute it and/or modify | |
| 6 // it under the terms of the GNU General Public License version 2 as | |
| 7 // published by the Free Software Foundation; | |
| 8 // | 5 // |
| 9 // Software distributed under the License is distributed on an "AS | 6 // Permission to use, copy, modify, and/or distribute this software for any |
| 10 // IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or | 7 // purpose with or without fee is hereby granted, provided that the above |
| 11 // implied. See the License for the specific language governing | 8 // copyright notice and this permission notice appear in all copies. |
| 12 // rights and limitations under the License. | 9 // |
| 10 // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| 11 // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 12 // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| 13 // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 14 // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 15 // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 16 // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 13 // | 17 // |
| 14 // | 18 // |
| 15 //------------------------------------------------------------------------------ | 19 //------------------------------------------------------------------------------ |
| 16 //============================================================================== | 20 //============================================================================== |
| 17 // Author(s): ="Atheros" | 21 // Author(s): ="Atheros" |
| 18 //============================================================================== | 22 //============================================================================== |
| 19 #ifndef _A_DEBUG_H_ | 23 #ifndef _A_DEBUG_H_ |
| 20 #define _A_DEBUG_H_ | 24 #define _A_DEBUG_H_ |
| 21 | 25 |
| 22 #ifdef __cplusplus | 26 #ifdef __cplusplus |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 int MaxDescriptions; | 134 int MaxDescriptions; |
| 131 ATH_DEBUG_MASK_DESCRIPTION *pMaskDescriptions; /* pointer to array of descr
iptions */ | 135 ATH_DEBUG_MASK_DESCRIPTION *pMaskDescriptions; /* pointer to array of descr
iptions */ |
| 132 } ATH_DEBUG_MODULE_DBG_INFO; | 136 } ATH_DEBUG_MODULE_DBG_INFO; |
| 133 | 137 |
| 134 #define ATH_DEBUG_DESCRIPTION_COUNT(d) (int)((sizeof((d))) / (sizeof(ATH_DEBUG_
MASK_DESCRIPTION))) | 138 #define ATH_DEBUG_DESCRIPTION_COUNT(d) (int)((sizeof((d))) / (sizeof(ATH_DEBUG_
MASK_DESCRIPTION))) |
| 135 | 139 |
| 136 #define GET_ATH_MODULE_DEBUG_VAR_NAME(s) _XGET_ATH_MODULE_NAME_DEBUG_(s) | 140 #define GET_ATH_MODULE_DEBUG_VAR_NAME(s) _XGET_ATH_MODULE_NAME_DEBUG_(s) |
| 137 #define GET_ATH_MODULE_DEBUG_VAR_MASK(s) _XGET_ATH_MODULE_NAME_DEBUG_(s).Current
Mask | 141 #define GET_ATH_MODULE_DEBUG_VAR_MASK(s) _XGET_ATH_MODULE_NAME_DEBUG_(s).Current
Mask |
| 138 #define _XGET_ATH_MODULE_NAME_DEBUG_(s) debug_ ## s | 142 #define _XGET_ATH_MODULE_NAME_DEBUG_(s) debug_ ## s |
| 139 | 143 |
| 140 #ifdef DEBUG | 144 #ifdef ATH_DEBUG_MODULE |
| 141 | 145 |
| 142 /* for source files that will instantiate the debug variables */ | 146 /* for source files that will instantiate the debug variables */ |
| 143 #define ATH_DEBUG_INSTANTIATE_MODULE_VAR(s,name,moddesc,initmask,count,descripti
ons) \ | 147 #define ATH_DEBUG_INSTANTIATE_MODULE_VAR(s,name,moddesc,initmask,count,descripti
ons) \ |
| 144 ATH_DEBUG_MODULE_DBG_INFO GET_ATH_MODULE_DEBUG_VAR_NAME(s) = \ | 148 ATH_DEBUG_MODULE_DBG_INFO GET_ATH_MODULE_DEBUG_VAR_NAME(s) = \ |
| 145 {NULL,(name),(moddesc),0,(initmask),count,(descriptions)} | 149 {NULL,(name),(moddesc),0,(initmask),count,(descriptions)} |
| 146 | 150 |
| 147 #ifdef ATH_MODULE_NAME | 151 #ifdef ATH_MODULE_NAME |
| 148 extern ATH_DEBUG_MODULE_DBG_INFO GET_ATH_MODULE_DEBUG_VAR_NAME(ATH_MODULE_NAME); | 152 extern ATH_DEBUG_MODULE_DBG_INFO GET_ATH_MODULE_DEBUG_VAR_NAME(ATH_MODULE_NAME); |
| 149 #define AR_DEBUG_LVL_CHECK(lvl) (GET_ATH_MODULE_DEBUG_VAR_MASK(ATH_MODULE_NAME)
& (lvl)) | 153 #define AR_DEBUG_LVL_CHECK(lvl) (GET_ATH_MODULE_DEBUG_VAR_MASK(ATH_MODULE_NAME)
& (lvl)) |
| 150 #endif /* ATH_MODULE_NAME */ | 154 #endif /* ATH_MODULE_NAME */ |
| 151 | 155 |
| 152 #define ATH_DEBUG_SET_DEBUG_MASK(s,lvl) GET_ATH_MODULE_DEBUG_VAR_MASK(s) = (lvl) | 156 #define ATH_DEBUG_SET_DEBUG_MASK(s,lvl) GET_ATH_MODULE_DEBUG_VAR_MASK(s) = (lvl) |
| 153 | 157 |
| 154 #define ATH_DEBUG_DECLARE_EXTERN(s) \ | 158 #define ATH_DEBUG_DECLARE_EXTERN(s) \ |
| 155 extern ATH_DEBUG_MODULE_DBG_INFO GET_ATH_MODULE_DEBUG_VAR_NAME(s) | 159 extern ATH_DEBUG_MODULE_DBG_INFO GET_ATH_MODULE_DEBUG_VAR_NAME(s) |
| 156 | 160 |
| 157 #define AR_DEBUG_PRINTBUF(buffer, length, desc) DebugDumpBytes(buffer,length,des
c) | 161 #define AR_DEBUG_PRINTBUF(buffer, length, desc) DebugDumpBytes(buffer,length,des
c) |
| 158 | 162 |
| 159 | 163 |
| 160 #define AR_DEBUG_ASSERT A_ASSERT | 164 #define AR_DEBUG_ASSERT A_ASSERT |
| 161 | 165 |
| 162 void a_dump_module_debug_info(ATH_DEBUG_MODULE_DBG_INFO *pInfo); | 166 void a_dump_module_debug_info(ATH_DEBUG_MODULE_DBG_INFO *pInfo); |
| 163 void a_register_module_debug_info(ATH_DEBUG_MODULE_DBG_INFO *pInfo); | 167 void a_register_module_debug_info(ATH_DEBUG_MODULE_DBG_INFO *pInfo); |
| 164 #define A_DUMP_MODULE_DEBUG_INFO(s) a_dump_module_debug_info(&(GET_ATH_MODULE_DE
BUG_VAR_NAME(s))) | 168 #define A_DUMP_MODULE_DEBUG_INFO(s) a_dump_module_debug_info(&(GET_ATH_MODULE_DE
BUG_VAR_NAME(s))) |
| 165 #define A_REGISTER_MODULE_DEBUG_INFO(s) a_register_module_debug_info(&(GET_ATH_M
ODULE_DEBUG_VAR_NAME(s))) | 169 #define A_REGISTER_MODULE_DEBUG_INFO(s) a_register_module_debug_info(&(GET_ATH_M
ODULE_DEBUG_VAR_NAME(s))) |
| 166 | 170 |
| 167 #else /* !DEBUG */ | 171 #else /* !ATH_DEBUG_MODULE */ |
| 168 /* NON DEBUG */ | 172 /* NON ATH_DEBUG_MODULE */ |
| 169 #define ATH_DEBUG_INSTANTIATE_MODULE_VAR(s,name,moddesc,initmask,count,descripti
ons) | 173 #define ATH_DEBUG_INSTANTIATE_MODULE_VAR(s,name,moddesc,initmask,count,descripti
ons) |
| 170 #define AR_DEBUG_LVL_CHECK(lvl) 0 | 174 #define AR_DEBUG_LVL_CHECK(lvl) 0 |
| 171 #define AR_DEBUG_PRINTBUF(buffer, length, desc) | 175 #define AR_DEBUG_PRINTBUF(buffer, length, desc) |
| 172 #define AR_DEBUG_ASSERT(test) | 176 #define AR_DEBUG_ASSERT(test) |
| 173 #define ATH_DEBUG_DECLARE_EXTERN(s) | 177 #define ATH_DEBUG_DECLARE_EXTERN(s) |
| 174 #define ATH_DEBUG_SET_DEBUG_MASK(s,lvl) | 178 #define ATH_DEBUG_SET_DEBUG_MASK(s,lvl) |
| 175 #define A_DUMP_MODULE_DEBUG_INFO(s) | 179 #define A_DUMP_MODULE_DEBUG_INFO(s) |
| 176 #define A_REGISTER_MODULE_DEBUG_INFO(s) | 180 #define A_REGISTER_MODULE_DEBUG_INFO(s) |
| 177 | 181 |
| 178 #endif | 182 #endif |
| (...skipping 19 matching lines...) Expand all Loading... |
| 198 #ifdef REXOS | 202 #ifdef REXOS |
| 199 #include "../os/rexos/include/common/debug_rexos.h" | 203 #include "../os/rexos/include/common/debug_rexos.h" |
| 200 #endif | 204 #endif |
| 201 | 205 |
| 202 #if defined ART_WIN | 206 #if defined ART_WIN |
| 203 #include "../os/win_art/include/debug_win.h" | 207 #include "../os/win_art/include/debug_win.h" |
| 204 #endif | 208 #endif |
| 205 | 209 |
| 206 #ifdef WIN_NWF | 210 #ifdef WIN_NWF |
| 207 #include <debug_win.h> | 211 #include <debug_win.h> |
| 208 #endif | 212 #endif |
| 213 |
| 214 #ifdef THREADX |
| 215 #define ATH_DEBUG_MAKE_MODULE_MASK(index) (1 << (ATH_DEBUG_MODULE_MASK_SHIFT +
(index))) |
| 216 #include "../os/threadx/include/common/debug_threadx.h" |
| 217 #endif |
| 209 | 218 |
| 210 | 219 |
| 211 #ifdef __cplusplus | 220 #ifdef __cplusplus |
| 212 } | 221 } |
| 213 #endif /* __cplusplus */ | 222 #endif /* __cplusplus */ |
| 214 | 223 |
| 215 #endif | 224 #endif |
| OLD | NEW |