📄 os_core.txt
字号:
;;;278
;;;279 OSInitHookEnd(); /* Call port specific init. code */
00045c e28dd018 ADD sp,sp,#0x18
000460 e8bd4010 POP {r4,lr}
000464 eafffffe B OSInitHookEnd
;;;280
;;;281 #if OS_DEBUG_EN > 0
;;;282 OSDebugInit();
;;;283 #endif
;;;284 }
;;;285 /*$PAGE*/
ENDP
OSIntEnter PROC
;;;312 {
;;;313 if (OSRunning == OS_TRUE) {
000468 e59f1160 LDR r1,|L1.1488|
00046c e5d10007 LDRB r0,[r1,#7] ; OSRunning
000470 e3500001 CMP r0,#1
;;;314 if (OSIntNesting < 255u) {
;;;315 OSIntNesting++; /* Increment ISR nesting level */
;;;316 }
;;;317 }
;;;318 }
000474 112fff1e BXNE lr
000478 e5d10002 LDRB r0,[r1,#2] ;314 ; OSIntNesting
00047c e35000ff CMP r0,#0xff ;314
000480 32800001 ADDCC r0,r0,#1 ;315
000484 35c10002 STRBCC r0,[r1,#2] ;315 ; OSIntNesting
000488 e12fff1e BX lr
;;;319 /*$PAGE*/
ENDP
OSIntExit PROC
;;;339 void OSIntExit (void)
;;;340 {
00048c e92d4070 PUSH {r4-r6,lr}
;;;341 #if OS_CRITICAL_METHOD == 3 /* Allocate storage for CPU status register */
;;;342 OS_CPU_SR cpu_sr = 0;
;;;343 #endif
;;;344
;;;345
;;;346
;;;347 if (OSRunning == OS_TRUE) {
000490 e59f4138 LDR r4,|L1.1488|
000494 e5d40007 LDRB r0,[r4,#7] ; OSRunning
000498 e3500001 CMP r0,#1
00049c 1a00001d BNE |L1.1304|
;;;348 OS_ENTER_CRITICAL();
0004a0 ebfffffe BL OS_CPU_SR_Save
;;;349 if (OSIntNesting > 0) { /* Prevent OSIntNesting from wrapping */
0004a4 e5d41002 LDRB r1,[r4,#2] ; OSIntNesting
0004a8 e1a05000 MOV r5,r0 ;348
0004ac e3510000 CMP r1,#0
0004b0 0a000003 BEQ |L1.1220|
;;;350 OSIntNesting--;
0004b4 e2410001 SUB r0,r1,#1
0004b8 e21010ff ANDS r1,r0,#0xff
0004bc e5c41002 STRB r1,[r4,#2] ; OSIntNesting
;;;351 }
;;;352 if (OSIntNesting == 0) { /* Reschedule only if all ISRs complete ... */
0004c0 1a000011 BNE |L1.1292|
|L1.1220|
;;;353 if (OSLockNesting == 0) { /* ... and not locked. */
0004c4 e5d40003 LDRB r0,[r4,#3] ; OSLockNesting
0004c8 e3500000 CMP r0,#0
0004cc 1a00000e BNE |L1.1292|
;;;354 OS_SchedNew();
0004d0 ebfffffe BL OS_SchedNew
;;;355 if (OSPrioHighRdy != OSPrioCur) { /* No Ctx Sw if current task is highest rdy */
0004d4 e5d41005 LDRB r1,[r4,#5] ; OSPrioHighRdy
0004d8 e5d40004 LDRB r0,[r4,#4] ; OSPrioCur
0004dc e1510000 CMP r1,r0
0004e0 0a000009 BEQ |L1.1292|
;;;356 OSTCBHighRdy = OSTCBPrioTbl[OSPrioHighRdy];
0004e4 e59f00e8 LDR r0,|L1.1492|
0004e8 e7901101 LDR r1,[r0,r1,LSL #2]
;;;357 #if OS_TASK_PROFILE_EN > 0
;;;358 OSTCBHighRdy->OSTCBCtxSwCtr++; /* Inc. # of context switches to this task */
0004ec e584102c STR r1,[r4,#0x2c] ; OSTCBHighRdy
0004f0 e5910034 LDR r0,[r1,#0x34]
0004f4 e2800001 ADD r0,r0,#1
;;;359 #endif
;;;360 OSCtxSwCtr++; /* Keep track of the number of ctx switches */
0004f8 e5810034 STR r0,[r1,#0x34]
0004fc e594000c LDR r0,[r4,#0xc] ; OSCtxSwCtr
000500 e2800001 ADD r0,r0,#1
000504 e584000c STR r0,[r4,#0xc] ; OSCtxSwCtr
;;;361 OSIntCtxSw(); /* Perform interrupt level ctx switch */
000508 ebfffffe BL OSIntCtxSw
|L1.1292|
;;;362 }
;;;363 }
;;;364 }
;;;365 OS_EXIT_CRITICAL();
00050c e1a00005 MOV r0,r5
000510 e8bd4070 POP {r4-r6,lr}
000514 eafffffe B OS_CPU_SR_Restore
|L1.1304|
;;;366 }
;;;367 }
000518 e8bd4070 POP {r4-r6,lr}
00051c e12fff1e BX lr
;;;368 /*$PAGE*/
ENDP
OSSchedLock PROC
;;;386 void OSSchedLock (void)
;;;387 {
000520 e92d4010 PUSH {r4,lr}
;;;388 #if OS_CRITICAL_METHOD == 3 /* Allocate storage for CPU status register */
;;;389 OS_CPU_SR cpu_sr = 0;
;;;390 #endif
;;;391
;;;392
;;;393
;;;394 if (OSRunning == OS_TRUE) { /* Make sure multitasking is running */
000524 e59f40a4 LDR r4,|L1.1488|
000528 e5d40007 LDRB r0,[r4,#7] ; OSRunning
00052c e3500001 CMP r0,#1
000530 1a000009 BNE |L1.1372|
;;;395 OS_ENTER_CRITICAL();
000534 ebfffffe BL OS_CPU_SR_Save
;;;396 if (OSIntNesting == 0) { /* Can't call from an ISR */
000538 e5d41002 LDRB r1,[r4,#2] ; OSIntNesting
00053c e3510000 CMP r1,#0
000540 1a000003 BNE |L1.1364|
;;;397 if (OSLockNesting < 255u) { /* Prevent OSLockNesting from wrapping back to 0 */
000544 e5d41003 LDRB r1,[r4,#3] ; OSLockNesting
000548 e35100ff CMP r1,#0xff
;;;398 OSLockNesting++; /* Increment lock nesting level */
00054c 32811001 ADDCC r1,r1,#1
000550 35c41003 STRBCC r1,[r4,#3] ; OSLockNesting
|L1.1364|
;;;399 }
;;;400 }
;;;401 OS_EXIT_CRITICAL();
000554 e8bd4010 POP {r4,lr}
000558 eafffffe B OS_CPU_SR_Restore
|L1.1372|
;;;402 }
;;;403 }
00055c e8bd4010 POP {r4,lr}
000560 e12fff1e BX lr
;;;404 #endif
ENDP
OS_Sched PROC
;;;1211 void OS_Sched (void)
;;;1212 {
000564 e92d4070 PUSH {r4-r6,lr}
;;;1213 #if OS_CRITICAL_METHOD == 3 /* Allocate storage for CPU status register */
;;;1214 OS_CPU_SR cpu_sr = 0;
;;;1215 #endif
;;;1216
;;;1217
;;;1218
;;;1219 OS_ENTER_CRITICAL();
000568 ebfffffe BL OS_CPU_SR_Save
;;;1220 if (OSIntNesting == 0) { /* Schedule only if all ISRs done and ... */
00056c e59f405c LDR r4,|L1.1488|
000570 e1a05000 MOV r5,r0 ;1219
000574 e5d40002 LDRB r0,[r4,#2] ; OSIntNesting
000578 e3500000 CMP r0,#0
;;;1221 if (OSLockNesting == 0) { /* ... scheduler is not locked */
00057c 05d40003 LDRBEQ r0,[r4,#3] ; OSLockNesting
000580 03500000 CMPEQ r0,#0
000584 1a00000e BNE |L1.1476|
;;;1222 OS_SchedNew();
000588 ebfffffe BL OS_SchedNew
;;;1223 if (OSPrioHighRdy != OSPrioCur) { /* No Ctx Sw if current task is highest rdy */
00058c e5d41005 LDRB r1,[r4,#5] ; OSPrioHighRdy
000590 e5d40004 LDRB r0,[r4,#4] ; OSPrioCur
000594 e1510000 CMP r1,r0
000598 0a000009 BEQ |L1.1476|
;;;1224 OSTCBHighRdy = OSTCBPrioTbl[OSPrioHighRdy];
00059c e59f0030 LDR r0,|L1.1492|
0005a0 e7901101 LDR r1,[r0,r1,LSL #2]
;;;1225 #if OS_TASK_PROFILE_EN > 0
;;;1226 OSTCBHighRdy->OSTCBCtxSwCtr++; /* Inc. # of context switches to this task */
0005a4 e584102c STR r1,[r4,#0x2c] ; OSTCBHighRdy
0005a8 e5910034 LDR r0,[r1,#0x34]
0005ac e2800001 ADD r0,r0,#1
;;;1227 #endif
;;;1228 OSCtxSwCtr++; /* Increment context switch counter */
0005b0 e5810034 STR r0,[r1,#0x34]
0005b4 e594000c LDR r0,[r4,#0xc] ; OSCtxSwCtr
0005b8 e2800001 ADD r0,r0,#1
0005bc e584000c STR r0,[r4,#0xc] ; OSCtxSwCtr
;;;1229 OS_TASK_SW(); /* Perform a context switch */
0005c0 ebfffffe BL OSCtxSw
|L1.1476|
;;;1230 }
;;;1231 }
;;;1232 }
;;;1233 OS_EXIT_CRITICAL();
0005c4 e1a00005 MOV r0,r5
0005c8 e8bd4070 POP {r4-r6,lr}
0005cc eafffffe B OS_CPU_SR_Restore
|L1.1488|
0005d0 00000000 DCD ||.data||
|L1.1492|
0005d4 00000540 DCD ||.bss||+0x540
|L1.1496|
0005d8 000005c0 DCD ||.bss||+0x5c0
|L1.1500|
0005dc 00000000 DCD ||.bss||
|L1.1504|
0005e0 00000340 DCD ||.bss||+0x340
|L1.1508|
0005e4 0000ffff DCD 0x0000ffff
|L1.1512|
0005e8 75432f4f DCB "uC/O"
0005ec 532d4949 DCB "S-II"
0005f0 2049646c DCB " Idl"
0005f4 65000000 DCB "e\0\0\0"
|L1.1528|
0005f8 00000140 DCD ||.bss||+0x140
|L1.1532|
0005fc 0000fffe DCD 0x0000fffe
|L1.1536|
000600 75432f4f DCB "uC/O"
000604 532d4949 DCB "S-II"
000608 20537461 DCB " Sta"
00060c 74000000 DCB "t\0\0\0"
ENDP
OSSchedUnlock PROC
;;;423 void OSSchedUnlock (void)
;;;424 {
000610 e92d4010 PUSH {r4,lr}
;;;425 #if OS_CRITICAL_METHOD == 3 /* Allocate storage for CPU status register */
;;;426 OS_CPU_SR cpu_sr = 0;
;;;427 #endif
;;;428
;;;429
;;;430
;;;431 if (OSRunning == OS_TRUE) { /* Make sure multitasking is running */
000614 e51f404c LDR r4,|L1.1488|
000618 e5d40007 LDRB r0,[r4,#7] ; OSRunning
00061c e3500001 CMP r0,#1
000620 1a00000e BNE |L1.1632|
;;;432 OS_ENTER_CRITICAL();
000624 ebfffffe BL OS_CPU_SR_Save
;;;433 if (OSLockNesting > 0) { /* Do not decrement if already 0 */
000628 e5d41003 LDRB r1,[r4,#3] ; OSLockNesting
00062c e3510000 CMP r1,#0
000630 0a000008 BEQ |L1.1624|
;;;434 OSLockNesting--; /* Decrement lock nesting level */
000634 e2411001 SUB r1,r1,#1
000638 e21110ff ANDS r1,r1,#0xff
00063c e5c41003 STRB r1,[r4,#3] ; OSLockNesting
;;;435 if (OSLockNesting == 0) { /* See if scheduler is enabled and ... */
;;;436 if (OSIntNesting == 0) { /* ... not in an ISR */
000640 05d41002 LDRBEQ r1,[r4,#2] ; OSIntNesting
000644 03510000 CMPEQ r1,#0
000648 1a000002 BNE |L1.1624|
;;;437 OS_EXIT_CRITICAL();
00064c ebfffffe BL OS_CPU_SR_Restore
;;;438 OS_Sched(); /* See if a HPT is ready */
000650 e8bd4010 POP {r4,lr}
000654 eafffffe B OS_Sched
|L1.1624|
;;;439 } else {
;;;440 OS_EXIT_CRITICAL();
;;;441 }
;;;442 } else {
;;;443 OS_EXIT_CRITICAL();
;;;444 }
;;;445 } else {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -