?? os_q.txt
字號:
000246 4883 LDR r0,|L1.1108|
000248 7800 LDRB r0,[r0,#0] ; OSIntNesting
00024a b120 CBZ r0,|L1.598|
;;;413 *perr = OS_ERR_PEND_ISR; /* ... can't PEND from an ISR */
00024c 2002 MOVS r0,#2
00024e 7020 STRB r0,[r4,#0]
;;;414 return ((void *)0);
000250 2000 MOVS r0,#0
000252 e8bde8bd POP {r4-r10,pc}
|L1.598|
;;;415 }
;;;416 if (OSLockNesting > 0) { /* See if called with scheduler locked ... */
000256 4882 LDR r0,|L1.1120|
000258 7800 LDRB r0,[r0,#0] ; OSLockNesting
00025a b120 CBZ r0,|L1.614|
;;;417 *perr = OS_ERR_PEND_LOCKED; /* ... can't PEND when locked */
00025c 200d MOVS r0,#0xd
00025e 7020 STRB r0,[r4,#0]
;;;418 return ((void *)0);
000260 2000 MOVS r0,#0
000262 e8bde8bd POP {r4-r10,pc}
|L1.614|
;;;419 }
;;;420 OS_ENTER_CRITICAL();
000266 f7fff7ff BL OS_CPU_SR_Save
00026a 4680 MOV r8,r0
;;;421 pq = (OS_Q *)pevent->OSEventPtr; /* Point at queue control block */
00026c 6869 LDR r1,[r5,#4]
;;;422 if (pq->OSQEntries > 0) { /* See if any messages in the queue */
00026e 2600 MOVS r6,#0
000270 8ac8 LDRH r0,[r1,#0x16]
000272 b190 CBZ r0,|L1.666|
;;;423 pmsg = *pq->OSQOut++; /* Yes, extract oldest message from the queue */
000274 6908 LDR r0,[r1,#0x10]
000276 1d02 ADDS r2,r0,#4
000278 610a STR r2,[r1,#0x10]
00027a 6805 LDR r5,[r0,#0]
;;;424 pq->OSQEntries--; /* Update the number of entries in the queue */
00027c 8ac8 LDRH r0,[r1,#0x16]
00027e 1e40 SUBS r0,r0,#1
000280 82c8 STRH r0,[r1,#0x16]
;;;425 if (pq->OSQOut == pq->OSQEnd) { /* Wrap OUT pointer if we are at the end of the queue */
000282 6888 LDR r0,[r1,#8]
000284 4282 CMP r2,r0
000286 d101 BNE |L1.652|
;;;426 pq->OSQOut = pq->OSQStart;
000288 6848 LDR r0,[r1,#4]
00028a 6108 STR r0,[r1,#0x10]
|L1.652|
;;;427 }
;;;428 OS_EXIT_CRITICAL();
00028c 4640 MOV r0,r8
00028e f7fff7ff BL OS_CPU_SR_Restore
;;;429 *perr = OS_ERR_NONE;
000292 7026 STRB r6,[r4,#0]
;;;430 return (pmsg); /* Return message received */
000294 4628 MOV r0,r5
000296 e8bde8bd POP {r4-r10,pc}
|L1.666|
;;;431 }
;;;432 OSTCBCur->OSTCBStat |= OS_STAT_Q; /* Task will have to pend for a message to be posted */
00029a f8dff8df LDR r9,|L1.1124|
00029e f8d9f8d9 LDR r1,[r9,#0] ; OSTCBCur
0002a2 f891f891 LDRB r0,[r1,#0x2c]
0002a6 f040f040 ORR r0,r0,#4
0002aa f881f881 STRB r0,[r1,#0x2c]
;;;433 OSTCBCur->OSTCBStatPend = OS_STAT_PEND_OK;
0002ae f881f881 STRB r6,[r1,#0x2d]
;;;434 OSTCBCur->OSTCBDly = timeout; /* Load timeout into TCB */
0002b2 854f STRH r7,[r1,#0x2a]
;;;435 OS_EventTaskWait(pevent); /* Suspend task until event or timeout occurs */
0002b4 4628 MOV r0,r5
0002b6 f7fff7ff BL OS_EventTaskWait
;;;436 OS_EXIT_CRITICAL();
0002ba 4640 MOV r0,r8
0002bc f7fff7ff BL OS_CPU_SR_Restore
;;;437 OS_Sched(); /* Find next highest priority task ready to run */
0002c0 f7fff7ff BL OS_Sched
;;;438 OS_ENTER_CRITICAL();
0002c4 f7fff7ff BL OS_CPU_SR_Save
0002c8 4680 MOV r8,r0
;;;439 if (OSTCBCur->OSTCBStatPend != OS_STAT_PEND_OK) { /* Was task readied because timed-out or aborted?*/
0002ca f8d9f8d9 LDR r1,[r9,#0] ; OSTCBCur
0002ce f891f891 LDRB r7,[r1,#0x2d]
0002d2 b17f CBZ r7,|L1.756|
;;;440 pend_stat = OSTCBCur->OSTCBStatPend;
;;;441 OS_EventTOAbort(pevent);
0002d4 4628 MOV r0,r5
0002d6 f7fff7ff BL OS_EventTOAbort
;;;442 OS_EXIT_CRITICAL();
0002da 4640 MOV r0,r8
0002dc f7fff7ff BL OS_CPU_SR_Restore
;;;443 switch (pend_stat) {
0002e0 2f02 CMP r7,#2
0002e2 d002 BEQ |L1.746|
;;;444 case OS_STAT_PEND_TO:
;;;445 default:
;;;446 *perr = OS_ERR_TIMEOUT; /* Indicate a timeout occured */
0002e4 200a MOVS r0,#0xa
0002e6 7020 STRB r0,[r4,#0]
;;;447 break;
0002e8 e001 B |L1.750|
|L1.746|
;;;448
;;;449 case OS_STAT_PEND_ABORT:
;;;450 *perr = OS_ERR_PEND_ABORT; /* Indicate that we aborted */
0002ea 200e MOVS r0,#0xe
0002ec 7020 STRB r0,[r4,#0]
|L1.750|
;;;451 break;
;;;452 }
;;;453 return ((void *)0); /* No message received */
0002ee 2000 MOVS r0,#0
0002f0 e8bde8bd POP {r4-r10,pc}
|L1.756|
;;;454 }
;;;455 pmsg = OSTCBCur->OSTCBMsg;/* No, Extract message from TCB (Put there by QPost) */
0002f4 6a0d LDR r5,[r1,#0x20]
;;;456 OSTCBCur->OSTCBMsg = (void *)0;
0002f6 620e STR r6,[r1,#0x20]
;;;457 OSTCBCur->OSTCBStat = OS_STAT_RDY;
0002f8 f881f881 STRB r6,[r1,#0x2c]
;;;458 OSTCBCur->OSTCBEventPtr = (OS_EVENT *)0; /* No longer waiting for event */
0002fc 61ce STR r6,[r1,#0x1c]
;;;459 OS_EXIT_CRITICAL();
0002fe 4640 MOV r0,r8
000300 f7fff7ff BL OS_CPU_SR_Restore
;;;460 *perr = OS_ERR_NONE;
000304 7026 STRB r6,[r4,#0]
;;;461 return (pmsg); /* Return message received */
000306 4628 MOV r0,r5
;;;462 }
000308 e8bde8bd POP {r4-r10,pc}
;;;463 /*$PAGE*/
ENDP
OSQPendAbort PROC
;;;497 INT8U OSQPendAbort (OS_EVENT *pevent, INT8U opt, INT8U *perr)
;;;498 {
00030c e92de92d PUSH {r4-r8,lr}
000310 4605 MOV r5,r0
000312 4688 MOV r8,r1
000314 4616 MOV r6,r2
;;;499 INT8U nbr_tasks;
;;;500 #if OS_CRITICAL_METHOD == 3 /* Allocate storage for CPU status register */
;;;501 OS_CPU_SR cpu_sr = 0;
;;;502 #endif
;;;503
;;;504
;;;505
;;;506 #if OS_ARG_CHK_EN > 0
;;;507 if (perr == (INT8U *)0) { /* Validate 'perr' */
000316 b916 CBNZ r6,|L1.798|
;;;508 return (0);
000318 2000 MOVS r0,#0
00031a e8bde8bd POP {r4-r8,pc}
|L1.798|
;;;509 }
;;;510 if (pevent == (OS_EVENT *)0) { /* Validate 'pevent' */
00031e b925 CBNZ r5,|L1.810|
;;;511 *perr = OS_ERR_PEVENT_NULL;
000320 2004 MOVS r0,#4
000322 7030 STRB r0,[r6,#0]
;;;512 return (0);
000324 2000 MOVS r0,#0
000326 e8bde8bd POP {r4-r8,pc}
|L1.810|
;;;513 }
;;;514 #endif
;;;515 if (pevent->OSEventType != OS_EVENT_TYPE_Q) { /* Validate event block type */
00032a 7829 LDRB r1,[r5,#0]
00032c 2001 MOVS r0,#1
00032e 2902 CMP r1,#2
000330 d003 BEQ |L1.826|
;;;516 *perr = OS_ERR_EVENT_TYPE;
000332 7030 STRB r0,[r6,#0]
;;;517 return (0);
000334 2000 MOVS r0,#0
000336 e8bde8bd POP {r4-r8,pc}
|L1.826|
;;;518 }
;;;519 OS_ENTER_CRITICAL();
00033a f7fff7ff BL OS_CPU_SR_Save
00033e 4607 MOV r7,r0
;;;520 if (pevent->OSEventGrp != 0) { /* See if any task waiting on queue? */
000340 7aa8 LDRB r0,[r5,#0xa]
000342 b300 CBZ r0,|L1.902|
;;;521 nbr_tasks = 0;
000344 2400 MOVS r4,#0
;;;522 switch (opt) {
000346 f1b8f1b8 CMP r8,#1
00034a d10b BNE |L1.868|
|L1.844|
00034c 2302 MOVS r3,#2
00034e 2204 MOVS r2,#4
000350 2100 MOVS r1,#0
000352 4628 MOV r0,r5
000354 f7fff7ff BL OS_EventTaskRdy
000358 1c60 ADDS r0,r4,#1
;;;523 case OS_PEND_OPT_BROADCAST: /* Do we need to abort ALL waiting tasks? */
;;;524 while (pevent->OSEventGrp != 0) { /* Yes, ready ALL tasks waiting on queue */
;;;525 (void)OS_EventTaskRdy(pevent, (void *)0, OS_STAT_Q, OS_STAT_PEND_ABORT);
;;;526 nbr_tasks++;
00035a b2c4 UXTB r4,r0
00035c 7aa9 LDRB r1,[r5,#0xa]
00035e 2900 CMP r1,#0
000360 d1f4 BNE |L1.844|
000362 e006 B |L1.882|
|L1.868|
;;;527 }
;;;528 break;
;;;529
;;;530 case OS_PEND_OPT_NONE: /* No, ready HPT waiting on queue */
;;;531 default:
;;;532 (void)OS_EventTaskRdy(pevent, (void *)0, OS_STAT_Q, OS_STAT_PEND_ABORT);
000364 2302 MOVS r3,#2
000366 2204 MOVS r2,#4
000368 2100 MOVS r1,#0
00036a 4628 MOV r0,r5
00036c f7fff7ff BL OS_EventTaskRdy
;;;533 nbr_tasks++;
000370 2401 MOVS r4,#1
|L1.882|
;;;534 break;
;;;535 }
;;;536 OS_EXIT_CRITICAL();
000372 4638 MOV r0,r7
000374 f7fff7ff BL OS_CPU_SR_Restore
;;;537 OS_Sched(); /* Find HPT ready to run */
000378 f7fff7ff BL OS_Sched
;;;538 *perr = OS_ERR_PEND_ABORT;
00037c 200e MOVS r0,#0xe
00037e 7030 STRB r0,[r6,#0]
;;;539 return (nbr_tasks);
000380 4620 MOV r0,r4
000382 e8bde8bd POP {r4-r8,pc}
|L1.902|
;;;540 }
;;;541 OS_EXIT_CRITICAL();
000386 4638 MOV r0,r7
000388 f7fff7ff BL OS_CPU_SR_Restore
;;;542 *perr = OS_ERR_NONE;
00038c 2000 MOVS r0,#0
00038e 7030 STRB r0,[r6,#0]
;;;543 return (0); /* No tasks waiting on queue */
;;;544 }
000390 e8bde8bd POP {r4-r8,pc}
;;;545 #endif
ENDP
OSQPost PROC
;;;568 INT8U OSQPost (OS_EVENT *pevent, void *pmsg)
;;;569 {
000394 b570 PUSH {r4-r6,lr}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -