📄 os_task.lst
字号:
\ 000000F0 0090B0E1 MOVS R9,R0
104 bitx = (INT8U)(1 << x);
\ 000000F4 0110A0E3 MOV R1,#+1
\ 000000F8 D120DDE1 LDRSB R2,[SP, #+1]
\ 000000FC 1112B0E1 LSLS R1,R1,R2
\ 00000100 0010CDE5 STRB R1,[SP, #+0]
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 */
\ 00000104 0400B0E1 MOVS R0,R4
\ 00000108 0410A0E3 MOV R1,#+4
\ 0000010C ........ LDR R2,??DataTable52 ;; OSTCBPrioTbl
\ 00000110 912020E0 MLA R0,R1,R0,R2
\ 00000114 0010A0E3 MOV R1,#+0
\ 00000118 001080E5 STR R1,[R0, #+0]
113 OSTCBPrioTbl[newprio] = ptcb; /* Place pointer to TCB @ new priority */
\ 0000011C 0500B0E1 MOVS R0,R5
\ 00000120 0410A0E3 MOV R1,#+4
\ 00000124 ........ LDR R2,??DataTable52 ;; OSTCBPrioTbl
\ 00000128 912020E0 MLA R0,R1,R0,R2
\ 0000012C 007080E5 STR R7,[R0, #+0]
114 y_old = ptcb->OSTCBY;
\ 00000130 3000D7E5 LDRB R0,[R7, #+48]
\ 00000134 00A0B0E1 MOVS R10,R0
115 if ((OSRdyTbl[y_old] & ptcb->OSTCBBitX) != 0) { /* If task is ready make it not */
\ 00000138 0A00B0E1 MOVS R0,R10
\ 0000013C ........ LDR R1,??DataTable55 ;; OSRdyTbl
\ 00000140 0100D0E7 LDRB R0,[R0, +R1]
\ 00000144 3110D7E5 LDRB R1,[R7, #+49]
\ 00000148 000011E1 TST R1,R0
\ 0000014C 2100000A BEQ ??OSTaskChangePrio_7
116 OSRdyTbl[y_old] &= ~ptcb->OSTCBBitX;
\ 00000150 0A00B0E1 MOVS R0,R10
\ 00000154 ........ LDR R1,??DataTable55 ;; OSRdyTbl
\ 00000158 0A20B0E1 MOVS R2,R10
\ 0000015C ........ LDR R3,??DataTable55 ;; OSRdyTbl
\ 00000160 0320D2E7 LDRB R2,[R2, +R3]
\ 00000164 3130D7E5 LDRB R3,[R7, #+49]
\ 00000168 0320D2E1 BICS R2,R2,R3
\ 0000016C 0120C0E7 STRB R2,[R0, +R1]
117 if (OSRdyTbl[y_old] == 0) {
\ 00000170 0A00B0E1 MOVS R0,R10
\ 00000174 ........ LDR R1,??DataTable55 ;; OSRdyTbl
\ 00000178 0100D0E7 LDRB R0,[R0, +R1]
\ 0000017C 000050E3 CMP R0,#+0
\ 00000180 0500001A BNE ??OSTaskChangePrio_8
118 OSRdyGrp &= ~ptcb->OSTCBBitY;
\ 00000184 ........ LDR R0,??DataTable57 ;; OSRdyGrp
\ 00000188 ........ LDR R1,??DataTable57 ;; OSRdyGrp
\ 0000018C 0010D1E5 LDRB R1,[R1, #+0]
\ 00000190 3220D7E5 LDRB R2,[R7, #+50]
\ 00000194 0210D1E1 BICS R1,R1,R2
\ 00000198 0010C0E5 STRB R1,[R0, #+0]
119 }
120 OSRdyGrp |= bity; /* Make new priority ready to run */
\ ??OSTaskChangePrio_8:
\ 0000019C ........ LDR R0,??DataTable57 ;; OSRdyGrp
\ 000001A0 ........ LDR R1,??DataTable57 ;; OSRdyGrp
\ 000001A4 0010D1E5 LDRB R1,[R1, #+0]
\ 000001A8 011099E1 ORRS R1,R9,R1
\ 000001AC 0010C0E5 STRB R1,[R0, #+0]
121 OSRdyTbl[y] |= bitx;
\ 000001B0 0800B0E1 MOVS R0,R8
\ 000001B4 FF0010E2 ANDS R0,R0,#0xFF ;; Zero extend
\ 000001B8 ........ LDR R1,??DataTable55 ;; OSRdyTbl
\ 000001BC 0820B0E1 MOVS R2,R8
\ 000001C0 FF2012E2 ANDS R2,R2,#0xFF ;; Zero extend
\ 000001C4 ........ LDR R3,??DataTable55 ;; OSRdyTbl
\ 000001C8 0320D2E7 LDRB R2,[R2, +R3]
\ 000001CC 0030DDE5 LDRB R3,[SP, #+0]
\ 000001D0 022093E1 ORRS R2,R3,R2
\ 000001D4 0120C0E7 STRB R2,[R0, +R1]
122 }
123 #if OS_EVENT_EN
124 pevent = ptcb->OSTCBEventPtr;
\ ??OSTaskChangePrio_7:
\ 000001D8 1C0097E5 LDR R0,[R7, #+28]
\ 000001DC 0060B0E1 MOVS R6,R0
125 if (pevent != (OS_EVENT *)0) { /* ... remove from event wait list */
\ 000001E0 000056E3 CMP R6,#+0
\ 000001E4 1D00000A BEQ ??OSTaskChangePrio_9
126 pevent->OSEventTbl[y_old] &= ~ptcb->OSTCBBitX;
\ 000001E8 0A00B0E1 MOVS R0,R10
\ 000001EC 060090E0 ADDS R0,R0,R6
\ 000001F0 0A10B0E1 MOVS R1,R10
\ 000001F4 061091E0 ADDS R1,R1,R6
\ 000001F8 0B10D1E5 LDRB R1,[R1, #+11]
\ 000001FC 3120D7E5 LDRB R2,[R7, #+49]
\ 00000200 0210D1E1 BICS R1,R1,R2
\ 00000204 0B10C0E5 STRB R1,[R0, #+11]
127 if (pevent->OSEventTbl[y_old] == 0) {
\ 00000208 0A00B0E1 MOVS R0,R10
\ 0000020C 060090E0 ADDS R0,R0,R6
\ 00000210 0B00D0E5 LDRB R0,[R0, #+11]
\ 00000214 000050E3 CMP R0,#+0
\ 00000218 0300001A BNE ??OSTaskChangePrio_10
128 pevent->OSEventGrp &= ~ptcb->OSTCBBitY;
\ 0000021C 0A00D6E5 LDRB R0,[R6, #+10]
\ 00000220 3210D7E5 LDRB R1,[R7, #+50]
\ 00000224 0100D0E1 BICS R0,R0,R1
\ 00000228 0A00C6E5 STRB R0,[R6, #+10]
129 }
130 pevent->OSEventGrp |= bity; /* Add new priority to wait list */
\ ??OSTaskChangePrio_10:
\ 0000022C 0A00D6E5 LDRB R0,[R6, #+10]
\ 00000230 000099E1 ORRS R0,R9,R0
\ 00000234 0A00C6E5 STRB R0,[R6, #+10]
131 pevent->OSEventTbl[y] |= bitx;
\ 00000238 0800B0E1 MOVS R0,R8
\ 0000023C FF0010E2 ANDS R0,R0,#0xFF ;; Zero extend
\ 00000240 060090E0 ADDS R0,R0,R6
\ 00000244 0810B0E1 MOVS R1,R8
\ 00000248 FF1011E2 ANDS R1,R1,#0xFF ;; Zero extend
\ 0000024C 061091E0 ADDS R1,R1,R6
\ 00000250 0B10D1E5 LDRB R1,[R1, #+11]
\ 00000254 0020DDE5 LDRB R2,[SP, #+0]
\ 00000258 011092E1 ORRS R1,R2,R1
\ 0000025C 0B10C0E5 STRB R1,[R0, #+11]
132 }
133 #endif
134 ptcb->OSTCBPrio = newprio; /* Set new task priority */
\ ??OSTaskChangePrio_9:
\ 00000260 2E50C7E5 STRB R5,[R7, #+46]
135 ptcb->OSTCBY = y;
\ 00000264 3080C7E5 STRB R8,[R7, #+48]
136 ptcb->OSTCBX = x;
\ 00000268 0100DDE5 LDRB R0,[SP, #+1]
\ 0000026C 2F00C7E5 STRB R0,[R7, #+47]
137 ptcb->OSTCBBitY = bity;
\ 00000270 3290C7E5 STRB R9,[R7, #+50]
138 ptcb->OSTCBBitX = bitx;
\ 00000274 0000DDE5 LDRB R0,[SP, #+0]
\ 00000278 3100C7E5 STRB R0,[R7, #+49]
139 OS_EXIT_CRITICAL();
\ 0000027C 0B00B0E1 MOVS R0,R11
\ 00000280 ........ _BLF OS_CPU_SR_Restore,??OS_CPU_SR_Restore??rA
140 if (OSRunning == OS_TRUE) {
\ 00000284 ........ LDR R0,??DataTable47 ;; OSRunning
\ 00000288 0000D0E5 LDRB R0,[R0, #+0]
\ 0000028C 010050E3 CMP R0,#+1
\ 00000290 0000001A BNE ??OSTaskChangePrio_11
141 OS_Sched(); /* Find new highest priority task */
\ 00000294 ........ _BLF OS_Sched,??OS_Sched??rA
142 }
143 return (OS_ERR_NONE);
\ ??OSTaskChangePrio_11:
\ 00000298 0000A0E3 MOV R0,#+0
\ ??OSTaskChangePrio_1:
\ 0000029C 04D08DE2 ADD SP,SP,#+4 ;; stack cleaning
\ 000002A0 F08FBDE8 POP {R4-R11,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
\ In segment CODE, align 4, keep-with-next
188 INT8U OSTaskCreate (void (*task)(void *p_arg), void *p_arg, OS_STK *ptos, INT8U prio)
189 {
\ OSTaskCreate:
\ 00000000 F0472DE9 PUSH {R4-R10,LR}
\ 00000004 0040B0E1 MOVS R4,R0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -