📄 os_task.lst
字号:
175:os/source/os_task.c **** psp = (OS_STK *)OSTaskStkInit(task, pdata, ptos, 0); /* Initialize the task's stack
469 .LM44:
470 /* #NOAPP */
471 019c 9E01 movw r18,r28
472 019e CF01 movw r24,r30
473 01a0 0E94 0000 call OSTaskStkInit
176:os/source/os_task.c **** err = OS_TCBInit(prio, psp, (OS_STK *)0, 0, 0, (void *)0, 0);
475 .LM45:
476 01a4 5E01 movw r10,r28
477 01a6 6E01 movw r12,r28
478 01a8 EE24 clr r14
479 01aa FF24 clr r15
480 01ac 8701 movw r16,r14
481 01ae 9E01 movw r18,r28
482 01b0 AE01 movw r20,r28
483 01b2 BC01 movw r22,r24
484 01b4 872D mov r24,r7
485 01b6 0E94 0000 call OS_TCBInit
486 01ba 182F mov r17,r24
177:os/source/os_task.c **** if (err == OS_NO_ERR) {
488 .LM46:
489 01bc 8823 tst r24
490 01be 71F4 brne .L14
178:os/source/os_task.c **** OS_ENTER_CRITICAL();
492 .LM47:
493 /* #APP */
494 01c0 F894 cli
179:os/source/os_task.c **** OSTaskCtr++; /* Increment the #tasks counter
496 .LM48:
497 /* #NOAPP */
498 01c2 8091 0000 lds r24,OSTaskCtr
499 01c6 8F5F subi r24,lo8(-(1))
500 01c8 8093 0000 sts OSTaskCtr,r24
180:os/source/os_task.c **** OS_EXIT_CRITICAL();
502 .LM49:
503 /* #APP */
504 01cc 7894 sei
181:os/source/os_task.c **** if (OSRunning == TRUE) { /* Find highest priority task if multitasking has star
506 .LM50:
507 /* #NOAPP */
508 01ce 8091 0000 lds r24,OSRunning
509 01d2 8130 cpi r24,lo8(1)
510 01d4 41F4 brne .L16
182:os/source/os_task.c **** OS_Sched();
512 .LM51:
513 01d6 0E94 0000 call OS_Sched
514 01da 05C0 rjmp .L16
515 .L14:
183:os/source/os_task.c **** }
184:os/source/os_task.c **** } else {
185:os/source/os_task.c **** OS_ENTER_CRITICAL();
517 .LM52:
518 /* #APP */
519 01dc F894 cli
186:os/source/os_task.c **** OSTCBPrioTbl[prio] = (OS_TCB *)0;/* Make this priority available to others
521 .LM53:
522 /* #NOAPP */
523 01de F401 movw r30,r8
524 01e0 D183 std Z+1,r29
525 01e2 C083 st Z,r28
187:os/source/os_task.c **** OS_EXIT_CRITICAL();
527 .LM54:
528 /* #APP */
529 01e4 7894 sei
530 /* #NOAPP */
531 .L16:
188:os/source/os_task.c **** }
189:os/source/os_task.c **** return (err);
533 .LM55:
534 01e6 812F mov r24,r17
535 01e8 9927 clr r25
536 01ea 03C0 rjmp .L12
537 .L13:
190:os/source/os_task.c **** }
191:os/source/os_task.c **** OS_EXIT_CRITICAL();
539 .LM56:
540 /* #APP */
541 01ec 7894 sei
192:os/source/os_task.c **** return (OS_PRIO_EXIST);
543 .LM57:
544 /* #NOAPP */
545 01ee 88E2 ldi r24,lo8(40)
546 01f0 90E0 ldi r25,hi8(40)
547 .L12:
548 /* epilogue: frame size=0 */
549 01f2 DF91 pop r29
550 01f4 CF91 pop r28
551 01f6 1F91 pop r17
552 01f8 0F91 pop r16
553 01fa FF90 pop r15
554 01fc EF90 pop r14
555 01fe DF90 pop r13
556 0200 CF90 pop r12
557 0202 BF90 pop r11
558 0204 AF90 pop r10
559 0206 9F90 pop r9
560 0208 8F90 pop r8
561 020a 7F90 pop r7
562 020c 0895 ret
563 /* epilogue end (size=14) */
564 /* function OSTaskCreate size 99 (72) */
570 .Lscope1:
581 .global OSTaskCreateExt
583 OSTaskCreateExt:
193:os/source/os_task.c **** }
194:os/source/os_task.c **** #endif
195:os/source/os_task.c **** /*$PAGE*/
196:os/source/os_task.c **** /*
197:os/source/os_task.c **** ***************************************************************************************************
198:os/source/os_task.c **** * CREATE A TASK (Extended Version)
199:os/source/os_task.c **** *
200:os/source/os_task.c **** * Description: This function is used to have uC/OS-II manage the execution of a task. Tasks can ei
201:os/source/os_task.c **** * be created prior to the start of multitasking or by a running task. A task cannot b
202:os/source/os_task.c **** * created by an ISR. This function is similar to OSTaskCreate() except that it allows
203:os/source/os_task.c **** * additional information about a task to be specified.
204:os/source/os_task.c **** *
205:os/source/os_task.c **** * Arguments : task is a pointer to the task's code
206:os/source/os_task.c **** *
207:os/source/os_task.c **** * pdata is a pointer to an optional data area which can be used to pass parameters
208:os/source/os_task.c **** * the task when the task first executes. Where the task is concerned it thin
209:os/source/os_task.c **** * it was invoked and passed the argument 'pdata' as follows:
210:os/source/os_task.c **** *
211:os/source/os_task.c **** * void Task (void *pdata)
212:os/source/os_task.c **** * {
213:os/source/os_task.c **** * for (;;) {
214:os/source/os_task.c **** * Task code;
215:os/source/os_task.c **** * }
216:os/source/os_task.c **** * }
217:os/source/os_task.c **** *
218:os/source/os_task.c **** * ptos is a pointer to the task's top of stack. If the configuration constant
219:os/source/os_task.c **** * OS_STK_GROWTH is set to 1, the stack is assumed to grow downward (i.e. from
220:os/source/os_task.c **** * memory to low memory). 'pstk' will thus point to the highest (valid) memor
221:os/source/os_task.c **** * location of the stack. If OS_STK_GROWTH is set to 0, 'pstk' will point to
222:os/source/os_task.c **** * lowest memory location of the stack and the stack will grow with increasing
223:os/source/os_task.c **** * memory locations. 'pstk' MUST point to a valid 'free' data item.
224:os/source/os_task.c **** *
225:os/source/os_task.c **** * prio is the task's priority. A unique priority MUST be assigned to each task an
226:os/source/os_task.c **** * lower the number, the higher the priority.
227:os/source/os_task.c **** *
228:os/source/os_task.c **** * id is the task's ID (0..65535)
229:os/source/os_task.c **** *
230:os/source/os_task.c **** * pbos is a pointer to the task's bottom of stack. If the configuration constant
231:os/source/os_task.c **** * OS_STK_GROWTH is set to 1, the stack is assumed to grow downward (i.e. from
232:os/source/os_task.c **** * memory to low memory). 'pbos' will thus point to the LOWEST (valid) memory
233:os/source/os_task.c **** * location of the stack. If OS_STK_GROWTH is set to 0, 'pbos' will point to
234:os/source/os_task.c **** * HIGHEST memory location of the stack and the stack will grow with increasin
235:os/source/os_task.c **** * memory locations. 'pbos' MUST point to a valid 'free' data item.
236:os/source/os_task.c **** *
237:os/source/os_task.c **** * stk_size is the size of the stack in number of elements. If OS_STK is set to INT8U,
238:os/source/os_task.c **** * 'stk_size' corresponds to the number of bytes available. If OS_STK is set
239:os/source/os_task.c **** * INT16U, 'stk_size' contains the number of 16-bit entries available. Finall
240:os/source/os_task.c **** * OS_STK is set to INT32U, 'stk_size' contains the number of 32-bit entries
241:os/source/os_task.c **** * available on the stack.
242:os/source/os_task.c **** *
243:os/source/os_task.c **** * pext is a pointer to a user supplied memory location which is used as a TCB exte
244:os/source/os_task.c **** * For example, this user memory can hold the contents of floating-point regis
245:os/source/os_task.c **** * during a context switch, the time each task takes to execute, the number of
246:os/source/os_task.c **** * the task has been switched-in, etc.
247:os/source/os_task.c **** *
248:os/source/os_task.c **** * opt contains additional information (or options) about the behavior of the task
249:os/source/os_task.c **** * LOWER 8-bits are reserved by uC/OS-II while the upper 8 bits can be applica
250:os/source/os_task.c **** * specific. See OS_TASK_OPT_??? in uCOS-II.H.
251:os/source/os_task.c **** *
252:os/source/os_task.c **** * Returns : OS_NO_ERR if the function was successful.
253:os/source/os_task.c **** * OS_PRIO_EXIT if the task priority already exist
254:os/source/os_task.c **** * (each task MUST have a unique priority).
255:os/source/os_task.c **** * OS_PRIO_INVALID if the priority you specify is higher that the maximum allowed
256:os/source/os_task.c **** * (i.e. > OS_LOWEST_PRIO)
257:os/source/os_task.c **** ***************************************************************************************************
258:os/source/os_task.c **** */
259:os/source/os_task.c **** /*$PAGE*/
260:os/source/os_task.c **** #if OS_TASK_CREATE_EXT_EN > 0
261:os/source/os_task.c **** INT8U OSTaskCreateExt (void (*task)(void *pd),
262:os/source/os_task.c **** void *pdata,
263:os/source/os_task.c **** OS_STK *ptos,
264:os/source/os_task.c **** INT8U prio,
265:os/source/os_task.c **** INT16U id,
266:os/source/os_task.c **** OS_STK *pbos,
267:os/source/os_task.c **** INT32U stk_size,
268:os/source/os_task.c **** void *pext,
269:os/source/os_task.c **** INT16U opt)
270:os/source/os_task.c **** {
585 .LM58:
586 /* prologue: frame size=5 */
587 020e 2F92 push r2
588 0210 3F92 push r3
589 0212 4F92 push r4
590 0214 5F92 push r5
591 0216 6F92 push r6
592 0218 7F92 push r7
593 021a 8F92 push r8
594 021c 9F92 push r9
595 021e AF92 push r10
596 0220 BF92 push r11
597 0222 CF92 push r12
598 0224 DF92 push r13
599 0226 EF92 push r14
600 0228 FF92 push r15
601 022a 0F93 push r16
602 022c 1F93 push r17
603 022e CF93 push r28
604 0230 DF93 push r29
605 0232 CDB7 in r28,__SP_L__
606 0234 DEB7 in r29,__SP_H__
607 0236 2597 sbiw r28,5
608 0238 0FB6 in __tmp_reg__,__SREG__
609 023a F894 cli
610 023c DEBF out __SP_H__,r29
611 023e 0FBE out __SREG__,__tmp_reg__
612 0240 CDBF out __SP_L__,r28
613 /* prologue end (size=26) */
614 0242 9A83 std Y+2,r25
615 0244 8983 std Y+1,r24
616 0246 1B01 movw r2,r22
617 0248 2A01 movw r4,r20
618 024a 2B83 std Y+3,r18
619 024c 1D83 std Y+5,r17
620 024e 0C83 std Y+4,r16
621 0250 3701 movw r6,r14
622 0252 8601 movw r16,r12
623 0254 7501 movw r14,r10
624 0256 6401 movw r12,r8
625 0258 AA8C ldd r10,Y+26
626 025a BB8C ldd r11,Y+27
271:os/source/os_task.c **** #if OS_CRITICAL_METHOD == 3 /* Allocate storage for CPU status register
272:os/source/os_task.c **** OS_CPU_SR cpu_sr;
273:os/source/os_task.c **** #endif
274:os/source/os_task.c **** OS_STK *psp;
275:os/source/os_task.c **** INT8U err;
276:os/source/os_task.c ****
277:os/source/os_task.c ****
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -