📄 tasks.s43
字号:
// 761 taskEXIT_CRITICAL();
CMP.W #0x0, &usCriticalNesting
JEQ ??uxTaskPriorityGet_2
ADD.W #0xffff, &usCriticalNesting
CMP.W #0x0, &usCriticalNesting
JNE ??uxTaskPriorityGet_2
EINT
// 762
// 763 return uxReturn;
??uxTaskPriorityGet_2:
RET
CFI EndBlock cfiBlock4
// 764 }
// 765
// 766 #endif
// 767 /*-----------------------------------------------------------*/
// 768
// 769 #if ( INCLUDE_vTaskPrioritySet == 1 )
// 770
RSEG CODE:CODE:REORDER:NOROOT(1)
// 771 void vTaskPrioritySet( xTaskHandle pxTask, unsigned portBASE_TYPE uxNewPriority )
vTaskPrioritySet:
CFI Block cfiBlock5 Using cfiCommon0
CFI Function vTaskPrioritySet
// 772 {
FUNCALL vTaskPrioritySet, vListRemove
LOCFRAME CSTACK, 10, STACK
FUNCALL vTaskPrioritySet, vListInsertEnd
LOCFRAME CSTACK, 10, STACK
FUNCALL vTaskPrioritySet, vListInsertEnd
LOCFRAME CSTACK, 10, STACK
FUNCALL vTaskPrioritySet, vPortYield
LOCFRAME CSTACK, 10, STACK
PUSH.W R10
CFI R10 Frame(CFA, -4)
CFI CFA SP+4
PUSH.W R11
CFI R11 Frame(CFA, -6)
CFI CFA SP+6
PUSH.W R8
CFI R8 Frame(CFA, -8)
CFI CFA SP+8
PUSH.W R9
CFI R9 Frame(CFA, -10)
CFI CFA SP+10
MOV.W R12, R10
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 )
CMP.W #0x4, R11
JNC ??vTaskPrioritySet_0
// 778 {
// 779 uxNewPriority = configMAX_PRIORITIES - 1;
MOV.W #0x3, R11
// 780 }
// 781
// 782 taskENTER_CRITICAL();
??vTaskPrioritySet_0:
DINT
NOP
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 );
CMP.W #0x0, R10
JNE ??vTaskPrioritySet_1
MOV.W &pxCurrentTCB, R9
JMP ??vTaskPrioritySet_2
??vTaskPrioritySet_1:
MOV.W R10, R9
// 787 uxCurrentPriority = pxTCB->uxPriority;
??vTaskPrioritySet_2:
MOV.W 0x16(R9), R8
// 788
// 789 if( uxCurrentPriority != uxNewPriority )
CMP.W R11, R8
JEQ ??vTaskPrioritySet_3
// 790 {
// 791 pxTCB->uxPriority = uxNewPriority;
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 ) ) )
MOV.W #pxReadyTasksLists, R14
MOV.W R8, R15
RLA.W R15
MOV.W R15, R13
RLA.W R15
RLA.W R15
ADD.W R13, R15
ADD.W R15, R14
CMP.W R14, 0xa(R9)
JNE ??vTaskPrioritySet_3
// 798 {
// 799 if( uxSchedulerSuspended == ( unsigned portBASE_TYPE ) pdFALSE )
CMP.W #0x0, &uxSchedulerSuspended
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 ) );
MOV.W R9, R12
ADD.W #0x2, R12
CALL #vListRemove
// 804 prvAddTaskToReadyQueue( pxTCB );
CMP.W 0x16(R9), &uxTopReadyPriority
JC ??vTaskPrioritySet_5
MOV.W 0x16(R9), &uxTopReadyPriority
??vTaskPrioritySet_5:
MOV.W R9, R14
ADD.W #0x2, R14
MOV.W #pxReadyTasksLists, R12
MOV.W 0x16(R9), R15
RLA.W R15
MOV.W R15, R13
RLA.W R15
RLA.W R15
ADD.W R13, R15
ADD.W R15, R12
CALL #vListInsertEnd
JMP ??vTaskPrioritySet_3
// 805 }
// 806 else
// 807 {
// 808 /* We cannot access the delayed or ready lists, so will hold this
// 809 task pending until the scheduler is resumed. */
// 810 vListInsertEnd( ( xList * ) &( xPendingReadyList ), &( pxTCB->xEventListItem ) );
??vTaskPrioritySet_4:
MOV.W R9, R14
ADD.W #0xc, R14
MOV.W #xPendingReadyList, R12
CALL #vListInsertEnd
// 811 }
// 812 }
// 813 }
// 814 }
// 815 taskEXIT_CRITICAL();
??vTaskPrioritySet_3:
CMP.W #0x0, &usCriticalNesting
JEQ ??vTaskPrioritySet_6
ADD.W #0xffff, &usCriticalNesting
CMP.W #0x0, &usCriticalNesting
JNE ??vTaskPrioritySet_6
EINT
// 816
// 817 /* The priority change may have readied a task of higher
// 818 priority than the calling task. */
// 819 taskYIELD();
??vTaskPrioritySet_6:
CALL #vPortYield
// 820 }
BR #?Epilogue4
CFI EndBlock cfiBlock5
// 821
// 822 #endif
// 823 /*-----------------------------------------------------------*/
// 824
// 825 #if ( INCLUDE_vTaskSuspend == 1 )
// 826
RSEG CODE:CODE:REORDER:NOROOT(1)
// 827 void vTaskSuspend( xTaskHandle pxTaskToSuspend )
vTaskSuspend:
CFI Block cfiBlock6 Using cfiCommon0
CFI Function vTaskSuspend
// 828 {
FUNCALL vTaskSuspend, vListRemove
LOCFRAME CSTACK, 6, STACK
FUNCALL vTaskSuspend, vListRemove
LOCFRAME CSTACK, 6, STACK
FUNCALL vTaskSuspend, vListInsertEnd
LOCFRAME CSTACK, 6, STACK
FUNCALL vTaskSuspend, vPortYield
LOCFRAME CSTACK, 6, STACK
PUSH.W R10
CFI R10 Frame(CFA, -4)
CFI CFA SP+4
PUSH.W R11
CFI R11 Frame(CFA, -6)
CFI CFA SP+6
MOV.W R12, R10
// 829 tskTCB *pxTCB;
// 830
// 831 taskENTER_CRITICAL();
DINT
NOP
ADD.W #0x1, &usCriticalNesting
// 832 {
// 833 /* If null is passed in here then we are suspending ourselves. */
// 834 pxTCB = prvGetTCBFromHandle( pxTaskToSuspend );
CMP.W #0x0, R10
JNE ??vTaskSuspend_0
MOV.W &pxCurrentTCB, R11
JMP ??vTaskSuspend_1
??vTaskSuspend_0:
MOV.W R10, R11
// 835
// 836 /* Remove task from the ready/delayed list and place in the suspended list. */
// 837 vListRemove( &( pxTCB->xGenericListItem ) );
??vTaskSuspend_1:
MOV.W R11, R12
ADD.W #0x2, R12
CALL #vListRemove
// 838
// 839 /* Is the task waiting on an event also? */
// 840 if( pxTCB->xEventListItem.pvContainer )
CMP.W #0x0, 0x14(R11)
JEQ ??vTaskSuspend_2
// 841 {
// 842 vListRemove( &( pxTCB->xEventListItem ) );
MOV.W R11, R12
ADD.W #0xc, R12
CALL #vListRemove
// 843 }
// 844
// 845 vListInsertEnd( ( xList * ) &xSuspendedTaskList, &( pxTCB->xGenericListItem ) );
??vTaskSuspend_2:
MOV.W R11, R14
ADD.W #0x2, R14
MOV.W #xSuspendedTaskList, R12
CALL #vListInsertEnd
// 846 }
// 847 taskEXIT_CRITICAL();
CMP.W #0x0, &usCriticalNesting
JEQ ??vTaskSuspend_3
ADD.W #0xffff, &usCriticalNesting
CMP.W #0x0, &usCriticalNesting
JNE ??vTaskSuspend_3
EINT
// 848
// 849 /* We may have just suspended the current task. */
// 850 if( ( void * ) pxTaskToSuspend == NULL )
??vTaskSuspend_3:
CMP.W #0x0, R10
JNE ??vTaskSuspend_4
// 851 {
// 852 taskYIELD();
CALL #vPortYield
// 853 }
// 854 }
??vTaskSuspend_4:
POP.W R11
CFI R11 SameValue
CFI CFA SP+4
POP.W R10
CFI R10 SameValue
CFI CFA SP+2
RET
CFI EndBlock cfiBlock6
// 855
// 856 #endif
// 857 /*-----------------------------------------------------------*/
// 858
// 859 #if ( INCLUDE_vTaskSuspend == 1 )
// 860
RSEG CODE:CODE:REORDER:NOROOT(1)
// 861 void vTaskResume( xTaskHandle pxTaskToResume )
vTaskResume:
CFI Block cfiBlock7 Using cfiCommon0
CFI Function vTaskResume
// 862 {
FUNCALL vTaskResume, vListRemove
LOCFRAME CSTACK, 8, STACK
FUNCALL vTaskResume, vListInsertEnd
LOCFRAME CSTACK, 8, STACK
FUNCALL vTaskResume, vListInsertEnd
LOCFRAME CSTACK, 8, STACK
FUNCALL vTaskResume, vPortYield
LOCFRAME CSTACK, 8, STACK
PUSH.W R10
CFI R10 Frame(CFA, -4)
CFI CFA SP+4
PUSH.W R11
CFI R11 Frame(CFA, -6)
CFI CFA SP+6
PUSH.W R8
CFI R8 Frame(CFA, -8)
CFI CFA SP+8
MOV.W R12, R11
// 863 tskTCB *pxTCB;
// 864 portBASE_TYPE xYieldRequired;
// 865
// 866 /* Remove the task from whichever list it is currently in, and place
// 867 it in the ready list. */
// 868 pxTCB = ( tskTCB * ) pxTaskToResume;
MOV.W R11, R8
// 869
// 870 /* The parameter cannot be NULL as it is impossible to resume the
// 871 currently executing task. */
// 872 if( pxTCB != NULL )
CMP.W #0x0, R8
JEQ ??vTaskResume_0
// 873 {
// 874 taskENTER_CRITICAL();
DINT
NOP
ADD.W #0x1, &usCriticalNesting
// 875 {
// 876 if( uxSchedulerSuspended == ( unsigned portBASE_TYPE ) pdFALSE )
CMP.W #0x0, &uxSchedulerSuspended
JNE ??vTaskResume_1
// 877 {
// 878 xYieldRequired = ( pxTCB->uxPriority >= pxCurrentTCB->uxPriority );
MOV.W &pxCurrentTCB, R15
CMP.W 0x16(R15), 0x16(R8)
JNC ??vTaskResume_2
MOV.B #0x1, R10
JMP ??vTaskResume_3
??vTaskResume_2:
MOV.B #0x0, R10
??vTaskResume_3:
AND.W #0xff, R10
// 879 vListRemove( &( pxTCB->xGenericListItem ) );
MOV.W R8, R12
ADD.W #0x2, R12
CALL #vListRemove
// 880 prvAddTaskToReadyQueue( pxTCB );
CMP.W 0x16(R8), &uxTopReadyPriority
JC ??vTaskResume_4
MOV.W 0x16(R8), &uxTopReadyPriority
??vTaskResume_4:
MOV.W R8, R14
ADD.W #0x2, R14
MOV.W #pxReadyTasksLists, R12
MOV.W 0x16(R8), R15
RLA.W R15
MOV.W R15, R13
RLA.W R15
RLA.W R15
ADD.W R13, R15
ADD.W R15, R12
CALL #vListInsertEnd
JMP ??vTaskResume_5
// 881 }
// 882 else
// 883 {
// 884 /* We cannot access the delayed or ready lists, so will hold this
// 885 task pending until the scheduler is resumed. */
// 886 xYieldRequired = pdFALSE;
??vTaskResume_1:
MOV.W #0x0, R10
// 887 vListInsertEnd( ( xList * )
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -