📄 os_task.lst
字号:
\ 000000A4 0200001A BNE ??OSTaskChangePrio_6
97 OS_EXIT_CRITICAL(); /* No, can't change its priority! */
\ 000000A8 ........ _BLF OS_CPU_SR_Restore,??OS_CPU_SR_Restore??rA
98 return (OS_ERR_TASK_NOT_EXIST);
\ 000000AC 4300A0E3 MOV R0,#+67
\ 000000B0 630000EA B ??OSTaskChangePrio_1
99 }
100 #if OS_LOWEST_PRIO <= 63
101 y = (INT8U)(newprio >> 3); /* Yes, compute new TCB fields */
\ ??OSTaskChangePrio_6:
\ 000000B4 FF4014E2 ANDS R4,R4,#0xFF ;; Zero extend
\ 000000B8 A421B0E1 LSRS R2,R4,#+3
102 x = (INT8U)(newprio & 0x07);
\ 000000BC 073014E2 ANDS R3,R4,#0x7
103 bity = (INT8U)(1 << y);
\ 000000C0 0160A0E3 MOV R6,#+1
\ 000000C4 16C2B0E1 LSLS R12,R6,R2
104 bitx = (INT8U)(1 << x);
\ 000000C8 0160A0E3 MOV R6,#+1
\ 000000CC 16E3B0E1 LSLS LR,R6,R3
105 #else
106 y = (INT8U)((newprio >> 4) & 0x0F);
107 x = (INT8U)( newprio & 0x0F);
108 bity = (INT16U)(1 << y);
109 bitx = (INT16U)(1 << x);
110 #endif
111
112 OSTCBPrioTbl[oldprio] = (OS_TCB *)0; /* Remove TCB from old priority */
\ 000000D0 0460A0E3 MOV R6,#+4
\ 000000D4 ........ LDR R7,??DataTable59 ;; OSTCBPrioTbl
\ 000000D8 967525E0 MLA R5,R6,R5,R7
\ 000000DC 0060A0E3 MOV R6,#+0
\ 000000E0 006085E5 STR R6,[R5, #+0]
113 OSTCBPrioTbl[newprio] = ptcb; /* Place pointer to TCB @ new priority */
\ 000000E4 0450B0E1 MOVS R5,R4
\ 000000E8 0460A0E3 MOV R6,#+4
\ 000000EC ........ LDR R7,??DataTable59 ;; OSTCBPrioTbl
\ 000000F0 967525E0 MLA R5,R6,R5,R7
\ 000000F4 001085E5 STR R1,[R5, #+0]
114 y_old = ptcb->OSTCBY;
\ 000000F8 3050D1E5 LDRB R5,[R1, #+48]
115 if ((OSRdyTbl[y_old] & ptcb->OSTCBBitX) != 0) { /* If task is ready make it not */
\ 000000FC 0560B0E1 MOVS R6,R5
\ 00000100 ........ LDR R7,??DataTable55 ;; OSRdyTbl
\ 00000104 0760D6E7 LDRB R6,[R6, +R7]
\ 00000108 3170D1E5 LDRB R7,[R1, #+49]
\ 0000010C 060017E1 TST R7,R6
\ 00000110 2000000A BEQ ??OSTaskChangePrio_7
116 OSRdyTbl[y_old] &= ~ptcb->OSTCBBitX;
\ 00000114 0560B0E1 MOVS R6,R5
\ 00000118 ........ LDR R7,??DataTable55 ;; OSRdyTbl
\ 0000011C 0580B0E1 MOVS R8,R5
\ 00000120 ........ LDR R9,??DataTable55 ;; OSRdyTbl
\ 00000124 0980D8E7 LDRB R8,[R8, +R9]
\ 00000128 3190D1E5 LDRB R9,[R1, #+49]
\ 0000012C 0980D8E1 BICS R8,R8,R9
\ 00000130 0780C6E7 STRB R8,[R6, +R7]
117 if (OSRdyTbl[y_old] == 0) {
\ 00000134 0560B0E1 MOVS R6,R5
\ 00000138 ........ LDR R7,??DataTable55 ;; OSRdyTbl
\ 0000013C 0760D6E7 LDRB R6,[R6, +R7]
\ 00000140 000056E3 CMP R6,#+0
\ 00000144 0500001A BNE ??OSTaskChangePrio_8
118 OSRdyGrp &= ~ptcb->OSTCBBitY;
\ 00000148 ........ LDR R6,??DataTable57 ;; OSRdyGrp
\ 0000014C ........ LDR R7,??DataTable57 ;; OSRdyGrp
\ 00000150 0070D7E5 LDRB R7,[R7, #+0]
\ 00000154 3280D1E5 LDRB R8,[R1, #+50]
\ 00000158 0870D7E1 BICS R7,R7,R8
\ 0000015C 0070C6E5 STRB R7,[R6, #+0]
119 }
120 OSRdyGrp |= bity; /* Make new priority ready to run */
\ ??OSTaskChangePrio_8:
\ 00000160 ........ LDR R6,??DataTable57 ;; OSRdyGrp
\ 00000164 ........ LDR R7,??DataTable57 ;; OSRdyGrp
\ 00000168 0070D7E5 LDRB R7,[R7, #+0]
\ 0000016C 07709CE1 ORRS R7,R12,R7
\ 00000170 0070C6E5 STRB R7,[R6, #+0]
121 OSRdyTbl[y] |= bitx;
\ 00000174 0260B0E1 MOVS R6,R2
\ 00000178 FF6016E2 ANDS R6,R6,#0xFF ;; Zero extend
\ 0000017C ........ LDR R7,??DataTable55 ;; OSRdyTbl
\ 00000180 0280B0E1 MOVS R8,R2
\ 00000184 FF8018E2 ANDS R8,R8,#0xFF ;; Zero extend
\ 00000188 ........ LDR R9,??DataTable55 ;; OSRdyTbl
\ 0000018C 0980D8E7 LDRB R8,[R8, +R9]
\ 00000190 08809EE1 ORRS R8,LR,R8
\ 00000194 0780C6E7 STRB R8,[R6, +R7]
122 }
123 #if OS_EVENT_EN
124 pevent = ptcb->OSTCBEventPtr;
\ ??OSTaskChangePrio_7:
\ 00000198 1C6091E5 LDR R6,[R1, #+28]
125 if (pevent != (OS_EVENT *)0) { /* ... remove from event wait list */
\ 0000019C 000056E3 CMP R6,#+0
\ 000001A0 1B00000A BEQ ??OSTaskChangePrio_9
126 pevent->OSEventTbl[y_old] &= ~ptcb->OSTCBBitX;
\ 000001A4 0570B0E1 MOVS R7,R5
\ 000001A8 067097E0 ADDS R7,R7,R6
\ 000001AC 0580B0E1 MOVS R8,R5
\ 000001B0 068098E0 ADDS R8,R8,R6
\ 000001B4 0B80D8E5 LDRB R8,[R8, #+11]
\ 000001B8 3190D1E5 LDRB R9,[R1, #+49]
\ 000001BC 0980D8E1 BICS R8,R8,R9
\ 000001C0 0B80C7E5 STRB R8,[R7, #+11]
127 if (pevent->OSEventTbl[y_old] == 0) {
\ 000001C4 065095E0 ADDS R5,R5,R6
\ 000001C8 0B50D5E5 LDRB R5,[R5, #+11]
\ 000001CC 000055E3 CMP R5,#+0
\ 000001D0 0300001A BNE ??OSTaskChangePrio_10
128 pevent->OSEventGrp &= ~ptcb->OSTCBBitY;
\ 000001D4 0A50D6E5 LDRB R5,[R6, #+10]
\ 000001D8 3270D1E5 LDRB R7,[R1, #+50]
\ 000001DC 0750D5E1 BICS R5,R5,R7
\ 000001E0 0A50C6E5 STRB R5,[R6, #+10]
129 }
130 pevent->OSEventGrp |= bity; /* Add new priority to wait list */
\ ??OSTaskChangePrio_10:
\ 000001E4 0A50D6E5 LDRB R5,[R6, #+10]
\ 000001E8 05509CE1 ORRS R5,R12,R5
\ 000001EC 0A50C6E5 STRB R5,[R6, #+10]
131 pevent->OSEventTbl[y] |= bitx;
\ 000001F0 0250B0E1 MOVS R5,R2
\ 000001F4 FF5015E2 ANDS R5,R5,#0xFF ;; Zero extend
\ 000001F8 065095E0 ADDS R5,R5,R6
\ 000001FC 0270B0E1 MOVS R7,R2
\ 00000200 FF7017E2 ANDS R7,R7,#0xFF ;; Zero extend
\ 00000204 066097E0 ADDS R6,R7,R6
\ 00000208 0B60D6E5 LDRB R6,[R6, #+11]
\ 0000020C 06609EE1 ORRS R6,LR,R6
\ 00000210 0B60C5E5 STRB R6,[R5, #+11]
132 }
133 #endif
134 ptcb->OSTCBPrio = newprio; /* Set new task priority */
\ ??OSTaskChangePrio_9:
\ 00000214 2E40C1E5 STRB R4,[R1, #+46]
135 ptcb->OSTCBY = y;
\ 00000218 3020C1E5 STRB R2,[R1, #+48]
136 ptcb->OSTCBX = x;
\ 0000021C 2F30C1E5 STRB R3,[R1, #+47]
137 ptcb->OSTCBBitY = bity;
\ 00000220 32C0C1E5 STRB R12,[R1, #+50]
138 ptcb->OSTCBBitX = bitx;
\ 00000224 31E0C1E5 STRB LR,[R1, #+49]
139 OS_EXIT_CRITICAL();
\ 00000228 ........ _BLF OS_CPU_SR_Restore,??OS_CPU_SR_Restore??rA
140 if (OSRunning == OS_TRUE) {
\ 0000022C ........ LDR R0,??DataTable47 ;; OSRunning
\ 00000230 0000D0E5 LDRB R0,[R0, #+0]
\ 00000234 010050E3 CMP R0,#+1
\ 00000238 0000001A BNE ??OSTaskChangePrio_11
141 OS_Sched(); /* Find new highest priority task */
\ 0000023C ........ _BLF OS_Sched,??OS_Sched??rA
142 }
143 return (OS_ERR_NONE);
\ ??OSTaskChangePrio_11:
\ 00000240 0000A0E3 MOV R0,#+0
\ ??OSTaskChangePrio_1:
\ 00000244 F083BDE8 POP {R4-R9,PC} ;; return
144 }
145 #endif
146 /*$PAGE*/
147 /*
148 *********************************************************************************************************
149 * CREATE A TASK
150 *
151 * Description: This function is used to have uC/OS-II manage the execution of a task. Tasks can either
152 * be created prior to the start of multitasking or by a running task. A task cannot be
153 * created by an ISR.
154 *
155 * Arguments : task is a pointer to the task's code
156 *
157 * p_arg is a pointer to an optional data area which can be used to pass parameters to
158 * the task when the task first executes. Where the task is concerned it thinks
159 * it was invoked and passed the argument 'p_arg' as follows:
160 *
161 * void Task (void *p_arg)
162 * {
163 * for (;;) {
164 * Task code;
165 * }
166 * }
167 *
168 * ptos is a pointer to the task's top of stack. If the configuration constant
169 * OS_STK_GROWTH is set to 1, the stack is assumed to grow downward (i.e. from high
170 * memory to low memory). 'pstk' will thus point to the highest (valid) memory
171 * location of the stack. If OS_STK_GROWTH is set to 0, 'pstk' will point to the
172 * lowest memory location of the stack and the stack will grow with increasing
173 * memory locations.
174 *
175 * prio is the task's priority. A unique priority MUST be assigned to each task and the
176 * lower the number, the higher the priority.
177 *
178 * Returns : OS_ERR_NONE if the function was successful.
179 * OS_PRIO_EXIT if the task priority already exist
180 * (each task MUST have a unique priority).
181 * OS_ERR_PRIO_INVALID if the priority you specify is higher that the maximum allowed
182 * (i.e. >= OS_LOWEST_PRIO)
183 * OS_ERR_TASK_CREATE_ISR if you tried to create a task from an ISR.
184 *********************************************************************************************************
185 */
186
187 #if OS_TASK_CREATE_EN > 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -