os_task.lst
来自「atmega单片机用的ucos系统 占用内存适中 是atmega单片机合适的操作」· LST 代码 · 共 1,070 行 · 第 1/5 页
LST
1,070 行
116 0022 90E0 ldi r25,hi8(42)
117 0024 4AC0 rjmp .L1
118 .L2:
180:OSsrc/os_task.c **** }
181:OSsrc/os_task.c **** #endif
182:OSsrc/os_task.c **** OS_ENTER_CRITICAL();
120 .LM4:
121 /* #APP */
122 0026 0FB6 in __tmp_reg__,__SREG__
123 0028 F894 cli
124 002a 0F92 push __tmp_reg__
183:OSsrc/os_task.c **** if (OSIntNesting > 0) { /* Make sure we don't create the task from within an I
126 .LM5:
127 /* #NOAPP */
128 002c 8091 0000 lds r24,OSIntNesting
129 0030 8823 tst r24
130 0032 29F0 breq .L3
184:OSsrc/os_task.c **** OS_EXIT_CRITICAL();
132 .LM6:
133 /* #APP */
134 0034 0F90 pop __tmp_reg__
135 0036 0FBE out __SREG__,__tmp_reg__
185:OSsrc/os_task.c **** return (OS_ERR_TASK_CREATE_ISR);
137 .LM7:
138 /* #NOAPP */
139 0038 80E1 ldi r24,lo8(16)
140 003a 90E0 ldi r25,hi8(16)
141 003c 3EC0 rjmp .L1
142 .L3:
186:OSsrc/os_task.c **** }
187:OSsrc/os_task.c **** if (OSTCBPrioTbl[prio] == (OS_TCB *)0) { /* Make sure task doesn't already exist at this priori
144 .LM8:
145 003e C22F mov r28,r18
146 0040 DD27 clr r29
147 0042 FE01 movw r30,r28
148 0044 EC0F add r30,r28
149 0046 FD1F adc r31,r29
150 0048 E050 subi r30,lo8(-(OSTCBPrioTbl))
151 004a F040 sbci r31,hi8(-(OSTCBPrioTbl))
152 004c 8081 ld r24,Z
153 004e 9181 ldd r25,Z+1
154 0050 892B or r24,r25
155 0052 79F5 brne .L4
188:OSsrc/os_task.c **** OSTCBPrioTbl[prio] = (OS_TCB *)1; /* Reserve the priority to prevent others from doing .
157 .LM9:
158 0054 81E0 ldi r24,lo8(1)
159 0056 90E0 ldi r25,hi8(1)
160 0058 8083 st Z,r24
161 005a 9183 std Z+1,r25
189:OSsrc/os_task.c **** /* ... the same thing until task is created.
190:OSsrc/os_task.c **** OS_EXIT_CRITICAL();
163 .LM10:
164 /* #APP */
165 005c 0F90 pop __tmp_reg__
166 005e 0FBE out __SREG__,__tmp_reg__
191:OSsrc/os_task.c **** psp = (OS_STK *)OSTaskStkInit(task, p_arg, ptos, 0); /* Initialize the task's stack
168 .LM11:
169 /* #NOAPP */
170 0060 20E0 ldi r18,lo8(0)
171 0062 30E0 ldi r19,hi8(0)
172 0064 CD01 movw r24,r26
173 0066 0E94 0000 call OSTaskStkInit
192:OSsrc/os_task.c **** err = OS_TCBInit(prio, psp, (OS_STK *)0, 0, 0, (void *)0, 0);
175 .LM12:
176 006a AA24 clr r10
177 006c BB24 clr r11
178 006e 6501 movw r12,r10
179 0070 EE24 clr r14
180 0072 FF24 clr r15
181 0074 8701 movw r16,r14
182 0076 9501 movw r18,r10
183 0078 A501 movw r20,r10
184 007a BC01 movw r22,r24
185 007c 892D mov r24,r9
186 007e 0E94 0000 call OS_TCBInit
187 0082 182F mov r17,r24
193:OSsrc/os_task.c **** if (err == OS_NO_ERR) {
189 .LM13:
190 0084 8823 tst r24
191 0086 39F4 brne .L5
194:OSsrc/os_task.c **** if (OSRunning == TRUE) { /* Find highest priority task if multitasking has star
193 .LM14:
194 0088 8091 0000 lds r24,OSRunning
195 008c 8130 cpi r24,lo8(1)
196 008e 71F4 brne .L7
195:OSsrc/os_task.c **** OS_Sched();
198 .LM15:
199 0090 0E94 0000 call OS_Sched
200 0094 0BC0 rjmp .L7
201 .L5:
196:OSsrc/os_task.c **** }
197:OSsrc/os_task.c **** } else {
198:OSsrc/os_task.c **** OS_ENTER_CRITICAL();
203 .LM16:
204 /* #APP */
205 0096 0FB6 in __tmp_reg__,__SREG__
206 0098 F894 cli
207 009a 0F92 push __tmp_reg__
199:OSsrc/os_task.c **** OSTCBPrioTbl[prio] = (OS_TCB *)0;/* Make this priority available to others
209 .LM17:
210 /* #NOAPP */
211 009c CC0F add r28,r28
212 009e DD1F adc r29,r29
213 00a0 C050 subi r28,lo8(-(OSTCBPrioTbl))
214 00a2 D040 sbci r29,hi8(-(OSTCBPrioTbl))
215 00a4 1882 st Y,__zero_reg__
216 00a6 1982 std Y+1,__zero_reg__
200:OSsrc/os_task.c **** OS_EXIT_CRITICAL();
218 .LM18:
219 /* #APP */
220 00a8 0F90 pop __tmp_reg__
221 00aa 0FBE out __SREG__,__tmp_reg__
222 /* #NOAPP */
223 .L7:
201:OSsrc/os_task.c **** }
202:OSsrc/os_task.c **** return (err);
225 .LM19:
226 00ac 812F mov r24,r17
227 00ae 9927 clr r25
228 00b0 04C0 rjmp .L1
229 .L4:
203:OSsrc/os_task.c **** }
204:OSsrc/os_task.c **** OS_EXIT_CRITICAL();
231 .LM20:
232 /* #APP */
233 00b2 0F90 pop __tmp_reg__
234 00b4 0FBE out __SREG__,__tmp_reg__
205:OSsrc/os_task.c **** return (OS_PRIO_EXIST);
236 .LM21:
237 /* #NOAPP */
238 00b6 88E2 ldi r24,lo8(40)
239 00b8 90E0 ldi r25,hi8(40)
240 .L1:
241 /* epilogue: frame size=0 */
242 00ba DF91 pop r29
243 00bc CF91 pop r28
244 00be 1F91 pop r17
245 00c0 0F91 pop r16
246 00c2 FF90 pop r15
247 00c4 EF90 pop r14
248 00c6 DF90 pop r13
249 00c8 CF90 pop r12
250 00ca BF90 pop r11
251 00cc AF90 pop r10
252 00ce 9F90 pop r9
253 00d0 0895 ret
254 /* epilogue end (size=12) */
255 /* function OSTaskCreate size 119 (96) */
261 .Lscope0:
266 .global OSTaskNameGet
268 OSTaskNameGet:
206:OSsrc/os_task.c **** }
207:OSsrc/os_task.c **** #endif
208:OSsrc/os_task.c **** /*$PAGE*/
209:OSsrc/os_task.c **** /*
210:OSsrc/os_task.c **** ***************************************************************************************************
211:OSsrc/os_task.c **** * CREATE A TASK (Extended Version)
212:OSsrc/os_task.c **** *
213:OSsrc/os_task.c **** * Description: This function is used to have uC/OS-II manage the execution of a task. Tasks can ei
214:OSsrc/os_task.c **** * be created prior to the start of multitasking or by a running task. A task cannot b
215:OSsrc/os_task.c **** * created by an ISR. This function is similar to OSTaskCreate() except that it allows
216:OSsrc/os_task.c **** * additional information about a task to be specified.
217:OSsrc/os_task.c **** *
218:OSsrc/os_task.c **** * Arguments : task is a pointer to the task's code
219:OSsrc/os_task.c **** *
220:OSsrc/os_task.c **** * p_arg is a pointer to an optional data area which can be used to pass parameters
221:OSsrc/os_task.c **** * the task when the task first executes. Where the task is concerned it thi
222:OSsrc/os_task.c **** * it was invoked and passed the argument 'p_arg' as follows:
223:OSsrc/os_task.c **** *
224:OSsrc/os_task.c **** * void Task (void *p_arg)
225:OSsrc/os_task.c **** * {
226:OSsrc/os_task.c **** * for (;;) {
227:OSsrc/os_task.c **** * Task code;
228:OSsrc/os_task.c **** * }
229:OSsrc/os_task.c **** * }
230:OSsrc/os_task.c **** *
231:OSsrc/os_task.c **** * ptos is a pointer to the task's top of stack. If the configuration constant
232:OSsrc/os_task.c **** * OS_STK_GROWTH is set to 1, the stack is assumed to grow downward (i.e. fro
233:OSsrc/os_task.c **** * memory to low memory). 'ptos' will thus point to the highest (valid) memo
234:OSsrc/os_task.c **** * location of the stack. If OS_STK_GROWTH is set to 0, 'ptos' will point to
235:OSsrc/os_task.c **** * lowest memory location of the stack and the stack will grow with increasin
236:OSsrc/os_task.c **** * memory locations. 'ptos' MUST point to a valid 'free' data item.
237:OSsrc/os_task.c **** *
238:OSsrc/os_task.c **** * prio is the task's priority. A unique priority MUST be assigned to each task a
239:OSsrc/os_task.c **** * lower the number, the higher the priority.
240:OSsrc/os_task.c **** *
241:OSsrc/os_task.c **** * id is the task's ID (0..65535)
242:OSsrc/os_task.c **** *
243:OSsrc/os_task.c **** * pbos is a pointer to the task's bottom of stack. If the configuration constant
244:OSsrc/os_task.c **** * OS_STK_GROWTH is set to 1, the stack is assumed to grow downward (i.e. fro
245:OSsrc/os_task.c **** * memory to low memory). 'pbos' will thus point to the LOWEST (valid) memor
246:OSsrc/os_task.c **** * location of the stack. If OS_STK_GROWTH is set to 0, 'pbos' will point to
247:OSsrc/os_task.c **** * HIGHEST memory location of the stack and the stack will grow with increasi
248:OSsrc/os_task.c **** * memory locations. 'pbos' MUST point to a valid 'free' data item.
249:OSsrc/os_task.c **** *
250:OSsrc/os_task.c **** * stk_size is the size of the stack in number of elements. If OS_STK is set to INT8U
251:OSsrc/os_task.c **** * 'stk_size' corresponds to the number of bytes available. If OS_STK is set
252:OSsrc/os_task.c **** * INT16U, 'stk_size' contains the number of 16-bit entries available. Final
253:OSsrc/os_task.c **** * OS_STK is set to INT32U, 'stk_size' contains the number of 32-bit entries
254:OSsrc/os_task.c **** * available on the stack.
255:OSsrc/os_task.c **** *
256:OSsrc/os_task.c **** * pext is a pointer to a user supplied memory location which is used as a TCB ext
257:OSsrc/os_task.c **** * For example, this user memory can hold the contents of floating-point regi
258:OSsrc/os_task.c **** * during a context switch, the time each task takes to execute, the number o
259:OSsrc/os_task.c **** * the task has been switched-in, etc.
260:OSsrc/os_task.c **** *
261:OSsrc/os_task.c **** * opt contains additional information (or options) about the behavior of the tas
262:OSsrc/os_task.c **** * LOWER 8-bits are reserved by uC/OS-II while the upper 8 bits can be applic
263:OSsrc/os_task.c **** * specific. See OS_TASK_OPT_??? in uCOS-II.H. Current choices are:
264:OSsrc/os_task.c **** *
265:OSsrc/os_task.c **** * OS_TASK_OPT_STK_CHK Stack checking to be allowed for the task
266:OSsrc/os_task.c **** * OS_TASK_OPT_STK_CLR Clear the stack when the task is created
267:OSsrc/os_task.c **** * OS_TASK_OPT_SAVE_FP If the CPU has floating-point registers, save the
268:OSsrc/os_task.c **** * during a context switch.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?