UCOS_TI_LM3S_Keil
首页
相关页面
结构体
文件
文件列表
全局定义
全部
结构体
文件
函数
变量
类型定义
宏定义
页
os_dbg.c
浏览该文件的文档.
1
/*
2
*********************************************************************************************************
3
* uC/OS-II
4
* The Real-Time Kernel
5
* DEBUGGER CONSTANTS
6
*
7
* (c) Copyright 2006, Micrium, Weston, FL
8
* All Rights Reserved
9
*
10
* ARM Cortex-M3 Port
11
*
12
* File : OS_DBG.C
13
* Version : V2.89
14
* By : Jean J. Labrosse
15
*
16
* For : ARMv7M Cortex-M3
17
* Mode : Thumb2
18
* Toolchain : IAR EWARM
19
*********************************************************************************************************
20
*/
21
22
#include <
ucos_ii.h
>
23
24
#define OS_COMPILER_OPT __root
25
26
/*
27
*********************************************************************************************************
28
* DEBUG DATA
29
*********************************************************************************************************
30
*/
31
32
OS_COMPILER_OPT
INT16U
const
OSDebugEn
=
OS_DEBUG_EN
;
/* Debug constants are defined below */
33
34
#if OS_DEBUG_EN > 0u
35
36
OS_COMPILER_OPT
INT32U
const
OSEndiannessTest = 0x12345678L;
/* Variable to test CPU endianness */
37
38
OS_COMPILER_OPT
INT16U
const
OSEventEn =
OS_EVENT_EN
;
39
OS_COMPILER_OPT
INT16U
const
OSEventMax =
OS_MAX_EVENTS
;
/* Number of event control blocks */
40
OS_COMPILER_OPT
INT16U
const
OSEventNameEn =
OS_EVENT_NAME_EN
;
41
#if (OS_EVENT_EN > 0u) && (OS_MAX_EVENTS > 0u)
42
OS_COMPILER_OPT
INT16U
const
OSEventSize =
sizeof
(
OS_EVENT
);
/* Size in Bytes of OS_EVENT */
43
OS_COMPILER_OPT
INT16U
const
OSEventTblSize =
sizeof
(
OSEventTbl
);
/* Size of OSEventTbl[] in bytes */
44
#else
45
OS_COMPILER_OPT
INT16U
const
OSEventSize = 0u;
46
OS_COMPILER_OPT
INT16U
const
OSEventTblSize = 0u;
47
#endif
48
OS_COMPILER_OPT
INT16U
const
OSEventMultiEn =
OS_EVENT_MULTI_EN
;
49
50
51
OS_COMPILER_OPT
INT16U
const
OSFlagEn =
OS_FLAG_EN
;
52
#if (OS_FLAG_EN > 0u) && (OS_MAX_FLAGS > 0u)
53
OS_COMPILER_OPT
INT16U
const
OSFlagGrpSize =
sizeof
(
OS_FLAG_GRP
);
/* Size in Bytes of OS_FLAG_GRP */
54
OS_COMPILER_OPT
INT16U
const
OSFlagNodeSize =
sizeof
(
OS_FLAG_NODE
);
/* Size in Bytes of OS_FLAG_NODE */
55
OS_COMPILER_OPT
INT16U
const
OSFlagWidth =
sizeof
(
OS_FLAGS
);
/* Width (in bytes) of OS_FLAGS */
56
#else
57
OS_COMPILER_OPT
INT16U
const
OSFlagGrpSize = 0u;
58
OS_COMPILER_OPT
INT16U
const
OSFlagNodeSize = 0u;
59
OS_COMPILER_OPT
INT16U
const
OSFlagWidth = 0u;
60
#endif
61
OS_COMPILER_OPT
INT16U
const
OSFlagMax =
OS_MAX_FLAGS
;
62
OS_COMPILER_OPT
INT16U
const
OSFlagNameEn =
OS_FLAG_NAME_EN
;
63
64
OS_COMPILER_OPT
INT16U
const
OSLowestPrio =
OS_LOWEST_PRIO
;
65
66
OS_COMPILER_OPT
INT16U
const
OSMboxEn =
OS_MBOX_EN
;
67
68
OS_COMPILER_OPT
INT16U
const
OSMemEn =
OS_MEM_EN
;
69
OS_COMPILER_OPT
INT16U
const
OSMemMax =
OS_MAX_MEM_PART
;
/* Number of memory partitions */
70
OS_COMPILER_OPT
INT16U
const
OSMemNameEn =
OS_MEM_NAME_EN
;
71
#if (OS_MEM_EN > 0u) && (OS_MAX_MEM_PART > 0u)
72
OS_COMPILER_OPT
INT16U
const
OSMemSize =
sizeof
(
OS_MEM
);
/* Mem. Partition header sine (bytes) */
73
OS_COMPILER_OPT
INT16U
const
OSMemTblSize =
sizeof
(
OSMemTbl
);
74
#else
75
OS_COMPILER_OPT
INT16U
const
OSMemSize = 0u;
76
OS_COMPILER_OPT
INT16U
const
OSMemTblSize = 0u;
77
#endif
78
OS_COMPILER_OPT
INT16U
const
OSMutexEn =
OS_MUTEX_EN
;
79
80
OS_COMPILER_OPT
INT16U
const
OSPtrSize =
sizeof
(
void
*);
/* Size in Bytes of a pointer */
81
82
OS_COMPILER_OPT
INT16U
const
OSQEn =
OS_Q_EN
;
83
OS_COMPILER_OPT
INT16U
const
OSQMax =
OS_MAX_QS
;
/* Number of queues */
84
#if (OS_Q_EN > 0u) && (OS_MAX_QS > 0u)
85
OS_COMPILER_OPT
INT16U
const
OSQSize =
sizeof
(
OS_Q
);
/* Size in bytes of OS_Q structure */
86
#else
87
OS_COMPILER_OPT
INT16U
const
OSQSize = 0u;
88
#endif
89
90
OS_COMPILER_OPT
INT16U
const
OSRdyTblSize =
OS_RDY_TBL_SIZE
;
/* Number of bytes in the ready table */
91
92
OS_COMPILER_OPT
INT16U
const
OSSemEn =
OS_SEM_EN
;
93
94
OS_COMPILER_OPT
INT16U
const
OSStkWidth =
sizeof
(
OS_STK
);
/* Size in Bytes of a stack entry */
95
96
OS_COMPILER_OPT
INT16U
const
OSTaskCreateEn =
OS_TASK_CREATE_EN
;
97
OS_COMPILER_OPT
INT16U
const
OSTaskCreateExtEn =
OS_TASK_CREATE_EXT_EN
;
98
OS_COMPILER_OPT
INT16U
const
OSTaskDelEn =
OS_TASK_DEL_EN
;
99
OS_COMPILER_OPT
INT16U
const
OSTaskIdleStkSize =
OS_TASK_IDLE_STK_SIZE
;
100
OS_COMPILER_OPT
INT16U
const
OSTaskProfileEn =
OS_TASK_PROFILE_EN
;
101
OS_COMPILER_OPT
INT16U
const
OSTaskMax =
OS_MAX_TASKS
+
OS_N_SYS_TASKS
;
/* Total max. number of tasks */
102
OS_COMPILER_OPT
INT16U
const
OSTaskNameEn =
OS_TASK_NAME_EN
;
103
OS_COMPILER_OPT
INT16U
const
OSTaskStatEn =
OS_TASK_STAT_EN
;
104
OS_COMPILER_OPT
INT16U
const
OSTaskStatStkSize =
OS_TASK_STAT_STK_SIZE
;
105
OS_COMPILER_OPT
INT16U
const
OSTaskStatStkChkEn =
OS_TASK_STAT_STK_CHK_EN
;
106
OS_COMPILER_OPT
INT16U
const
OSTaskSwHookEn =
OS_TASK_SW_HOOK_EN
;
107
108
OS_COMPILER_OPT
INT16U
const
OSTCBPrioTblMax =
OS_LOWEST_PRIO
+ 1u;
/* Number of entries in OSTCBPrioTbl[] */
109
OS_COMPILER_OPT
INT16U
const
OSTCBSize =
sizeof
(
OS_TCB
);
/* Size in Bytes of OS_TCB */
110
OS_COMPILER_OPT
INT16U
const
OSTicksPerSec =
OS_TICKS_PER_SEC
;
111
OS_COMPILER_OPT
INT16U
const
OSTimeTickHookEn =
OS_TIME_TICK_HOOK_EN
;
112
OS_COMPILER_OPT
INT16U
const
OSVersionNbr =
OS_VERSION
;
113
114
OS_COMPILER_OPT
INT16U
const
OSTmrEn =
OS_TMR_EN
;
115
OS_COMPILER_OPT
INT16U
const
OSTmrCfgMax =
OS_TMR_CFG_MAX
;
116
OS_COMPILER_OPT
INT16U
const
OSTmrCfgNameEn =
OS_TMR_CFG_NAME_EN
;
117
OS_COMPILER_OPT
INT16U
const
OSTmrCfgWheelSize =
OS_TMR_CFG_WHEEL_SIZE
;
118
OS_COMPILER_OPT
INT16U
const
OSTmrCfgTicksPerSec =
OS_TMR_CFG_TICKS_PER_SEC
;
119
120
#if (OS_TMR_EN > 0u) && (OS_TMR_CFG_MAX > 0u)
121
OS_COMPILER_OPT
INT16U
const
OSTmrSize =
sizeof
(
OS_TMR
);
122
OS_COMPILER_OPT
INT16U
const
OSTmrTblSize =
sizeof
(
OSTmrTbl
);
123
OS_COMPILER_OPT
INT16U
const
OSTmrWheelSize =
sizeof
(
OS_TMR_WHEEL
);
124
OS_COMPILER_OPT
INT16U
const
OSTmrWheelTblSize =
sizeof
(
OSTmrWheelTbl
);
125
#else
126
OS_COMPILER_OPT
INT16U
const
OSTmrSize = 0u;
127
OS_COMPILER_OPT
INT16U
const
OSTmrTblSize = 0u;
128
OS_COMPILER_OPT
INT16U
const
OSTmrWheelSize = 0u;
129
OS_COMPILER_OPT
INT16U
const
OSTmrWheelTblSize = 0u;
130
#endif
131
132
#endif
133
134
/*$PAGE*/
135
/*
136
*********************************************************************************************************
137
* DEBUG DATA
138
* TOTAL DATA SPACE (i.e. RAM) USED BY uC/OS-II
139
*********************************************************************************************************
140
*/
141
#if OS_DEBUG_EN > 0u
142
143
OS_COMPILER_OPT
INT16U
const
OSDataSize =
sizeof
(
OSCtxSwCtr
)
144
#
if
(
OS_EVENT_EN
> 0u) && (
OS_MAX_EVENTS
> 0u)
145
+
sizeof
(
OSEventFreeList
)
146
+
sizeof
(
OSEventTbl
)
147
#endif
148
#
if
(
OS_FLAG_EN
> 0u) && (
OS_MAX_FLAGS
> 0u)
149
+
sizeof
(
OSFlagTbl
)
150
+
sizeof
(
OSFlagFreeList
)
151
#endif
152
#
if
OS_TASK_STAT_EN
> 0u
153
+
sizeof
(
OSCPUUsage
)
154
+
sizeof
(
OSIdleCtrMax
)
155
+
sizeof
(
OSIdleCtrRun
)
156
+
sizeof
(
OSStatRdy
)
157
+
sizeof
(
OSTaskStatStk
)
158
#endif
159
#if OS_TICK_STEP_EN > 0u
160
+
sizeof
(OSTickStepState)
161
#endif
162
#
if
(
OS_MEM_EN
> 0u) && (
OS_MAX_MEM_PART
> 0u)
163
+
sizeof
(
OSMemFreeList
)
164
+
sizeof
(
OSMemTbl
)
165
#endif
166
#
if
(
OS_Q_EN
> 0u) && (
OS_MAX_QS
> 0u)
167
+
sizeof
(
OSQFreeList
)
168
+
sizeof
(
OSQTbl
)
169
#endif
170
#
if
OS_TIME_GET_SET_EN
> 0u
171
+
sizeof
(
OSTime
)
172
#endif
173
#if (OS_TMR_EN > 0u) && (OS_TMR_CFG_MAX > 0u)
174
+
sizeof
(
OSTmrFree
)
175
+
sizeof
(
OSTmrUsed
)
176
+
sizeof
(
OSTmrTime
)
177
+
sizeof
(
OSTmrSem
)
178
+
sizeof
(
OSTmrSemSignal
)
179
+
sizeof
(
OSTmrFreeList
)
180
+
sizeof
(
OSTmrTbl
)
181
+
sizeof
(
OSTmrWheelTbl
)
182
#endif
183
+
sizeof
(
OSIntNesting
)
184
+
sizeof
(
OSLockNesting
)
185
+
sizeof
(
OSPrioCur
)
186
+
sizeof
(
OSPrioHighRdy
)
187
+
sizeof
(
OSRdyGrp
)
188
+
sizeof
(
OSRdyTbl
)
189
+
sizeof
(
OSRunning
)
190
+
sizeof
(
OSTaskCtr
)
191
+
sizeof
(
OSIdleCtr
)
192
+
sizeof
(
OSTaskIdleStk
)
193
+
sizeof
(
OSTCBCur
)
194
+
sizeof
(
OSTCBFreeList
)
195
+
sizeof
(
OSTCBHighRdy
)
196
+
sizeof
(
OSTCBList
)
197
+
sizeof
(
OSTCBPrioTbl
)
198
+
sizeof
(
OSTCBTbl
);
199
200
#endif
201
202
/*$PAGE*/
203
/*
204
*********************************************************************************************************
205
* OS DEBUG INITIALIZAZTION
206
*
207
* Description: This function is used to make sure that debug variables that are unused in the application
208
* are not optimized away. This function might not be necessary for all compilers. In this
209
* case, you should simply DELETE the code in this function while still leaving the declaration
210
* of the function itself.
211
*
212
* Arguments : none
213
*
214
* Returns : none
215
*
216
* Note(s) : (1) This code doesn't do anything, it simply prevents the compiler from optimizing out
217
* the 'const' variables which are declared in this file.
218
*********************************************************************************************************
219
*/
220
221
#if OS_DEBUG_EN > 0u
222
void
OSDebugInit (
void
)
223
{
224
void
*ptemp;
225
226
227
ptemp = (
void
*)&
OSDebugEn
;
228
229
ptemp = (
void
*)&OSEndiannessTest;
230
231
ptemp = (
void
*)&OSEventMax;
232
ptemp = (
void
*)&OSEventNameEn;
233
ptemp = (
void
*)&OSEventEn;
234
ptemp = (
void
*)&OSEventSize;
235
ptemp = (
void
*)&OSEventTblSize;
236
ptemp = (
void
*)&OSEventMultiEn;
237
238
ptemp = (
void
*)&OSFlagEn;
239
ptemp = (
void
*)&OSFlagGrpSize;
240
ptemp = (
void
*)&OSFlagNodeSize;
241
ptemp = (
void
*)&OSFlagWidth;
242
ptemp = (
void
*)&OSFlagMax;
243
ptemp = (
void
*)&OSFlagNameEn;
244
245
ptemp = (
void
*)&OSLowestPrio;
246
247
ptemp = (
void
*)&OSMboxEn;
248
249
ptemp = (
void
*)&OSMemEn;
250
ptemp = (
void
*)&OSMemMax;
251
ptemp = (
void
*)&OSMemNameEn;
252
ptemp = (
void
*)&OSMemSize;
253
ptemp = (
void
*)&OSMemTblSize;
254
255
ptemp = (
void
*)&OSMutexEn;
256
257
ptemp = (
void
*)&OSPtrSize;
258
259
ptemp = (
void
*)&OSQEn;
260
ptemp = (
void
*)&OSQMax;
261
ptemp = (
void
*)&OSQSize;
262
263
ptemp = (
void
*)&OSRdyTblSize;
264
265
ptemp = (
void
*)&OSSemEn;
266
267
ptemp = (
void
*)&OSStkWidth;
268
269
ptemp = (
void
*)&OSTaskCreateEn;
270
ptemp = (
void
*)&OSTaskCreateExtEn;
271
ptemp = (
void
*)&OSTaskDelEn;
272
ptemp = (
void
*)&OSTaskIdleStkSize;
273
ptemp = (
void
*)&OSTaskProfileEn;
274
ptemp = (
void
*)&OSTaskMax;
275
ptemp = (
void
*)&OSTaskNameEn;
276
ptemp = (
void
*)&OSTaskStatEn;
277
ptemp = (
void
*)&OSTaskStatStkSize;
278
ptemp = (
void
*)&OSTaskStatStkChkEn;
279
ptemp = (
void
*)&OSTaskSwHookEn;
280
281
ptemp = (
void
*)&OSTCBPrioTblMax;
282
ptemp = (
void
*)&OSTCBSize;
283
284
ptemp = (
void
*)&OSTicksPerSec;
285
ptemp = (
void
*)&OSTimeTickHookEn;
286
287
#if OS_TMR_EN > 0u
288
ptemp = (
void
*)&
OSTmrTbl
[0];
289
ptemp = (
void
*)&
OSTmrWheelTbl
[0];
290
291
ptemp = (
void
*)&OSTmrEn;
292
ptemp = (
void
*)&OSTmrCfgMax;
293
ptemp = (
void
*)&OSTmrCfgNameEn;
294
ptemp = (
void
*)&OSTmrCfgWheelSize;
295
ptemp = (
void
*)&OSTmrCfgTicksPerSec;
296
ptemp = (
void
*)&OSTmrSize;
297
ptemp = (
void
*)&OSTmrTblSize;
298
299
ptemp = (
void
*)&OSTmrWheelSize;
300
ptemp = (
void
*)&OSTmrWheelTblSize;
301
#endif
302
303
ptemp = (
void
*)&OSVersionNbr;
304
305
ptemp = (
void
*)&OSDataSize;
306
307
ptemp = ptemp;
/* Prevent compiler warning for 'ptemp' not being used! */
308
}
309
#endif
UCOS_TI_LM3S_Keil
uCOS-II
Ports
os_dbg.c
生成于 2013年 十月 1日 星期二 12:18:39 , 为 UCOS_TI_LM3S_Keil使用
1.8.4