📄 os_q.lst
字号:
429 *perr = OS_ERR_NONE;
\ 0000007C 2670 STRB R6,[R4, #+0]
430 return (pmsg); /* Return message received */
\ 0000007E 5046 MOV R0,R10
\ 00000080 C5E7 B.N ??OSQPend_2
431 }
432 OSTCBCur->OSTCBStat |= OS_STAT_Q; /* Task will have to pend for a message to be posted */
\ ??OSQPend_8:
\ 00000082 1D4F LDR.N R7,??OSQPend_6+0x4 ;; OSTCBCur
\ 00000084 3868 LDR R0,[R7, #+0]
\ 00000086 0100 MOVS R1,R0
\ 00000088 2C31 ADDS R1,R1,#+44
\ 0000008A 0978 LDRB R1,[R1, #+0]
\ 0000008C 51F00401 ORRS R1,R1,#0x4
\ 00000090 80F82C10 STRB R1,[R0, #+44]
433 OSTCBCur->OSTCBStatPend = OS_STAT_PEND_OK;
\ 00000094 3868 LDR R0,[R7, #+0]
\ 00000096 2D30 ADDS R0,R0,#+45
\ 00000098 3100 MOVS R1,R6
\ 0000009A 0170 STRB R1,[R0, #+0]
434 OSTCBCur->OSTCBDly = timeout; /* Load timeout into TCB */
\ 0000009C 3868 LDR R0,[R7, #+0]
\ 0000009E A0F82A90 STRH R9,[R0, #+42]
435 OS_EventTaskWait(pevent); /* Suspend task until event or timeout occurs */
\ 000000A2 4046 MOV R0,R8
\ 000000A4 ........ _BLF OS_EventTaskWait,??OS_EventTaskWait??rT
436 OS_EXIT_CRITICAL();
\ 000000A8 2800 MOVS R0,R5
\ 000000AA ........ _BLF OS_CPU_SR_Restore,??OS_CPU_SR_Restore??rT
437 OS_Sched(); /* Find next highest priority task ready to run */
\ 000000AE ........ _BLF OS_Sched,??OS_Sched??rT
438 OS_ENTER_CRITICAL();
\ 000000B2 ........ _BLF OS_CPU_SR_Save,??OS_CPU_SR_Save??rT
\ 000000B6 0500 MOVS R5,R0
439 if (OSTCBCur->OSTCBStatPend != OS_STAT_PEND_OK) { /* Was task readied because timed-out or aborted?*/
\ 000000B8 3868 LDR R0,[R7, #+0]
\ 000000BA 2030 ADDS R0,R0,#+32
\ 000000BC 417B LDRB R1,[R0, #+13]
\ 000000BE 0029 CMP R1,#+0
\ 000000C0 0ED0 BEQ.N ??OSQPend_10
440 pend_stat = OSTCBCur->OSTCBStatPend;
\ 000000C2 0E46 MOV R6,R1
441 OS_EventTOAbort(pevent);
\ 000000C4 4046 MOV R0,R8
\ 000000C6 ........ _BLF OS_EventTOAbort,??OS_EventTOAbort??rT
442 OS_EXIT_CRITICAL();
\ 000000CA 2800 MOVS R0,R5
\ 000000CC ........ _BLF OS_CPU_SR_Restore,??OS_CPU_SR_Restore??rT
443 switch (pend_stat) {
\ 000000D0 022E CMP R6,#+2
\ 000000D2 02D0 BEQ.N ??OSQPend_11
444 case OS_STAT_PEND_TO:
445 default:
446 *perr = OS_ERR_TIMEOUT; /* Indicate a timeout occured */
\ 000000D4 0A20 MOVS R0,#+10
\ 000000D6 2070 STRB R0,[R4, #+0]
\ 000000D8 98E7 B.N ??OSQPend_1
447 break;
448
449 case OS_STAT_PEND_ABORT:
450 *perr = OS_ERR_PEND_ABORT; /* Indicate that we aborted */
\ ??OSQPend_11:
\ 000000DA 0E20 MOVS R0,#+14
\ 000000DC 2070 STRB R0,[R4, #+0]
\ 000000DE 95E7 B.N ??OSQPend_1
451 break;
452 }
453 return ((void *)0); /* No message received */
454 }
455 pmsg = OSTCBCur->OSTCBMsg;/* No, Extract message from TCB (Put there by QPost) */
\ ??OSQPend_10:
\ 000000E0 0168 LDR R1,[R0, #+0]
\ 000000E2 8A46 MOV R10,R1
456 OSTCBCur->OSTCBMsg = (void *)0;
\ 000000E4 0660 STR R6,[R0, #+0]
457 OSTCBCur->OSTCBStat = OS_STAT_RDY;
\ 000000E6 3868 LDR R0,[R7, #+0]
\ 000000E8 2C30 ADDS R0,R0,#+44
\ 000000EA 3100 MOVS R1,R6
\ 000000EC 0170 STRB R1,[R0, #+0]
458 OSTCBCur->OSTCBEventPtr = (OS_EVENT *)0; /* No longer waiting for event */
\ 000000EE 3868 LDR R0,[R7, #+0]
\ 000000F0 C661 STR R6,[R0, #+28]
\ 000000F2 C0E7 B.N ??OSQPend_9
\ ??OSQPend_6:
\ 000000F4 ........ DC32 OSLockNesting
\ 000000F8 ........ DC32 OSTCBCur
459 OS_EXIT_CRITICAL();
460 *perr = OS_ERR_NONE;
461 return (pmsg); /* Return message received */
462 }
463 /*$PAGE*/
464 /*
465 *********************************************************************************************************
466 * ABORT WAITING ON A MESSAGE QUEUE
467 *
468 * Description: This function aborts & readies any tasks currently waiting on a queue. This function
469 * should be used to fault-abort the wait on the queue, rather than to normally signal
470 * the queue via OSQPost(), OSQPostFront() or OSQPostOpt().
471 *
472 * Arguments : pevent is a pointer to the event control block associated with the desired queue.
473 *
474 * opt determines the type of ABORT performed:
475 * OS_PEND_OPT_NONE ABORT wait for a single task (HPT) waiting on the
476 * queue
477 * OS_PEND_OPT_BROADCAST ABORT wait for ALL tasks that are waiting on the
478 * queue
479 *
480 * perr is a pointer to where an error message will be deposited. Possible error
481 * messages are:
482 *
483 * OS_ERR_NONE No tasks were waiting on the queue.
484 * OS_ERR_PEND_ABORT At least one task waiting on the queue was readied
485 * and informed of the aborted wait; check return value
486 * for the number of tasks whose wait on the queue
487 * was aborted.
488 * OS_ERR_EVENT_TYPE If you didn't pass a pointer to a queue.
489 * OS_ERR_PEVENT_NULL If 'pevent' is a NULL pointer.
490 *
491 * Returns : == 0 if no tasks were waiting on the queue, or upon error.
492 * > 0 if one or more tasks waiting on the queue are now readied and informed.
493 *********************************************************************************************************
494 */
495
496 #if OS_Q_PEND_ABORT_EN > 0
\ In segment CODE, align 4, keep-with-next
497 INT8U OSQPendAbort (OS_EVENT *pevent, INT8U opt, INT8U *perr)
498 {
\ OSQPendAbort:
\ 00000000 2DE9F043 PUSH {R4-R9,LR}
\ 00000004 8846 MOV R8,R1
\ 00000006 0400 MOVS R4,R0
\ 00000008 1500 MOVS R5,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' */
\ 0000000A 02D1 BNE.N ??OSQPendAbort_0
508 return (0);
\ ??OSQPendAbort_1:
\ 0000000C 0020 MOVS R0,#+0
\ ??OSQPendAbort_2:
\ 0000000E BDE8F083 POP {R4-R9,PC} ;; return
509 }
510 if (pevent == (OS_EVENT *)0) { /* Validate 'pevent' */
\ ??OSQPendAbort_0:
\ 00000012 002C CMP R4,#+0
\ 00000014 02D1 BNE.N ??OSQPendAbort_3
511 *perr = OS_ERR_PEVENT_NULL;
\ 00000016 0420 MOVS R0,#+4
\ 00000018 2870 STRB R0,[R5, #+0]
\ 0000001A F7E7 B.N ??OSQPendAbort_1
512 return (0);
513 }
514 #endif
515 if (pevent->OSEventType != OS_EVENT_TYPE_Q) { /* Validate event block type */
\ ??OSQPendAbort_3:
\ 0000001C 0120 MOVS R0,#+1
\ 0000001E 8146 MOV R9,R0
\ 00000020 2078 LDRB R0,[R4, #+0]
\ 00000022 0228 CMP R0,#+2
\ 00000024 02D0 BEQ.N ??OSQPendAbort_4
516 *perr = OS_ERR_EVENT_TYPE;
\ 00000026 4846 MOV R0,R9
\ 00000028 2870 STRB R0,[R5, #+0]
\ 0000002A EFE7 B.N ??OSQPendAbort_1
517 return (0);
518 }
519 OS_ENTER_CRITICAL();
\ ??OSQPendAbort_4:
\ 0000002C ........ _BLF OS_CPU_SR_Save,??OS_CPU_SR_Save??rT
\ 00000030 0600 MOVS R6,R0
520 if (pevent->OSEventGrp != 0) { /* See if any task waiting on queue? */
\ 00000032 0027 MOVS R7,#+0
\ 00000034 A07A LDRB R0,[R4, #+10]
\ 00000036 0028 CMP R0,#+0
\ 00000038 1ED0 BEQ.N ??OSQPendAbort_5
521 nbr_tasks = 0;
522 switch (opt) {
\ 0000003A 4046 MOV R0,R8
\ 0000003C 0128 CMP R0,#+1
\ 0000003E 0BD1 BNE.N ??OSQPendAbort_6
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 */
\ ??OSQPendAbort_7:
\ 00000040 A07A LDRB R0,[R4, #+10]
\ 00000042 0028 CMP R0,#+0
\ 00000044 0FD0 BEQ.N ??OSQPendAbort_8
525 (void)OS_EventTaskRdy(pevent, (void *)0, OS_STAT_Q, OS_STAT_PEND_ABORT);
\ 00000046 0223 MOVS R3,#+2
\ 00000048 0422 MOVS R2,#+4
\ 0000004A 0021 MOVS R1,#+0
\ 0000004C 2000 MOVS R0,R4
\ 0000004E ........ _BLF OS_EventTaskRdy,??OS_EventTaskRdy??rT
526 nbr_tasks++;
\ 00000052 7F1C ADDS R7,R7,#+1
\ 00000054 FFB2 UXTB R7,R7
\ 00000056 F3E7
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -