📄 queue.lst
字号:
519 /* The task waiting has a higher priority than us so
520 force a context switch. */
521 *pxTaskWoken = pdTRUE;
\ 00000052 2560 STR R5,[R4, #+0]
\ 00000054 03E0 B ??xQueueReceiveFromISR_5
522 }
523 }
524 }
525 }
526 else
527 {
528 /* Increment the lock count so the task that unlocks the queue
529 knows that data was removed while it was locked. */
530 ++( pxQueue->xRxLock );
\ ??xQueueReceiveFromISR_4:
\ 00000056 491C ADD R1,R1,#+0x1
\ 00000058 C165 STR R1,[R0, #+0x5C]
531 }
532
533 xReturn = pdPASS;
\ 0000005A 00E0 B ??xQueueReceiveFromISR_5
534 }
535 else
536 {
537 xReturn = pdFAIL;
\ ??xQueueReceiveFromISR_0:
\ 0000005C 0025 MOV R5,#+0
538 }
539
540 return xReturn;
\ ??xQueueReceiveFromISR_5:
\ 0000005E 281C MOV R0,R5
\ 00000060 70BC POP {R4-R6}
\ 00000062 02BC POP {R1}
\ 00000064 0847 BX R1 ;; return
541 }
542 /*-----------------------------------------------------------*/
543
\ In segment CODE, align 4, keep-with-next
544 unsigned portBASE_TYPE uxQueueMessagesWaiting( xQueueHandle pxQueue )
545 {
\ uxQueueMessagesWaiting:
\ 00000000 10B5 PUSH {R4,LR}
\ 00000002 041C MOV R4,R0
546 unsigned portBASE_TYPE uxReturn;
547
548 taskENTER_CRITICAL();
\ 00000004 ........ _BLF vPortEnterCritical,vPortEnterCritical??rT
549 uxReturn = pxQueue->uxMessagesWaiting;
\ 00000008 246D LDR R4,[R4, #+0x50]
550 taskEXIT_CRITICAL();
\ 0000000A ........ _BLF vPortExitCritical,vPortExitCritical??rT
551
552 return uxReturn;
\ 0000000E 201C MOV R0,R4
\ 00000010 10BC POP {R4}
\ 00000012 02BC POP {R1}
\ 00000014 0847 BX R1 ;; return
553 }
554 /*-----------------------------------------------------------*/
555
\ In segment CODE, align 4, keep-with-next
556 void vQueueDelete( xQueueHandle pxQueue )
557 {
\ vQueueDelete:
\ 00000000 10B5 PUSH {R4,LR}
\ 00000002 041C MOV R4,R0
558 vPortFree( pxQueue->pcHead );
\ 00000004 0068 LDR R0,[R0, #+0]
\ 00000006 ........ _BLF vPortFree,vPortFree??rT
559 vPortFree( pxQueue );
\ 0000000A 201C MOV R0,R4
\ 0000000C ........ _BLF vPortFree,vPortFree??rT
560 }
\ 00000010 10BC POP {R4}
\ 00000012 01BC POP {R0}
\ 00000014 0047 BX R0 ;; return
561 /*-----------------------------------------------------------*/
562
\ In segment CODE, align 4, keep-with-next
563 static signed portBASE_TYPE prvUnlockQueue( xQueueHandle pxQueue )
564 {
\ ??prvUnlockQueue:
\ 00000000 B0B5 PUSH {R4,R5,R7,LR}
\ 00000002 041C MOV R4,R0
565 signed portBASE_TYPE xYieldRequired = pdFALSE;
\ 00000004 0025 MOV R5,#+0
566
567 /* THIS FUNCTION MUST BE CALLED WITH THE SCHEDULER SUSPENDED. */
568
569 /* The lock counts contains the number of extra data items placed or
570 removed from the queue while the queue was locked. When a queue is
571 locked items can be added or removed, but the event lists cannot be
572 updated. */
573 taskENTER_CRITICAL();
\ 00000006 ........ _BLF vPortEnterCritical,vPortEnterCritical??rT
574 {
575 --( pxQueue->xTxLock );
\ 0000000A 206E LDR R0,[R4, #+0x60]
\ 0000000C 401E SUB R0,R0,#+0x1
\ 0000000E 2066 STR R0,[R4, #+0x60]
576
577 /* See if data was added to the queue while it was locked. */
578 if( pxQueue->xTxLock > queueUNLOCKED )
\ 00000010 0027 MOV R7,#+0
\ 00000012 FF43 MVN R7,R7 ;; #-1
\ 00000014 0028 CMP R0,#+0
\ 00000016 0AD4 BMI ??prvUnlockQueue_1
579 {
580 pxQueue->xTxLock = queueUNLOCKED;
\ 00000018 2766 STR R7,[R4, #+0x60]
581
582 /* Data was posted while the queue was locked. Are any tasks
583 blocked waiting for data to become available? */
584 if( !listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) )
\ 0000001A 206B LDR R0,[R4, #+0x30]
\ 0000001C 0028 CMP R0,#+0
\ 0000001E 06D0 BEQ ??prvUnlockQueue_1
585 {
586 /* Tasks that are removed from the event list will get added to
587 the pending ready list as the scheduler is still suspended. */
588 if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE )
\ 00000020 201C MOV R0,R4
\ 00000022 3030 ADD R0,#+0x30
\ 00000024 ........ _BLF xTaskRemoveFromEventList,xTaskRemoveFromEventList??rT
\ 00000028 0028 CMP R0,#+0
\ 0000002A 00D0 BEQ ??prvUnlockQueue_1
589 {
590 /* The task waiting has a higher priority so record that a
591 context switch is required. */
592 xYieldRequired = pdTRUE;
\ 0000002C 0125 MOV R5,#+0x1
593 }
594 }
595 }
596 }
597 taskEXIT_CRITICAL();
\ ??prvUnlockQueue_1:
\ 0000002E ........ _BLF vPortExitCritical,vPortExitCritical??rT
598
599 /* Do the same for the Rx lock. */
600 taskENTER_CRITICAL();
\ 00000032 ........ _BLF vPortEnterCritical,vPortEnterCritical??rT
601 {
602 --( pxQueue->xRxLock );
\ 00000036 E06D LDR R0,[R4, #+0x5C]
\ 00000038 401E SUB R0,R0,#+0x1
\ 0000003A E065 STR R0,[R4, #+0x5C]
603
604 if( pxQueue->xRxLock > queueUNLOCKED )
\ 0000003C 0AD4 BMI ??prvUnlockQueue_2
605 {
606 pxQueue->xRxLock = queueUNLOCKED;
\ 0000003E E765 STR R7,[R4, #+0x5C]
607
608 if( !listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToSend ) ) )
\ 00000040 2069 LDR R0,[R4, #+0x10]
\ 00000042 0028 CMP R0,#+0
\ 00000044 06D0 BEQ ??prvUnlockQueue_2
609 {
610 if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToSend ) ) != pdFALSE )
\ 00000046 1034 ADD R4,#+0x10
\ 00000048 201C MOV R0,R4
\ 0000004A ........ _BLF xTaskRemoveFromEventList,xTaskRemoveFromEventList??rT
\ 0000004E 0028 CMP R0,#+0
\ 00000050 00D0 BEQ ??prvUnlockQueue_2
611 {
612 xYieldRequired = pdTRUE;
\ 00000052 0125 MOV R5,#+0x1
613 }
614 }
615 }
616 }
617 taskEXIT_CRITICAL();
\ ??prvUnlockQueue_2:
\ 00000054 ........ _BLF vPortExitCritical,vPortExitCritical??rT
618
619 return xYieldRequired;
\ 00000058 281C MOV R0,R5
\ 0000005A B0BC POP {R4,R5,R7}
\ 0000005C 02BC POP {R1}
\ 0000005E 0847 BX R1 ;; return
620 }
621 /*-----------------------------------------------------------*/
622
623 static signed portBASE_TYPE prvIsQueueEmpty( const xQueueHandle pxQueue )
624 {
625 signed portBASE_TYPE xReturn;
626
627 taskENTER_CRITICAL();
628 xReturn = ( pxQueue->uxMessagesWaiting == ( unsigned portBASE_TYPE ) 0 );
629 taskEXIT_CRITICAL();
630
631 return xReturn;
632 }
633 /*-----------------------------------------------------------*/
634
635 static signed portBASE_TYPE prvIsQueueFull( const xQueueHandle pxQueue )
636 {
637 signed portBASE_TYPE xReturn;
638
639 taskENTER_CRITICAL();
640 xReturn = ( pxQueue->uxMessagesWaiting == pxQueue->uxLength );
641 taskEXIT_CRITICAL();
642
643 return xReturn;
644 }
645
Maximum stack usage in bytes:
Function CSTACK
-------- ------
prvUnlockQueue 20
uxQueueMessagesWaiting 8
vQueueDelete 8
xQueueCreate 20
xQueueReceive 20
xQueueReceiveFromISR 16
xQueueSend 24
xQueueSendFromISR 12
Segment part sizes:
Function/Label
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -