📄 os_view.txt
字号:
000784 0a000001 BEQ |L1.1936|
;;;603 stat = ptcb->OSTCBStat;
000788 e5d1002c LDRB r0,[r1,#0x2c]
00078c ea000005 B |L1.1960|
|L1.1936|
;;;604 } else {
;;;605 if (ptcb->OSTCBDly > 0) { /* Task status */
000790 e1d122ba LDRH r2,[r1,#0x2a]
000794 e3520000 CMP r2,#0
000798 da000001 BLE |L1.1956|
;;;606 stat = 0xF0;
00079c e3a000f0 MOV r0,#0xf0
0007a0 ea000000 B |L1.1960|
|L1.1956|
;;;607 } else {
;;;608 stat = ptcb->OSTCBStat;
0007a4 e5d1002c LDRB r0,[r1,#0x2c]
|L1.1960|
;;;609 }
;;;610 }
;;;611 return (stat);
;;;612 }
0007a8 e12fff1e BX lr
ENDP
OSView_TimeGetCycles PROC
;;;329 INT32U OSView_TimeGetCycles (void)
;;;330 {
0007ac e92d41f0 PUSH {r4-r8,lr}
;;;331 INT32U cycles;
;;;332 #if OS_VIEW_TMR_32_BITS > 0
;;;333 INT32U cnts32;
;;;334 INT32U cnts32_delta;
;;;335 #else
;;;336 INT16U cnts16;
;;;337 INT16U cnts16_delta;
;;;338 #endif
;;;339 #if OS_CRITICAL_METHOD == 3 /* Allocate storage for CPU status register */
;;;340 OS_CPU_SR cpu_sr = 0;
0007b0 e3a07000 MOV r7,#0
;;;341 #endif
;;;342
;;;343
;;;344
;;;345 OS_ENTER_CRITICAL();
0007b4 ebfffffe BL OS_CPU_SR_Save
0007b8 e1a07000 MOV r7,r0
;;;346 #if OS_VIEW_TMR_32_BITS > 0
;;;347 cnts32 = OSView_TmrRd(); /* Read current counts of the free running counter */
0007bc ebfffffe BL OSView_TmrRd
0007c0 e1a05000 MOV r5,r0
;;;348 cnts32_delta = cnts32 - OSView_TmrCntsPrev;
0007c4 e59f0170 LDR r0,|L1.2364|
0007c8 e5900000 LDR r0,[r0,#0] ; OSView_TmrCntsPrev
0007cc e0456000 SUB r6,r5,r0
;;;349 OSView_TmrCntsPrev = cnts32; /* Save current counts for next time */
0007d0 e59f0164 LDR r0,|L1.2364|
0007d4 e5805000 STR r5,[r0,#0] ; OSView_TmrCntsPrev
;;;350 OSView_CyclesCtr += cnts32_delta;
0007d8 e59f0160 LDR r0,|L1.2368|
0007dc e5900000 LDR r0,[r0,#0] ; OSView_CyclesCtr
0007e0 e0800006 ADD r0,r0,r6
0007e4 e59f1154 LDR r1,|L1.2368|
0007e8 e5810000 STR r0,[r1,#0] ; OSView_CyclesCtr
;;;351 #else
;;;352 cnts16 = (INT16U)OSView_TmrRd(); /* Read current counts of the free running counter */
;;;353 cnts16_delta = cnts16 - OSView_TmrCntsPrev;
;;;354 OSView_TmrCntsPrev = cnts16; /* Save current counts for next time */
;;;355 OSView_CyclesCtr += (INT32U)cnts16_delta;
;;;356 #endif
;;;357 cycles = OSView_CyclesCtr;
0007ec e2810000 ADD r0,r1,#0
0007f0 e5904000 LDR r4,[r0,#0] ; OSView_CyclesCtr
;;;358 OS_EXIT_CRITICAL();
0007f4 e1a00007 MOV r0,r7
0007f8 ebfffffe BL OS_CPU_SR_Restore
;;;359 return (cycles);
0007fc e1a00004 MOV r0,r4
000800 e8bd41f0 POP {r4-r8,lr}
;;;360 }
000804 e12fff1e BX lr
ENDP
OSView_CmdGetTaskInfo PROC
;;;533 static void OSView_CmdGetTaskInfo (void)
;;;534 {
000808 e92d41f0 PUSH {r4-r8,lr}
;;;535 OS_TCB *ptcb;
;;;536 INT32U cycles;
;;;537 INT8U stat;
;;;538
;;;539
;;;540 ptcb = (OS_TCB *)OSView_RxGetINT32U(); /* Get the desired task's TCB address */
00080c ebfffffe BL OSView_RxGetINT32U
000810 e1a04000 MOV r4,r0
;;;541 cycles = OSView_TimeGetCycles(); /* Get timestamp */
000814 ebfffffe BL OSView_TimeGetCycles
000818 e1a05000 MOV r5,r0
;;;542 OSView_TxStoINT32U(cycles);
00081c e1a00005 MOV r0,r5
000820 ebfffffe BL OSView_TxStoINT32U
;;;543 if (ptcb != (OS_TCB *)0 && ptcb != (OS_TCB *)1) { /* Make sure we have a valid TCB pointer */
000824 e3540000 CMP r4,#0
000828 0a000027 BEQ |L1.2252|
00082c e3540001 CMP r4,#1
000830 0a000025 BEQ |L1.2252|
;;;544 if (ptcb == OSTCBCur) {
000834 e59f0108 LDR r0,|L1.2372|
000838 e5900000 LDR r0,[r0,#0] ; OSTCBCur
00083c e1540000 CMP r4,r0
000840 1a000005 BNE |L1.2140|
;;;545 ptcb->OSTCBCyclesTot += cycles - ptcb->OSTCBCyclesStart;
000844 e2841038 ADD r1,r4,#0x38
000848 e8910003 LDM r1,{r0,r1}
00084c e0451001 SUB r1,r5,r1
000850 e0800001 ADD r0,r0,r1
000854 e5840038 STR r0,[r4,#0x38]
;;;546 ptcb->OSTCBCyclesStart = cycles;
000858 e584503c STR r5,[r4,#0x3c]
|L1.2140|
;;;547 }
;;;548 OSView_TxStoStr(ptcb->OSTCBTaskName, OS_TASK_NAME_SIZE - 1); /* Task name */
00085c e3a0100f MOV r1,#0xf
000860 e2840048 ADD r0,r4,#0x48
000864 ebfffffe BL OSView_TxStoStr
;;;549 OSView_TxStoINT8U(ptcb->OSTCBPrio); /* Prio */
000868 e5d4002e LDRB r0,[r4,#0x2e]
00086c ebfffffe BL OSView_TxStoINT8U
;;;550 stat = OSView_CmdGetTaskInfo_TCBStat(ptcb); /* Task status */
000870 e1a00004 MOV r0,r4
000874 ebfffffe BL OSView_CmdGetTaskInfo_TCBStat
000878 e1a06000 MOV r6,r0
;;;551 OSView_TxStoINT8U(stat);
00087c e1a00006 MOV r0,r6
000880 ebfffffe BL OSView_TxStoINT8U
;;;552 OSView_TxStoINT32U((INT32U)ptcb->OSTCBEventPtr); /* Pointer to event task is waiting for. */
000884 e594001c LDR r0,[r4,#0x1c]
000888 ebfffffe BL OSView_TxStoINT32U
;;;553 OSView_TxStoINT32U((INT32U)ptcb->OSTCBDly); /* Timeout (i.e. ticks of delayed task) */
00088c e1d402ba LDRH r0,[r4,#0x2a]
000890 ebfffffe BL OSView_TxStoINT32U
;;;554 OSView_TxStoINT32U(ptcb->OSTCBCyclesTot); /* ExecTime */
000894 e5940038 LDR r0,[r4,#0x38]
000898 ebfffffe BL OSView_TxStoINT32U
;;;555 OSView_TxStoINT32U(ptcb->OSTCBCtxSwCtr); /* NumActivations */
00089c e5940034 LDR r0,[r4,#0x34]
0008a0 ebfffffe BL OSView_TxStoINT32U
;;;556
;;;557 OSView_TxStoINT32U((INT32U)ptcb->OSTCBStkBase); /* Stack base address */
0008a4 e5940040 LDR r0,[r4,#0x40]
0008a8 ebfffffe BL OSView_TxStoINT32U
;;;558 OSView_TxStoINT32U(ptcb->OSTCBStkSize * sizeof(OS_STK)); /* Stack size (in #bytes) */
0008ac e594100c LDR r1,[r4,#0xc]
0008b0 e1a00101 LSL r0,r1,#2
0008b4 ebfffffe BL OSView_TxStoINT32U
;;;559 OSView_TxStoINT32U(ptcb->OSTCBStkUsed); /* Number of bytes used */
0008b8 e5940044 LDR r0,[r4,#0x44]
0008bc ebfffffe BL OSView_TxStoINT32U
;;;560 OSView_TxStoINT32U((INT32U)ptcb->OSTCBStkPtr); /* Current stack pointer address */
0008c0 e5940000 LDR r0,[r4,#0]
0008c4 ebfffffe BL OSView_TxStoINT32U
0008c8 ea000000 B |L1.2256|
|L1.2252|
;;;561 } else {
;;;562 OSView_CmdGetTaskInfo_InvalidTask();
0008cc ebfffffe BL OSView_CmdGetTaskInfo_InvalidTask
|L1.2256|
;;;563 }
;;;564 OSView_TxStoINT16U((INT16U)OSTimeGet());
0008d0 ebfffffe BL OSTimeGet
0008d4 e1a07800 LSL r7,r0,#16
0008d8 e1a07827 LSR r7,r7,#16
0008dc e1a00007 MOV r0,r7
0008e0 ebfffffe BL OSView_TxStoINT16U
;;;565 }
0008e4 e8bd41f0 POP {r4-r8,lr}
0008e8 e12fff1e BX lr
|L1.2284|
0008ec 00000000 DCD OSView_TxState
|L1.2288|
0008f0 00000000 DCD OSView_TxLen
|L1.2292|
0008f4 00000000 DCD OSView_TxStrLen
|L1.2296|
0008f8 00000000 DCD OSView_TxCtr
|L1.2300|
0008fc 00000000 DCD OSView_TxActiveFlag
|L1.2304|
000900 00000000 DCD OSView_TxIx
|L1.2308|
000904 00000000 DCD OSView_TxChkSum
|L1.2312|
000908 00000000 DCD OSView_TxBuf
|L1.2316|
00090c 00000000 DCD OSView_TxStrBuf
|L1.2320|
000910 00000000 DCD OSView_TxBufCnt
|L1.2324|
000914 00000000 DCD OSView_TxPktCtr
|L1.2328|
000918 00000000 DCD OSView_RxRdIx
|L1.2332|
00091c 00000000 DCD OSView_RxBuf
|L1.2336|
000920 0000ffff DCD 0x0000ffff
|L1.2340|
000924 00000000 DCD OSTickStepState
|L1.2344|
000928 00000000 DCD OSTCBPrioTbl
|L1.2348|
00092c 494e5641 DCB "INVA"
000930 4c494420 DCB "LID "
000934 5441534b DCB "TASK"
000938 21000000 DCB "!\0\0\0"
|L1.2364|
00093c 00000000 DCD OSView_TmrCntsPrev
|L1.2368|
000940 00000000 DCD OSView_CyclesCtr
|L1.2372|
000944 00000000 DCD OSTCBCur
ENDP
OSView_TxStoPtr PROC
;;;1132 static void OSView_TxStoPtr (void *ptr)
;;;1133 {
000948 e92d4030 PUSH {r4,r5,lr}
00094c e1a04000 MOV r4,r0
;;;1134 INT32U tx_data;
;;;1135
;;;1136
;;;1137 tx_data = (INT32U)ptr;
000950 e1a05004 MOV r5,r4
;;;1138 OSView_TxStoINT16U(tx_data >> 16);
000954 e1a04005 MOV r4,r5
000958 e51f1040 LDR r1,|L1.2336|
00095c e0010825 AND r0,r1,r5,LSR #16
000960 ebfffffe BL OSView_TxStoINT16U
;;;1139 OSView_TxStoINT16U(tx_data & 0x0000FFFFL);
000964 e1a04005 MOV r4,r5
000968 e1a00805 LSL r0,r5,#16
00096c e1a00820 LSR r0,r0,#16
000970 ebfffffe BL OSView_TxStoINT16U
;;;1140 }
000974 e8bd4030 POP {r4,r5,lr}
000978 e12fff1e BX lr
ENDP
OSView_CmdGetSysInfo PROC
;;;475 static void OSView_CmdGetSysInfo (void)
;;;476 {
00097c e92d40f0 PUSH {r4-r7,lr}
000980 e24dd024 SUB sp,sp,#0x24
;;;477 INT8U s[OS_VIEW_CPU_NAME_SIZE+1];
;;;478 INT8U i;
;;;479 INT32U stk_base;
;;;480 INT32U stk_size;
;;;481 INT32U time;
;;;482
;;;483
;;;484 time = OSTimeGet(); /* Send current value of tick counter */
000984 ebfffffe BL OSTimeGet
000988 e1a07000 MOV r7,r0
;;;485 OSView_TxStoINT32U(time);
00098c e1a00007 MOV r0,r7
000990 ebfffffe BL OSView_TxStoINT32U
;;;486 OSView_TxStoPtr(OSTCBCur); /* Current task's OS_TCB */
000994 e51f0058 LDR r0,|L1.2372|
000998 e5900000 LDR r0,[r0,#0] ; OSTCBCur
00099c ebfffffe BL OSView_TxStoPtr
;;;487 OSView_TxStoINT16U(OS_VERSION); /* Send uC/OS-II's version number */
0009a0 e3a00f47 MOV r0,#0x11c
0009a4 ebfffffe BL OSView_TxStoINT16U
;;;488 OSView_TxStoINT8U(1); /* Indicate profiling information will be sent */
0009a8 e3a00001 MOV r0,#1
0009ac ebfffffe BL OSView_TxStoINT8U
;;;489
;;;490 for (i = 0; i < OS_VIEW_CPU_NAME_SIZE; i++) { /* Clear buffer to help with debug. */
0009b0 e3a04000 MOV r4,#0
0009b4 ea000004 B |L1.2508|
|L1.2488|
;;;491 s[i] = 0x00;
0009b8 e3a00000 MOV r0,#0
0009bc e28d1004 ADD r1,sp,#4
0009c0 e7c10004 STRB r0,[r1,r4]
0009c4 e2840001 ADD r0,r4,#1
0009c8 e20040ff AND r4,r0,#0xff
|L1.2508|
0009cc e354001e CMP r4,#0x1e
0009d0 bafffff8 BLT |L1.2488|
;;;492 }
;;;493 OSView_GetCPUName(s); /* Get Processor Name in string 's' */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -