📄 tasks.lst
字号:
\ ??vTaskDelayUntil_3:
\ 000078 B012.... CALL #xTaskResumeAll
\ 00007C 094C MOV.W R12, R9
676
677 /* Force a reschedule if xTaskResumeAll has not already done so, we may
678 have put ourselves to sleep. */
679 if( !xAlreadyYielded )
\ 00007E 0993 CMP.W #0x0, R9
\ 000080 0220 JNE ??vTaskDelayUntil_5
680 {
681 taskYIELD();
\ 000082 B012.... CALL #vPortYield
682 }
683 }
\ ??vTaskDelayUntil_5:
\ 000086 3040.... BR #?Epilogue5
684
685 #endif
686 /*-----------------------------------------------------------*/
687
688 #if ( INCLUDE_vTaskDelay == 1 )
689
\ In segment CODE, align 2
690 void vTaskDelay( portTickType xTicksToDelay )
\ vTaskDelay:
691 {
\ 000000 0A12 PUSH.W R10
\ 000002 0B12 PUSH.W R11
\ 000004 0812 PUSH.W R8
\ 000006 0A4C MOV.W R12, R10
692 portTickType xTimeToWake;
693 signed portBASE_TYPE xAlreadyYielded = pdFALSE;
\ 000008 0843 MOV.W #0x0, R8
694
695 /* A delay time of zero just forces a reschedule. */
696 if( xTicksToDelay > ( portTickType ) 0 )
\ 00000A 0A93 CMP.W #0x0, R10
\ 00000C 2424 JEQ ??vTaskDelay_0
697 {
698 vTaskSuspendAll();
\ 00000E B012.... CALL #vTaskSuspendAll
699 {
700 /* A task that is removed from the event list while the
701 scheduler is suspended will not get placed in the ready
702 list or removed from the blocked list until the scheduler
703 is resumed.
704
705 This task cannot be in an event list as it is the currently
706 executing task. */
707
708 /* Calculate the time to wake - this may overflow but this is
709 not a problem. */
710 xTimeToWake = xTickCount + xTicksToDelay;
\ 000012 0F4A MOV.W R10, R15
\ 000014 1F52.... ADD.W &xTickCount, R15
\ 000018 0B4F MOV.W R15, R11
711
712 /* We must remove ourselves from the ready list before adding
713 ourselves to the blocked list as the same list item is used for
714 both lists. */
715 vListRemove( ( xListItem * ) &( pxCurrentTCB->xGenericListItem ) );
\ 00001A 1C42.... MOV.W &pxCurrentTCB, R12
\ 00001E 2C53 ADD.W #0x2, R12
\ 000020 B012.... CALL #vListRemove
716
717 /* The list item will be inserted in wake time order. */
718 listSET_LIST_ITEM_VALUE( &( pxCurrentTCB->xGenericListItem ), xTimeToWake );
\ 000024 1F42.... MOV.W &pxCurrentTCB, R15
\ 000028 8F4B0200 MOV.W R11, 0x2(R15)
719
720 if( xTimeToWake < xTickCount )
\ 00002C 1B92.... CMP.W &xTickCount, R11
\ 000030 082C JC ??vTaskDelay_1
721 {
722 /* Wake time has overflowed. Place this item in the
723 overflow list. */
724 vListInsert( ( xList * ) pxOverflowDelayedTaskList, ( xListItem * ) &( pxCurrentTCB->xGenericListItem ) );
^
Warning[Pa082]: undefined behavior: the order of volatile accesses is
undefined in this statement
\ 000032 1E42.... MOV.W &pxCurrentTCB, R14
\ 000036 2E53 ADD.W #0x2, R14
\ 000038 1C42.... MOV.W &pxOverflowDelayedTaskList, R12
\ 00003C B012.... CALL #vListInsert
\ 000040 073C JMP ??vTaskDelay_2
725 }
726 else
727 {
728 /* The wake time has not overflowed, so we can use the
729 current block list. */
730 vListInsert( ( xList * ) pxDelayedTaskList, ( xListItem * ) &( pxCurrentTCB->xGenericListItem ) );
^
Warning[Pa082]: undefined behavior: the order of volatile accesses is
undefined in this statement
\ ??vTaskDelay_1:
\ 000042 1E42.... MOV.W &pxCurrentTCB, R14
\ 000046 2E53 ADD.W #0x2, R14
\ 000048 1C42.... MOV.W &pxDelayedTaskList, R12
\ 00004C B012.... CALL #vListInsert
731 }
732 }
733 xAlreadyYielded = xTaskResumeAll();
\ ??vTaskDelay_2:
\ 000050 B012.... CALL #xTaskResumeAll
\ 000054 084C MOV.W R12, R8
734 }
735
736 /* Force a reschedule if xTaskResumeAll has not already done so, we may
737 have put ourselves to sleep. */
738 if( !xAlreadyYielded )
\ ??vTaskDelay_0:
\ 000056 0893 CMP.W #0x0, R8
\ 000058 0220 JNE ??vTaskDelay_3
739 {
740 taskYIELD();
\ 00005A B012.... CALL #vPortYield
741 }
742 }
\ ??vTaskDelay_3:
\ 00005E 3040.... BR #?Epilogue3
743
744 #endif
745 /*-----------------------------------------------------------*/
746
747 #if ( INCLUDE_uxTaskPriorityGet == 1 )
748
\ In segment CODE, align 2
749 unsigned portBASE_TYPE uxTaskPriorityGet( xTaskHandle pxTask )
\ uxTaskPriorityGet:
750 {
\ 000000 0F4C MOV.W R12, R15
751 tskTCB *pxTCB;
752 unsigned portBASE_TYPE uxReturn;
753
754 taskENTER_CRITICAL();
\ 000002 32C2 DINT
\ 000004 0343 NOP
\ 000006 9253.... ADD.W #0x1, &usCriticalNesting
755 {
756 /* If null is passed in here then we are changing the
757 priority of the calling function. */
758 pxTCB = prvGetTCBFromHandle( pxTask );
\ 00000A 0F93 CMP.W #0x0, R15
\ 00000C 0320 JNE ??uxTaskPriorityGet_0
\ 00000E 1E42.... MOV.W &pxCurrentTCB, R14
\ 000012 013C JMP ??uxTaskPriorityGet_1
\ ??uxTaskPriorityGet_0:
\ 000014 0E4F MOV.W R15, R14
759 uxReturn = pxTCB->uxPriority;
\ ??uxTaskPriorityGet_1:
\ 000016 1C4E1600 MOV.W 0x16(R14), R12
760 }
761 taskEXIT_CRITICAL();
\ 00001A 8293.... CMP.W #0x0, &usCriticalNesting
\ 00001E 0624 JEQ ??uxTaskPriorityGet_2
\ 000020 B253.... ADD.W #0xffff, &usCriticalNesting
\ 000024 8293.... CMP.W #0x0, &usCriticalNesting
\ 000028 0120 JNE ??uxTaskPriorityGet_2
\ 00002A 32D2 EINT
762
763 return uxReturn;
\ ??uxTaskPriorityGet_2:
\ 00002C 3041 RET
764 }
765
766 #endif
767 /*-----------------------------------------------------------*/
768
769 #if ( INCLUDE_vTaskPrioritySet == 1 )
770
\ In segment CODE, align 2
771 void vTaskPrioritySet( xTaskHandle pxTask, unsigned portBASE_TYPE uxNewPriority )
\ vTaskPrioritySet:
772 {
\ 000000 0A12 PUSH.W R10
\ 000002 0B12 PUSH.W R11
\ 000004 0812 PUSH.W R8
\ 000006 0912 PUSH.W R9
\ 000008 0A4C MOV.W R12, R10
\ 00000A 0B4E MOV.W R14, R11
773 tskTCB *pxTCB;
774 unsigned portBASE_TYPE uxCurrentPriority;
775
776 /* Ensure the new priority is valid. */
777 if( uxNewPriority >= configMAX_PRIORITIES )
\ 00000C 2B92 CMP.W #0x4, R11
\ 00000E 0228 JNC ??vTaskPrioritySet_0
778 {
779 uxNewPriority = configMAX_PRIORITIES - 1;
\ 000010 3B400300 MOV.W #0x3, R11
780 }
781
782 taskENTER_CRITICAL();
\ ??vTaskPrioritySet_0:
\ 000014 32C2 DINT
\ 000016 0343 NOP
\ 000018 9253.... ADD.W #0x1, &usCriticalNesting
783 {
784 /* If null is passed in here then we are changing the
785 priority of the calling function. */
786 pxTCB = prvGetTCBFromHandle( pxTask );
\ 00001C 0A93 CMP.W #0x0, R10
\ 00001E 0320 JNE ??vTaskPrioritySet_1
\ 000020 1942.... MOV.W &pxCurrentTCB, R9
\ 000024 013C JMP ??vTaskPrioritySet_2
\ ??vTaskPrioritySet_1:
\ 000026 094A MOV.W R10, R9
787 uxCurrentPriority = pxTCB->uxPriority;
\ ??vTaskPrioritySet_2:
\ 000028 18491600 MOV.W 0x16(R9), R8
788
789 if( uxCurrentPriority != uxNewPriority )
\ 00002C 089B CMP.W R11, R8
\ 00002E 3224 JEQ ??vTaskPrioritySet_3
790 {
791 pxTCB->uxPriority = uxNewPriority;
\ 000030 894B1600 MOV.W R11, 0x16(R9)
792
793 /* If the task is in the blocked or suspended list we need do
794 nothing more than change it's priority variable. However, if
795 the task is in a ready list it needs to be removed and placed
796 in the queue appropriate to its new priority. */
797 if( listIS_CONTAINED_WITHIN( &( pxReadyTasksLists[ uxCurrentPriority ] ), &( pxTCB->xGenericListItem ) ) )
\ 000034 3E40.... MOV.W #pxReadyTasksLists, R14
\ 000038 0F48 MOV.W R8, R15
\ 00003A 0F5F RLA.W R15
\ 00003C 0D4F MOV.W R15, R13
\ 00003E 0F5F RLA.W R15
\ 000040 0F5F RLA.W R15
\ 000042 0F5D ADD.W R13, R15
\ 000044 0E5F ADD.W R15, R14
\ 000046 899E0A00 CMP.W R14, 0xa(R9)
\ 00004A 2420 JNE ??vTaskPrioritySet_3
798 {
799 if( uxSchedulerSuspended == ( unsigned portBASE_TYPE ) pdFALSE )
\ 00004C 8293.... CMP.W #0x0, &uxSchedulerSuspended
\ 000050 1A20 JNE ??vTaskPrioritySet_4
800 {
801 /* The task is currently in its ready list - remove before adding
802 it to it's new ready list. */
803 vListRemove( &( pxTCB->xGenericListItem ) );
\ 000052 0C49 MOV.W R9, R12
\ 000054 2C53 ADD.W #0x2, R12
\ 000056 B012.... CALL #vListRemove
804 prvAddTaskToReadyQueue( pxTCB );
\
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -