?? os_core.txt
字號:
000254 e3a03003 MOV r3,#3 ;1012
000258 e3a02000 MOV r2,#0 ;1012
00025c e3a01080 MOV r1,#0x80 ;1012
000260 e98d000f STMIB sp,{r0-r3} ;1012
000264 e59f3244 LDR r3,|L1.1200| ;1012
000268 e2802f7f ADD r2,r0,#0x1fc ;1012
00026c e58d3000 STR r3,[sp,#0] ;1012
000270 e3a0300e MOV r3,#0xe ;1012
000274 e3a01000 MOV r1,#0 ;1012
000278 e24f0e22 ADR r0,|L1.96| ;1012
00027c ebfffffe BL OSTaskCreateExt ;1012
000280 e28d2014 ADD r2,sp,#0x14 ;1047
000284 e28f1f8a ADR r1,|L1.1204| ;1047
000288 e3a0000e MOV r0,#0xe ;1047
00028c ebfffffe BL OSTaskNameSet ;1047
;;;227 #endif
;;;228
;;;229 OS_InitMisc(); /* Initialize miscellaneous variables */
;;;230
;;;231 OS_InitRdyList(); /* Initialize the Ready List */
;;;232
;;;233 OS_InitTCBList(); /* Initialize the free list of OS_TCBs */
;;;234
;;;235 OS_InitEventList(); /* Initialize the free list of OS_EVENTs */
;;;236
;;;237 #if (OS_VERSION >= 251) && (OS_FLAG_EN > 0) && (OS_MAX_FLAGS > 0)
;;;238 OS_FlagInit(); /* Initialize the event flag structures */
;;;239 #endif
;;;240
;;;241 #if (OS_MEM_EN > 0) && (OS_MAX_MEM_PART > 0)
;;;242 OS_MemInit(); /* Initialize the memory manager */
;;;243 #endif
;;;244
;;;245 #if (OS_Q_EN > 0) && (OS_MAX_QS > 0)
;;;246 OS_QInit(); /* Initialize the message queue structures */
;;;247 #endif
;;;248
;;;249 OS_InitTaskIdle(); /* Create the Idle Task */
;;;250 #if OS_TASK_STAT_EN > 0
;;;251 OS_InitTaskStat(); /* Create the Statistic Task */
;;;252 #endif
;;;253
;;;254 #if OS_VERSION >= 204
;;;255 OSInitHookEnd(); /* Call port specific init. code */
000290 ebfffffe BL OSInitHookEnd
;;;256 #endif
;;;257
;;;258 #if OS_VERSION >= 270 && OS_DEBUG_EN > 0
;;;259 OSDebugInit();
000294 e28dd018 ADD sp,sp,#0x18
000298 e8bd4010 POP {r4,lr}
00029c eafffffe B OSDebugInit
;;;260 #endif
;;;261 }
ENDP
OSIntEnter PROC
;;;289 {
;;;290 if (OSRunning == TRUE) {
0002a0 e59f11e4 LDR r1,|L1.1164|
0002a4 e5d10007 LDRB r0,[r1,#7] ; OSRunning
0002a8 e3500001 CMP r0,#1
;;;291 if (OSIntNesting < 255u) {
;;;292 OSIntNesting++; /* Increment ISR nesting level */
;;;293 }
;;;294 }
;;;295 }
0002ac 112fff1e BXNE lr
0002b0 e5d10002 LDRB r0,[r1,#2] ;291 ; OSIntNesting
0002b4 e35000ff CMP r0,#0xff ;291
0002b8 32800001 ADDCC r0,r0,#1 ;292
0002bc 35c10002 STRBCC r0,[r1,#2] ;292 ; OSIntNesting
0002c0 e12fff1e BX lr
ENDP
OSIntExit PROC
;;;316 void OSIntExit (void)
;;;317 {
0002c4 e92d4070 PUSH {r4-r6,lr}
;;;318 #if OS_CRITICAL_METHOD == 3 /* Allocate storage for CPU status register */
;;;319 OS_CPU_SR cpu_sr = 0;
;;;320 #endif
;;;321
;;;322
;;;323
;;;324 if (OSRunning == TRUE) {
0002c8 e59f41bc LDR r4,|L1.1164|
0002cc e5d40007 LDRB r0,[r4,#7] ; OSRunning
0002d0 e3500001 CMP r0,#1
0002d4 1a00001c BNE |L1.844|
;;;325 OS_ENTER_CRITICAL();
0002d8 ebfffffe BL OS_CPU_SR_Save
;;;326 if (OSIntNesting > 0) { /* Prevent OSIntNesting from wrapping */
0002dc e5d41002 LDRB r1,[r4,#2] ; OSIntNesting
0002e0 e1a05000 MOV r5,r0 ;325
0002e4 e3510000 CMP r1,#0
0002e8 0a000003 BEQ |L1.764|
;;;327 OSIntNesting--;
0002ec e2410001 SUB r0,r1,#1
0002f0 e21010ff ANDS r1,r0,#0xff
0002f4 e5c41002 STRB r1,[r4,#2] ; OSIntNesting
;;;328 }
;;;329 if (OSIntNesting == 0) { /* Reschedule only if all ISRs complete ... */
0002f8 1a000010 BNE |L1.832|
;;;330 if (OSLockNesting == 0) { /* ... and not locked. */
|L1.764|
0002fc e5d40003 LDRB r0,[r4,#3] ; OSLockNesting
000300 e3500000 CMP r0,#0
000304 1a00000d BNE |L1.832|
;;;331 OS_SchedNew();
000308 ebfffffe BL OS_SchedNew
;;;332 if (OSPrioHighRdy != OSPrioCur) { /* No Ctx Sw if current task is highest rdy */
00030c e5d41005 LDRB r1,[r4,#5] ; OSPrioHighRdy
000310 e5d40004 LDRB r0,[r4,#4] ; OSPrioCur
000314 e1510000 CMP r1,r0
000318 0a000008 BEQ |L1.832|
;;;333 OSTCBHighRdy = OSTCBPrioTbl[OSPrioHighRdy];
00031c e59f0164 LDR r0,|L1.1160|
000320 e7901101 LDR r1,[r0,r1,LSL #2]
;;;334 #if OS_TASK_PROFILE_EN > 0
;;;335 OSTCBHighRdy->OSTCBCtxSwCtr++; /* Inc. # of context switches to this task */
000324 e5841024 STR r1,[r4,#0x24] ; OSTCBHighRdy
000328 e5910028 LDR r0,[r1,#0x28]
00032c e2800001 ADD r0,r0,#1
;;;336 #endif
;;;337 OSCtxSwCtr++; /* Keep track of the number of ctx switches */
000330 e5810028 STR r0,[r1,#0x28]
000334 e594000c LDR r0,[r4,#0xc] ; OSCtxSwCtr
000338 e2800001 ADD r0,r0,#1
00033c e584000c STR r0,[r4,#0xc] ; OSCtxSwCtr
;;;338 OSIntCtxSw(); /* Perform interrupt level ctx switch */
;;;339 }
;;;340 }
;;;341 }
;;;342 OS_EXIT_CRITICAL();
|L1.832|
000340 e1a00005 MOV r0,r5
000344 e8bd4070 POP {r4-r6,lr}
000348 eafffffe B OS_CPU_SR_Restore
;;;343 }
;;;344 }
|L1.844|
00034c e8bd4070 POP {r4-r6,lr}
000350 e12fff1e BX lr
ENDP
OSStart PROC
;;;448 void OSStart (void)
;;;449 {
000354 e92d4010 PUSH {r4,lr}
;;;450 if (OSRunning == FALSE) {
000358 e59f412c LDR r4,|L1.1164|
00035c e5d40007 LDRB r0,[r4,#7] ; OSRunning
000360 e3500000 CMP r0,#0
000364 1a000008 BNE |L1.908|
;;;451 OS_SchedNew(); /* Find highest priority's task priority number */
000368 ebfffffe BL OS_SchedNew
;;;452 OSPrioCur = OSPrioHighRdy;
00036c e5d40005 LDRB r0,[r4,#5] ; OSPrioHighRdy
;;;453 OSTCBHighRdy = OSTCBPrioTbl[OSPrioHighRdy]; /* Point to highest priority task ready to run */
000370 e59f1110 LDR r1,|L1.1160|
000374 e5c40004 STRB r0,[r4,#4] ;452 ; OSPrioCur
000378 e7910100 LDR r0,[r1,r0,LSL #2]
;;;454 OSTCBCur = OSTCBHighRdy;
00037c e5840024 STR r0,[r4,#0x24] ; OSTCBHighRdy
000380 e584001c STR r0,[r4,#0x1c] ; OSTCBCur
;;;455 OSStartHighRdy(); /* Execute target specific code to start task */
000384 e8bd4010 POP {r4,lr}
000388 eafffffe B OSStartHighRdy
;;;456 }
;;;457 }
|L1.908|
00038c e8bd4010 POP {r4,lr}
000390 e12fff1e BX lr
ENDP
OSStatInit PROC
;;;480 void OSStatInit (void)
;;;481 {
000394 e92d4010 PUSH {r4,lr}
;;;482 #if OS_CRITICAL_METHOD == 3 /* Allocate storage for CPU status register */
;;;483 OS_CPU_SR cpu_sr = 0;
;;;484 #endif
;;;485
;;;486
;;;487
;;;488 OSTimeDly(2); /* Synchronize with clock tick */
000398 e3a00002 MOV r0,#2
00039c ebfffffe BL OSTimeDly
;;;489 OS_ENTER_CRITICAL();
0003a0 ebfffffe BL OS_CPU_SR_Save
;;;490 OSIdleCtr = 0L; /* Clear idle counter */
0003a4 e59f40e0 LDR r4,|L1.1164|
0003a8 e3a01000 MOV r1,#0
0003ac e5841018 STR r1,[r4,#0x18] ; OSIdleCtr
;;;491 OS_EXIT_CRITICAL();
0003b0 ebfffffe BL OS_CPU_SR_Restore
;;;492 OSTimeDly(OS_TICKS_PER_SEC / 10); /* Determine MAX. idle counter value for 1/10 second */
0003b4 e3a0000a MOV r0,#0xa
0003b8 ebfffffe BL OSTimeDly
;;;493 OS_ENTER_CRITICAL();
0003bc ebfffffe BL OS_CPU_SR_Save
;;;494 OSIdleCtrMax = OSIdleCtr; /* Store maximum idle counter count in 1/10 second */
0003c0 e5941018 LDR r1,[r4,#0x18] ; OSIdleCtr
0003c4 e5841010 STR r1,[r4,#0x10] ; OSIdleCtrMax
;;;495 OSStatRdy = TRUE;
0003c8 e3a01001 MOV r1,#1
0003cc e5c41001 STRB r1,[r4,#1] ; OSStatRdy
;;;496 OS_EXIT_CRITICAL();
0003d0 e8bd4010 POP {r4,lr}
0003d4 eafffffe B OS_CPU_SR_Restore
;;;497 }
ENDP
OSTimeTick PROC
;;;514 void OSTimeTick (void)
;;;515 {
0003d8 e92d4070 PUSH {r4-r6,lr}
;;;516 OS_TCB *ptcb;
;;;517 #if OS_TICK_STEP_EN > 0
;;;518 BOOLEAN step;
;;;519 #endif
;;;520 #if OS_CRITICAL_METHOD == 3 /* Allocate storage for CPU status register */
;;;521 OS_CPU_SR cpu_sr = 0;
;;;522 #endif
;;;523
;;;524
;;;525
;;;526 #if OS_TIME_TICK_HOOK_EN > 0
;;;527 OSTimeTickHook(); /* Call user definable hook */
0003dc ebfffffe BL OSTimeTickHook
;;;528 #endif
;;;529 #if OS_TIME_GET_SET_EN > 0
;;;530 OS_ENTER_CRITICAL(); /* Update the 32-bit tick counter */
;;;531 OSTime++;
;;;532 OS_EXIT_CRITICAL();
;;;533 #endif
;;;534 if (OSRunning == TRUE) {
0003e0 e59f50a4 LDR r5,|L1.1164|
0003e4 e5d50007 LDRB r0,[r5,#7] ; OSRunning
0003e8 e3500001 CMP r0,#1
0003ec 1a000023 BNE |L1.1152|
;;;535 #if OS_TICK_STEP_EN > 0
;;;536 switch (OSTickStepState) { /* Determine whether we need to process a tick */
;;;537 case OS_TICK_STEP_DIS: /* Yes, stepping is disabled */
;;;538 step = TRUE;
;;;539 break;
;;;540
;;;541 case OS_TICK_STEP_WAIT: /* No, waiting for uC/OS-View to set ... */
;;;542 step = FALSE; /* .. OSTickStepState to OS_TICK_STEP_ONCE */
;;;543 break;
;;;544
;;;545 case OS_TICK_STEP_ONCE: /* Yes, process tick once and wait for next ... */
;;;546 step = TRUE; /* ... step command from uC/OS-View */
;;;547 OSTickStepState = OS_TICK_STEP_WAIT;
;;;548 break;
;;;549
;;;550 default: /* Invalid case, correct situation */
;;;551 step = TRUE;
;;;552 OSTickStepState = OS_TICK_STEP_DIS;
;;;553 break;
;;;554 }
;;;555 if (step == FALSE) { /* Return if waiting for step command */
;;;556 return;
;;;557 }
;;;558 #endif
;;;559 ptcb = OSTCBList; /* Point at first TCB in TCB list */
0003f0 e5954028 LDR r4,[r5,#0x28] ; OSTCBList
;;;560 while (ptcb->OSTCBPrio != OS_IDLE_PRIO) { /* Go through all TCBs in TCB list */
0003f4 ea00001e B |L1.1140|
;;;561 OS_ENTER_CRITICAL();
|L1.1016|
0003f8 ebfffffe BL OS_CPU_SR_Save
;;;562 if (ptcb->OSTCBDly != 0) { /* No, Delayed or waiting for event with TO */
0003fc e1d411bc LDRH r1,[r4,#0x1c]
000400 e3510000 CMP r1,#0
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -