📄 os_cpu_c.lst
字号:
187 OS_STK *stk;
188
189
190 opt = opt; /* 'opt' is not used, prevent warning */
191 stk = ptos; /* Load stack pointer */
192 *(stk) = (OS_STK)task; /* Entry Point */
\ 00000006 0460 STR R4,[R0, #+0]
193 *(--stk) = (INT32U)0x14141414L; /* R14 (LR) */
\ 00000008 001F SUBS R0,R0,#+4
\ 0000000A 164A LDR R2,??OSTaskStkInit_0 ;; 0x14141414
\ 0000000C 0260 STR R2,[R0, #+0]
194 *(--stk) = (INT32U)0x12121212L; /* R12 */
\ 0000000E 001F SUBS R0,R0,#+4
\ 00000010 154A LDR R2,??OSTaskStkInit_0+0x4 ;; 0x12121212
\ 00000012 0260 STR R2,[R0, #+0]
195 *(--stk) = (INT32U)0x11111111L; /* R11 */
\ 00000014 001F SUBS R0,R0,#+4
\ 00000016 154A LDR R2,??OSTaskStkInit_0+0x8 ;; 0x11111111
\ 00000018 0260 STR R2,[R0, #+0]
196 *(--stk) = (INT32U)0x10101010L; /* R10 */
\ 0000001A 001F SUBS R0,R0,#+4
\ 0000001C 144A LDR R2,??OSTaskStkInit_0+0xC ;; 0x10101010
\ 0000001E 0260 STR R2,[R0, #+0]
197 *(--stk) = (INT32U)0x09090909L; /* R9 */
\ 00000020 001F SUBS R0,R0,#+4
\ 00000022 144A LDR R2,??OSTaskStkInit_0+0x10 ;; 0x9090909
\ 00000024 0260 STR R2,[R0, #+0]
198 *(--stk) = (INT32U)0x08080808L; /* R8 */
\ 00000026 001F SUBS R0,R0,#+4
\ 00000028 134A LDR R2,??OSTaskStkInit_0+0x14 ;; 0x8080808
\ 0000002A 0260 STR R2,[R0, #+0]
199 *(--stk) = (INT32U)0x07070707L; /* R7 */
\ 0000002C 001F SUBS R0,R0,#+4
\ 0000002E 134A LDR R2,??OSTaskStkInit_0+0x18 ;; 0x7070707
\ 00000030 0260 STR R2,[R0, #+0]
200 *(--stk) = (INT32U)0x06060606L; /* R6 */
\ 00000032 001F SUBS R0,R0,#+4
\ 00000034 124A LDR R2,??OSTaskStkInit_0+0x1C ;; 0x6060606
\ 00000036 0260 STR R2,[R0, #+0]
201 *(--stk) = (INT32U)0x05050505L; /* R5 */
\ 00000038 001F SUBS R0,R0,#+4
\ 0000003A 124A LDR R2,??OSTaskStkInit_0+0x20 ;; 0x5050505
\ 0000003C 0260 STR R2,[R0, #+0]
202 *(--stk) = (INT32U)0x04040404L; /* R4 */
\ 0000003E 001F SUBS R0,R0,#+4
\ 00000040 114A LDR R2,??OSTaskStkInit_0+0x24 ;; 0x4040404
\ 00000042 0260 STR R2,[R0, #+0]
203 *(--stk) = (INT32U)0x03030303L; /* R3 */
\ 00000044 001F SUBS R0,R0,#+4
\ 00000046 114A LDR R2,??OSTaskStkInit_0+0x28 ;; 0x3030303
\ 00000048 0260 STR R2,[R0, #+0]
204 *(--stk) = (INT32U)0x02020202L; /* R2 */
\ 0000004A 001F SUBS R0,R0,#+4
\ 0000004C 104A LDR R2,??OSTaskStkInit_0+0x2C ;; 0x2020202
\ 0000004E 0260 STR R2,[R0, #+0]
205 *(--stk) = (INT32U)0x01010101L; /* R1 */
\ 00000050 001F SUBS R0,R0,#+4
\ 00000052 104A LDR R2,??OSTaskStkInit_0+0x30 ;; 0x1010101
\ 00000054 0260 STR R2,[R0, #+0]
206 *(--stk) = (INT32U)p_arg; /* R0 : argument */
\ 00000056 001F SUBS R0,R0,#+4
\ 00000058 0160 STR R1,[R0, #+0]
207 *(--stk) = (INT32U)ARM_SVC_MODE; /* CPSR (Enable both IRQ and FIQ interrupts) */
\ 0000005A 001F SUBS R0,R0,#+4
\ 0000005C 3321 MOVS R1,#+51
\ 0000005E 0160 STR R1,[R0, #+0]
208
209 return (stk);
\ 00000060 10BC POP {R4}
\ 00000062 7047 BX LR ;; return
\ ??OSTaskStkInit_0:
\ 00000064 14141414 DC32 0x14141414
\ 00000068 12121212 DC32 0x12121212
\ 0000006C 11111111 DC32 0x11111111
\ 00000070 10101010 DC32 0x10101010
\ 00000074 09090909 DC32 0x9090909
\ 00000078 08080808 DC32 0x8080808
\ 0000007C 07070707 DC32 0x7070707
\ 00000080 06060606 DC32 0x6060606
\ 00000084 05050505 DC32 0x5050505
\ 00000088 04040404 DC32 0x4040404
\ 0000008C 03030303 DC32 0x3030303
\ 00000090 02020202 DC32 0x2020202
\ 00000094 01010101 DC32 0x1010101
210 }
211
212 /*
213 *********************************************************************************************************
214 * TASK SWITCH HOOK
215 *
216 * Description: This function is called when a task switch is performed. This allows you to perform other
217 * operations during a context switch.
218 *
219 * Arguments : none
220 *
221 * Note(s) : 1) Interrupts are disabled during this call.
222 * 2) It is assumed that the global pointer 'OSTCBHighRdy' points to the TCB of the task that
223 * will be 'switched in' (i.e. the highest priority task) and, 'OSTCBCur' points to the
224 * task being switched out (i.e. the preempted task).
225 *********************************************************************************************************
226 */
227 #if (OS_CPU_HOOKS_EN > 0) && (OS_TASK_SW_HOOK_EN > 0)
\ In segment CODE, align 4, keep-with-next
228 void OSTaskSwHook (void)
229 {
230 #if OS_VIEW_MODULE > 0
231 OSView_TaskSwHook();
232 #endif
233 }
\ OSTaskSwHook:
\ 00000000 7047 BX LR ;; return
234 #endif
235
236 /*
237 *********************************************************************************************************
238 * OS_TCBInit() HOOK
239 *
240 * Description: This function is called by OS_TCBInit() after setting up most of the TCB.
241 *
242 * Arguments : ptcb is a pointer to the TCB of the task being created.
243 *
244 * Note(s) : 1) Interrupts may or may not be ENABLED during this call.
245 *********************************************************************************************************
246 */
247 #if OS_CPU_HOOKS_EN > 0 && OS_VERSION > 203
\ In segment CODE, align 4, keep-with-next
248 void OSTCBInitHook (OS_TCB *ptcb)
249 {
250 (void)ptcb; /* Prevent Compiler warning */
251 }
\ OSTCBInitHook:
\ 00000000 7047 BX LR ;; return
252 #endif
253
254
255 /*
256 *********************************************************************************************************
257 * TICK HOOK
258 *
259 * Description: This function is called every tick.
260 *
261 * Arguments : none
262 *
263 * Note(s) : 1) Interrupts may or may not be ENABLED during this call.
264 *********************************************************************************************************
265 */
266 #if (OS_CPU_HOOKS_EN > 0) && (OS_TIME_TICK_HOOK_EN > 0)
\ In segment CODE, align 4, keep-with-next
267 void OSTimeTickHook (void)
268 {
269 #if OS_VIEW_MODULE > 0
270 OSView_TickHook();
271 #endif
272 }
\ OSTimeTickHook:
\ 00000000 7047 BX LR ;; return
273 #endif
274
275
276 /*
277 *********************************************************************************************************
278 * INTERRUPT DISABLE TIME MEASUREMENT, START
279 *********************************************************************************************************
280 */
281
282 #if OS_CPU_INT_DIS_MEAS_EN > 0
283 void OS_CPU_IntDisMeasInit (void)
284 {
285 OS_CPU_IntDisMeasNestingCtr = 0;
286 OS_CPU_IntDisMeasCntsEnter = 0;
287 OS_CPU_IntDisMeasCntsExit = 0;
288 OS_CPU_IntDisMeasCntsMax = 0;
289 OS_CPU_IntDisMeasCntsDelta = 0;
290 OS_CPU_IntDisMeasCntsOvrhd = 0;
291 OS_CPU_IntDisMeasStart(); /* Measure the overhead of the functions */
292 OS_CPU_IntDisMeasStop();
293 OS_CPU_IntDisMeasCntsOvrhd = OS_CPU_IntDisMeasCntsDelta;
294 }
295
296
297 void OS_CPU_IntDisMeasStart (void)
298 {
299 OS_CPU_IntDisMeasNestingCtr++;
300 if (OS_CPU_IntDisMeasNestingCtr == 1) { /* Only measure at the first nested level */
301 OS_CPU_IntDisMeasCntsEnter = OS_CPU_IntDisMeasTmrRd();
302 }
303 }
304
305
306 void OS_CPU_IntDisMeasStop (void)
307 {
308 OS_CPU_IntDisMeasNestingCtr--; /* Decrement nesting ctr */
309 if (OS_CPU_IntDisMeasNestingCtr == 0) {
310 OS_CPU_IntDisMeasCntsExit = OS_CPU_IntDisMeasTmrRd();
311 OS_CPU_IntDisMeasCntsDelta = OS_CPU_IntDisMeasCntsExit - OS_CPU_IntDisMeasCntsEnter;
312 if (OS_CPU_IntDisMeasCntsDelta > OS_CPU_IntDisMeasCntsOvrhd) { /* Ensure overhead < delta */
313 OS_CPU_IntDisMeasCntsDelta -= OS_CPU_IntDisMeasCntsOvrhd;
314 } else {
315 OS_CPU_IntDisMeasCntsDelta = OS_CPU_IntDisMeasCntsOvrhd;
316 }
317 if (OS_CPU_IntDisMeasCntsDelta > OS_CPU_IntDisMeasCntsMax) { /* Track MAXIMUM */
318 OS_CPU_IntDisMeasCntsMax = OS_CPU_IntDisMeasCntsDelta;
319 }
320 }
321 }
322 #endif
Maximum stack usage in bytes:
Function CSTACK
-------- ------
OSInitHookBegin 0
OSInitHookEnd 0
OSTCBInitHook 0
OSTaskCreateHook 0
OSTaskDelHook 0
OSTaskIdleHook 0
OSTaskStatHook 0
OSTaskStkInit 4
OSTaskSwHook 0
OSTimeTickHook 0
Segment part sizes:
Function/Label Bytes
-------------- -----
OSInitHookBegin 2
OSInitHookEnd 2
OSTaskCreateHook 2
OSTaskDelHook 2
OSTaskIdleHook 2
OSTaskStatHook 2
OSTaskStkInit 152
OSTaskSwHook 2
OSTCBInitHook 2
OSTimeTickHook 2
Others 80
250 bytes in segment CODE
170 bytes of CODE memory (+ 80 bytes shared)
Errors: none
Warnings: none
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -