📄 os_q.lst
字号:
\ 00000098 5D0000EA B ??OSQPend_1
419 }
420 OS_ENTER_CRITICAL();
\ ??OSQPend_6:
\ 0000009C ........ _BLF OS_CPU_SR_Save,??OS_CPU_SR_Save??rA
\ 000000A0 00A0B0E1 MOVS R10,R0
421 pq = (OS_Q *)pevent->OSEventPtr; /* Point at queue control block */
\ 000000A4 040094E5 LDR R0,[R4, #+4]
\ 000000A8 0080B0E1 MOVS R8,R0
422 if (pq->OSQEntries > 0) { /* See if any messages in the queue */
\ 000000AC B601D8E1 LDRH R0,[R8, #+22]
\ 000000B0 010050E3 CMP R0,#+1
\ 000000B4 1500003A BCC ??OSQPend_7
423 msg = *pq->OSQOut++; /* Yes, extract oldest message from the queue */
\ 000000B8 100098E5 LDR R0,[R8, #+16]
\ 000000BC 041090E2 ADDS R1,R0,#+4
\ 000000C0 101088E5 STR R1,[R8, #+16]
\ 000000C4 000090E5 LDR R0,[R0, #+0]
\ 000000C8 0070B0E1 MOVS R7,R0
424 pq->OSQEntries--; /* Update the number of entries in the queue */
\ 000000CC B601D8E1 LDRH R0,[R8, #+22]
\ 000000D0 FF10A0E3 MOV R1,#+255
\ 000000D4 FF1C81E3 ORR R1,R1,#0xFF00
\ 000000D8 000091E0 ADDS R0,R1,R0
\ 000000DC B601C8E1 STRH R0,[R8, #+22]
425 if (pq->OSQOut == pq->OSQEnd) { /* Wrap OUT pointer if we are at the end of the queue */
\ 000000E0 100098E5 LDR R0,[R8, #+16]
\ 000000E4 081098E5 LDR R1,[R8, #+8]
\ 000000E8 010050E1 CMP R0,R1
\ 000000EC 0100001A BNE ??OSQPend_8
426 pq->OSQOut = pq->OSQStart;
\ 000000F0 040098E5 LDR R0,[R8, #+4]
\ 000000F4 100088E5 STR R0,[R8, #+16]
427 }
428 OS_EXIT_CRITICAL();
\ ??OSQPend_8:
\ 000000F8 0A00B0E1 MOVS R0,R10
\ 000000FC ........ _BLF OS_CPU_SR_Restore,??OS_CPU_SR_Restore??rA
429 *err = OS_ERR_NONE;
\ 00000100 0000A0E3 MOV R0,#+0
\ 00000104 0000C6E5 STRB R0,[R6, #+0]
430 return (msg); /* Return message received */
\ 00000108 0700B0E1 MOVS R0,R7
\ 0000010C 400000EA B ??OSQPend_1
431 }
432 OSTCBCur->OSTCBStat |= OS_STAT_Q; /* Task will have to pend for a message to be posted */
\ ??OSQPend_7:
\ 00000110 04019FE5 LDR R0,??OSQPend_5+0x4 ;; OSTCBCur
\ 00000114 000090E5 LDR R0,[R0, #+0]
\ 00000118 FC109FE5 LDR R1,??OSQPend_5+0x4 ;; OSTCBCur
\ 0000011C 001091E5 LDR R1,[R1, #+0]
\ 00000120 2C10D1E5 LDRB R1,[R1, #+44]
\ 00000124 041091E3 ORRS R1,R1,#0x4
\ 00000128 2C10C0E5 STRB R1,[R0, #+44]
433 OSTCBCur->OSTCBStatPend = OS_STAT_PEND_OK;
\ 0000012C E8009FE5 LDR R0,??OSQPend_5+0x4 ;; OSTCBCur
\ 00000130 000090E5 LDR R0,[R0, #+0]
\ 00000134 0010A0E3 MOV R1,#+0
\ 00000138 2D10C0E5 STRB R1,[R0, #+45]
434 OSTCBCur->OSTCBDly = timeout; /* Load timeout into TCB */
\ 0000013C D8009FE5 LDR R0,??OSQPend_5+0x4 ;; OSTCBCur
\ 00000140 000090E5 LDR R0,[R0, #+0]
\ 00000144 BA52C0E1 STRH R5,[R0, #+42]
435 OS_EventTaskWait(pevent); /* Suspend task until event or timeout occurs */
\ 00000148 0400B0E1 MOVS R0,R4
\ 0000014C ........ _BLF OS_EventTaskWait,??OS_EventTaskWait??rA
436 OS_EXIT_CRITICAL();
\ 00000150 0A00B0E1 MOVS R0,R10
\ 00000154 ........ _BLF OS_CPU_SR_Restore,??OS_CPU_SR_Restore??rA
437 OS_Sched(); /* Find next highest priority task ready to run */
\ 00000158 ........ _BLF OS_Sched,??OS_Sched??rA
438 OS_ENTER_CRITICAL();
\ 0000015C ........ _BLF OS_CPU_SR_Save,??OS_CPU_SR_Save??rA
\ 00000160 00A0B0E1 MOVS R10,R0
439 if (OSTCBCur->OSTCBStatPend != OS_STAT_PEND_OK) { /* Was task readied because timed-out or aborted?*/
\ 00000164 B0009FE5 LDR R0,??OSQPend_5+0x4 ;; OSTCBCur
\ 00000168 000090E5 LDR R0,[R0, #+0]
\ 0000016C 2D00D0E5 LDRB R0,[R0, #+45]
\ 00000170 000050E3 CMP R0,#+0
\ 00000174 1100000A BEQ ??OSQPend_9
440 pend_stat = OSTCBCur->OSTCBStatPend;
\ 00000178 9C009FE5 LDR R0,??OSQPend_5+0x4 ;; OSTCBCur
\ 0000017C 000090E5 LDR R0,[R0, #+0]
\ 00000180 2D00D0E5 LDRB R0,[R0, #+45]
\ 00000184 0090B0E1 MOVS R9,R0
441 OS_EventTOAbort(pevent);
\ 00000188 0400B0E1 MOVS R0,R4
\ 0000018C ........ _BLF OS_EventTOAbort,??OS_EventTOAbort??rA
442 OS_EXIT_CRITICAL();
\ 00000190 0A00B0E1 MOVS R0,R10
\ 00000194 ........ _BLF OS_CPU_SR_Restore,??OS_CPU_SR_Restore??rA
443 switch (pend_stat) {
\ 00000198 0900B0E1 MOVS R0,R9
\ 0000019C 020050E3 CMP R0,#+2
\ 000001A0 0200000A BEQ ??OSQPend_10
444 case OS_STAT_PEND_TO:
445 default:
446 *err = OS_ERR_TIMEOUT; /* Indicate a timeout occured */
\ ??OSQPend_11:
\ 000001A4 0A00A0E3 MOV R0,#+10
\ 000001A8 0000C6E5 STRB R0,[R6, #+0]
\ 000001AC 010000EA B ??OSQPend_12
447 break;
448
449 case OS_STAT_PEND_ABORT:
450 *err = OS_ERR_PEND_ABORT; /* Indicate that we aborted */
\ ??OSQPend_10:
\ 000001B0 0E00A0E3 MOV R0,#+14
\ 000001B4 0000C6E5 STRB R0,[R6, #+0]
451 break;
452 }
453 return ((void *)0); /* No message received */
\ ??OSQPend_12:
\ 000001B8 0000A0E3 MOV R0,#+0
\ 000001BC 140000EA B ??OSQPend_1
454 }
455 msg = OSTCBCur->OSTCBMsg;/* No, Extract message from TCB (Put there by QPost) */
\ ??OSQPend_9:
\ 000001C0 54009FE5 LDR R0,??OSQPend_5+0x4 ;; OSTCBCur
\ 000001C4 000090E5 LDR R0,[R0, #+0]
\ 000001C8 200090E5 LDR R0,[R0, #+32]
\ 000001CC 0070B0E1 MOVS R7,R0
456 OSTCBCur->OSTCBMsg = (void *)0;
\ 000001D0 44009FE5 LDR R0,??OSQPend_5+0x4 ;; OSTCBCur
\ 000001D4 000090E5 LDR R0,[R0, #+0]
\ 000001D8 0010A0E3 MOV R1,#+0
\ 000001DC 201080E5 STR R1,[R0, #+32]
457 OSTCBCur->OSTCBStat = OS_STAT_RDY;
\ 000001E0 34009FE5 LDR R0,??OSQPend_5+0x4 ;; OSTCBCur
\ 000001E4 000090E5 LDR R0,[R0, #+0]
\ 000001E8 0010A0E3 MOV R1,#+0
\ 000001EC 2C10C0E5 STRB R1,[R0, #+44]
458 OSTCBCur->OSTCBEventPtr = (OS_EVENT *)0; /* No longer waiting for event */
\ 000001F0 24009FE5 LDR R0,??OSQPend_5+0x4 ;; OSTCBCur
\ 000001F4 000090E5 LDR R0,[R0, #+0]
\ 000001F8 0010A0E3 MOV R1,#+0
\ 000001FC 1C1080E5 STR R1,[R0, #+28]
459 OS_EXIT_CRITICAL();
\ 00000200 0A00B0E1 MOVS R0,R10
\ 00000204 ........ _BLF OS_CPU_SR_Restore,??OS_CPU_SR_Restore??rA
460 *err = OS_ERR_NONE;
\ 00000208 0000A0E3 MOV R0,#+0
\ 0000020C 0000C6E5 STRB R0,[R6, #+0]
461 return (msg); /* Return message received */
\ 00000210 0700B0E1 MOVS R0,R7
\ ??OSQPend_1:
\ 00000214 F087BDE8 POP {R4-R10,PC} ;; return
\ ??OSQPend_5:
\ 00000218 ........ DC32 OSLockNesting
\ 0000021C ........ DC32 OSTCBCur
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 * err 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 *err)
498 {
\ OSQPendAbort:
\ 00000000 F0412DE9 PUSH {R4-R8,LR}
\ 00000004 0040B0E1 MOVS R4,R0
\ 00000008 0150B0E1 MOVS R5,R1
\ 0000000C 0260B0E1 MOVS 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;
\ 00000010 0000A0E3 MOV R0,#+0
\ 00000014 0080B0E1 MOVS R8,R0
502 #endif
503
504
505
506 #if OS_ARG_CHK_EN > 0
507 if (err == (INT8U *)0) {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -