os_probe.txt
来自「针对STM32F103的UCOS移植」· 文本 代码 · 共 439 行 · 第 1/2 页
TXT
439 行
;;;184 #endif
;;;185
;;;186 #if OS_TASK_NAME_SIZE > 20
;;;187 OSTaskNameSet(OS_PROBE_TASK_PRIO, (INT8U *)"uC/Probe OS Plug-In", &err);
;;;188 #else
;;;189 #if OS_TASK_NAME_SIZE > 12
;;;190 OSTaskNameSet(OS_PROBE_TASK_PRIO, (INT8U *)"uC/Probe OS", &err);
0000fe aa06 ADD r2,sp,#0x18
000100 a128 ADR r1,|L1.420|
000102 2008 MOVS r0,#8
000104 f7fffffe BL OSTaskNameSet
;;;191 #endif
;;;192 #endif
;;;193 }
000108 b007 ADD sp,sp,#0x1c
00010a bd00 POP {pc}
;;;194 #endif
ENDP
OSProbe_SetCallback PROC
;;;211 {
;;;212 OSProbe_CallbackFnct = call_back;
00010c 4923 LDR r1,|L1.412|
00010e 6048 STR r0,[r1,#4] ; OSProbe_CallbackFnct
;;;213 }
000110 4770 BX lr
;;;214 #endif
ENDP
OSProbe_SetDelay PROC
;;;231 {
;;;232 OSProbe_Delay = delay;
000112 4922 LDR r1,|L1.412|
000114 8008 STRH r0,[r1,#0] ; OSProbe_Delay
;;;233 }
000116 4770 BX lr
;;;234 #endif
ENDP
OSProbe_Init PROC
;;;109 void OSProbe_Init (void)
;;;110 {
000118 b510 PUSH {r4,lr}
;;;111 #if OS_PROBE_TASK > 0
;;;112 OSProbe_SetDelay(100);
00011a 2064 MOVS r0,#0x64
00011c f7fffffe BL OSProbe_SetDelay
;;;113 OSProbe_SetCallback((void (*)(void))0); /* Force terminal callback function to 'nothing' */
000120 2000 MOVS r0,#0
000122 f7fffffe BL OSProbe_SetCallback
;;;114
;;;115 (void)OSProbe_TaskCPUUsage;
;;;116 (void)OSProbe_TaskStkUsage;
;;;117
;;;118 OSProbe_InitOS();
000126 f7fffffe BL OSProbe_InitOS
;;;119 #endif
;;;120
;;;121 #if OS_PROBE_HOOKS_EN > 0
;;;122 OSProbe_TmrInit();
00012a f7fffffe BL OSProbe_TmrInit
;;;123
;;;124 OSProbe_CyclesCtr = 0;
00012e 491b LDR r1,|L1.412|
000130 2000 MOVS r0,#0
000132 6088 STR r0,[r1,#8] ; OSProbe_CyclesCtr
;;;125 OSProbe_TmrCntsPrev = 0;
000134 8048 STRH r0,[r1,#2] ; OSProbe_TmrCntsPrev
;;;126 #endif
;;;127 }
000136 bd10 POP {r4,pc}
;;;128
ENDP
OSProbe_TimeGetCycles PROC
;;;313 INT32U OSProbe_TimeGetCycles(void)
;;;314 {
000138 b570 PUSH {r4-r6,lr}
;;;315 INT32U cycles;
;;;316 #if OS_PROBE_TMR_32_BITS > 0
;;;317 INT32U cnts32;
;;;318 INT32U cnts32_delta;
;;;319 #else
;;;320 INT16U cnts16;
;;;321 INT16U cnts16_delta;
;;;322 #endif
;;;323 #if OS_CRITICAL_METHOD == 3 /* Allocate storage for CPU status register */
;;;324 OS_CPU_SR cpu_sr = 0;
;;;325 #endif
;;;326
;;;327
;;;328 OS_ENTER_CRITICAL();
00013a f7fffffe BL OS_CPU_SR_Save
00013e 4605 MOV r5,r0
;;;329 #if OS_PROBE_TMR_32_BITS > 0
;;;330 cnts32 = OSProbe_TmrRd(); /* Read current counts of the free running counter */
;;;331 cnts32_delta = cnts32 - OSProbe_TmrCntsPrev;
;;;332 OSProbe_TmrCntsPrev = cnts32; /* Save current counts for next time */
;;;333 OSProbe_CyclesCtr += cnts32_delta;
;;;334 #else
;;;335 cnts16 = (INT16U)OSProbe_TmrRd(); /* Read current counts of the free running counter */
000140 f7fffffe BL OSProbe_TmrRd
;;;336 cnts16_delta = cnts16 - OSProbe_TmrCntsPrev;
000144 4915 LDR r1,|L1.412|
000146 884a LDRH r2,[r1,#2] ; OSProbe_TmrCntsPrev
000148 1a82 SUBS r2,r0,r2
00014a b292 UXTH r2,r2
;;;337 OSProbe_TmrCntsPrev = cnts16; /* Save current counts for next time */
00014c 8048 STRH r0,[r1,#2] ; OSProbe_TmrCntsPrev
;;;338 OSProbe_CyclesCtr += (INT32U)cnts16_delta;
00014e 6888 LDR r0,[r1,#8] ; OSProbe_CyclesCtr
000150 1884 ADDS r4,r0,r2
000152 608c STR r4,[r1,#8] ; OSProbe_CyclesCtr
;;;339 #endif
;;;340 cycles = OSProbe_CyclesCtr;
;;;341 OS_EXIT_CRITICAL();
000154 4628 MOV r0,r5
000156 f7fffffe BL OS_CPU_SR_Restore
;;;342
;;;343 return (cycles);
00015a 4620 MOV r0,r4
;;;344 }
00015c bd70 POP {r4-r6,pc}
;;;345 #endif
ENDP
OSProbe_TaskCreateHook PROC
;;;254 void OSProbe_TaskCreateHook (OS_TCB *ptcb)
;;;255 {
00015e b510 PUSH {r4,lr}
000160 4604 MOV r4,r0
;;;256 ptcb->OSTCBCyclesStart = OSProbe_TimeGetCycles(); /* Get the current start time for this task. */
000162 f7fffffe BL OSProbe_TimeGetCycles
000166 63e0 STR r0,[r4,#0x3c]
;;;257 ptcb->OSTCBCyclesTot = 0; /* Update the task's total execution time */
000168 2000 MOVS r0,#0
00016a 63a0 STR r0,[r4,#0x38]
;;;258 }
00016c bd10 POP {r4,pc}
;;;259 #endif
ENDP
OSProbe_TaskSwHook PROC
;;;271 void OSProbe_TaskSwHook (void)
;;;272 {
00016e b510 PUSH {r4,lr}
;;;273 INT32U cycles;
;;;274
;;;275
;;;276 cycles = OSProbe_TimeGetCycles(); /* This task is done */
000170 f7fffffe BL OSProbe_TimeGetCycles
;;;277 OSTCBCur->OSTCBCyclesTot += cycles - OSTCBCur->OSTCBCyclesStart;
000174 490e LDR r1,|L1.432|
000176 6809 LDR r1,[r1,#0] ; OSTCBCur
000178 6bcb LDR r3,[r1,#0x3c]
00017a 6b8a LDR r2,[r1,#0x38]
00017c 1ac3 SUBS r3,r0,r3
00017e 441a ADD r2,r2,r3
000180 638a STR r2,[r1,#0x38]
;;;278 OSTCBHighRdy->OSTCBCyclesStart = cycles; /* Save absolute #cycles at task activation */
000182 490c LDR r1,|L1.436|
000184 6809 LDR r1,[r1,#0] ; OSTCBHighRdy
000186 63c8 STR r0,[r1,#0x3c]
;;;279 }
000188 bd10 POP {r4,pc}
;;;280 #endif
ENDP
OSProbe_TickHook PROC
;;;295 {
;;;296 (void)OSProbe_TimeGetCycles();
00018a e7fe B OSProbe_TimeGetCycles
;;;297 }
;;;298 #endif
ENDP
|L1.396|
00018c 00000040 DCD ||.bss||+0x40
|L1.400|
000190 00000000 DCD ||.bss||
|L1.404|
000194 00000000 DCD OSTCBTbl
|L1.408|
000198 00000080 DCD ||.bss||+0x80
|L1.412|
00019c 00000000 DCD ||.data||
|L1.416|
0001a0 00000100 DCD ||.bss||+0x100
|L1.420|
0001a4 75432f50726f6265204f5300 DCB "uC/Probe OS",0
|L1.432|
0001b0 00000000 DCD OSTCBCur
|L1.436|
0001b4 00000000 DCD OSTCBHighRdy
AREA ||.data||, DATA, ALIGN=2
OSProbe_Delay
000000 0000 DCB 0x00,0x00
OSProbe_TmrCntsPrev
000002 0000 DCB 0x00,0x00
OSProbe_CallbackFnct
000004 00000000 DCD 0x00000000
OSProbe_CyclesCtr
000008 00000000 DCD 0x00000000
AREA ||.bss||, DATA, NOINIT, ALIGN=2
||cycles_dif@OSProbe_Task_0||
% 64
||cycles_tot_last@OSProbe_Task_1||
% 64
OSProbe_TaskCPUUsage
% 64
OSProbe_TaskStkUsage
% 64
OSProbe_TaskStk
% 1024
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?