📄 os_mbox.lst
字号:
328:../OSsrc/os_mbox.c **** break;
329:../OSsrc/os_mbox.c ****
330:../OSsrc/os_mbox.c **** case OS_STAT_PEND_ABORT:
331:../OSsrc/os_mbox.c **** *perr = OS_ERR_PEND_ABORT; /* Indicate that we aborted
632 .LM94:
633 0202 8EE0 ldi r24,lo8(14)
634 .L41:
635 0204 F701 movw r30,r14
636 0206 8083 st Z,r24
332:../OSsrc/os_mbox.c **** break;
333:../OSsrc/os_mbox.c **** }
334:../OSsrc/os_mbox.c **** return ((void *)0); /* Return a NULL message
638 .LM95:
639 0208 40E0 ldi r20,lo8(0)
640 020a 50E0 ldi r21,hi8(0)
641 020c 0EC0 rjmp .L29
642 .L36:
335:../OSsrc/os_mbox.c **** }
336:../OSsrc/os_mbox.c **** pmsg = OSTCBCur->OSTCBMsg;
644 .LM96:
645 020e 4489 ldd r20,Z+20
646 0210 5589 ldd r21,Z+21
337:../OSsrc/os_mbox.c **** OSTCBCur->OSTCBMsg = (void *)0; /* Yes, clear message received
648 .LM97:
649 0212 158A std Z+21,__zero_reg__
650 0214 148A std Z+20,__zero_reg__
338:../OSsrc/os_mbox.c **** OSTCBCur->OSTCBStat = OS_STAT_RDY;
652 .LM98:
653 0216 118F std Z+25,r17
339:../OSsrc/os_mbox.c **** OSTCBCur->OSTCBEventPtr = (OS_EVENT *)0; /* No longer waiting for event
655 .LM99:
656 0218 E091 0000 lds r30,OSTCBCur
657 021c F091 0000 lds r31,(OSTCBCur)+1
658 0220 138A std Z+19,__zero_reg__
659 0222 128A std Z+18,__zero_reg__
340:../OSsrc/os_mbox.c **** OS_EXIT_CRITICAL();
661 .LM100:
662 /* #APP */
663 0224 7894 sei
664 /* #NOAPP */
665 .L42:
341:../OSsrc/os_mbox.c **** *perr = OS_ERR_NONE;
667 .LM101:
668 0226 F701 movw r30,r14
669 0228 1082 st Z,__zero_reg__
670 .L29:
342:../OSsrc/os_mbox.c **** return (pmsg); /* Return the message received
343:../OSsrc/os_mbox.c **** }
672 .LM102:
673 022a CA01 movw r24,r20
674 /* epilogue: frame size=0 */
675 022c DF91 pop r29
676 022e CF91 pop r28
677 0230 1F91 pop r17
678 0232 FF90 pop r15
679 0234 EF90 pop r14
680 0236 0895 ret
681 /* epilogue end (size=6) */
682 /* function OSMboxPend size 118 (107) */
688 .Lscope3:
693 .global OSMboxPendAbort
695 OSMboxPendAbort:
344:../OSsrc/os_mbox.c **** /*$PAGE*/
345:../OSsrc/os_mbox.c **** /*
346:../OSsrc/os_mbox.c **** ***************************************************************************************************
347:../OSsrc/os_mbox.c **** * ABORT WAITING ON A MESSAGE MAILBOX
348:../OSsrc/os_mbox.c **** *
349:../OSsrc/os_mbox.c **** * Description: This function aborts & readies any tasks currently waiting on a mailbox. This funct
350:../OSsrc/os_mbox.c **** * should be used to fault-abort the wait on the mailbox, rather than to normally signa
351:../OSsrc/os_mbox.c **** * the mailbox via OSMboxPost() or OSMboxPostOpt().
352:../OSsrc/os_mbox.c **** *
353:../OSsrc/os_mbox.c **** * Arguments : pevent is a pointer to the event control block associated with the desired ma
354:../OSsrc/os_mbox.c **** *
355:../OSsrc/os_mbox.c **** * opt determines the type of ABORT performed:
356:../OSsrc/os_mbox.c **** * OS_PEND_OPT_NONE ABORT wait for a single task (HPT) waiting on
357:../OSsrc/os_mbox.c **** * mailbox
358:../OSsrc/os_mbox.c **** * OS_PEND_OPT_BROADCAST ABORT wait for ALL tasks that are waiting on
359:../OSsrc/os_mbox.c **** * mailbox
360:../OSsrc/os_mbox.c **** *
361:../OSsrc/os_mbox.c **** * perr is a pointer to where an error message will be deposited. Possible er
362:../OSsrc/os_mbox.c **** * messages are:
363:../OSsrc/os_mbox.c **** *
364:../OSsrc/os_mbox.c **** * OS_ERR_NONE No tasks were waiting on the mailbox.
365:../OSsrc/os_mbox.c **** * OS_ERR_PEND_ABORT At least one task waiting on the mailbox was readi
366:../OSsrc/os_mbox.c **** * and informed of the aborted wait; check return val
367:../OSsrc/os_mbox.c **** * for the number of tasks whose wait on the mailbox
368:../OSsrc/os_mbox.c **** * was aborted.
369:../OSsrc/os_mbox.c **** * OS_ERR_EVENT_TYPE If you didn't pass a pointer to a mailbox.
370:../OSsrc/os_mbox.c **** * OS_ERR_PEVENT_NULL If 'pevent' is a NULL pointer.
371:../OSsrc/os_mbox.c **** *
372:../OSsrc/os_mbox.c **** * Returns : == 0 if no tasks were waiting on the mailbox, or upon error.
373:../OSsrc/os_mbox.c **** * > 0 if one or more tasks waiting on the mailbox are now readied and inform
374:../OSsrc/os_mbox.c **** ***************************************************************************************************
375:../OSsrc/os_mbox.c **** */
376:../OSsrc/os_mbox.c ****
377:../OSsrc/os_mbox.c **** #if OS_MBOX_PEND_ABORT_EN > 0
378:../OSsrc/os_mbox.c **** INT8U OSMboxPendAbort (OS_EVENT *pevent, INT8U opt, INT8U *perr)
379:../OSsrc/os_mbox.c **** {
697 .LM103:
698 /* prologue: frame size=0 */
699 0238 FF92 push r15
700 023a 0F93 push r16
701 023c 1F93 push r17
702 023e CF93 push r28
703 0240 DF93 push r29
704 /* prologue end (size=5) */
705 0242 EC01 movw r28,r24
706 0244 8A01 movw r16,r20
380:../OSsrc/os_mbox.c **** INT8U nbr_tasks;
381:../OSsrc/os_mbox.c **** #if OS_CRITICAL_METHOD == 3 /* Allocate storage for CPU status regis
382:../OSsrc/os_mbox.c **** OS_CPU_SR cpu_sr = 0;
383:../OSsrc/os_mbox.c **** #endif
384:../OSsrc/os_mbox.c ****
385:../OSsrc/os_mbox.c ****
386:../OSsrc/os_mbox.c ****
387:../OSsrc/os_mbox.c **** #if OS_ARG_CHK_EN > 0
388:../OSsrc/os_mbox.c **** if (perr == (INT8U *)0) { /* Validate 'perr'
708 .LM104:
709 0246 4115 cp r20,__zero_reg__
710 0248 5105 cpc r21,__zero_reg__
711 024a C1F1 breq .L44
389:../OSsrc/os_mbox.c **** return (0);
390:../OSsrc/os_mbox.c **** }
391:../OSsrc/os_mbox.c **** if (pevent == (OS_EVENT *)0) { /* Validate 'pevent'
713 .LM105:
714 024c 892B or r24,r25
715 024e 29F4 brne .L46
392:../OSsrc/os_mbox.c **** *perr = OS_ERR_PEVENT_NULL;
717 .LM106:
718 0250 84E0 ldi r24,lo8(4)
719 0252 FA01 movw r30,r20
720 0254 8083 st Z,r24
393:../OSsrc/os_mbox.c **** return (0);
722 .LM107:
723 0256 AE01 movw r20,r28
724 0258 31C0 rjmp .L44
725 .L46:
394:../OSsrc/os_mbox.c **** }
395:../OSsrc/os_mbox.c **** #endif
396:../OSsrc/os_mbox.c **** if (pevent->OSEventType != OS_EVENT_TYPE_MBOX) { /* Validate event block type
727 .LM108:
728 025a 8881 ld r24,Y
729 025c 8130 cpi r24,lo8(1)
730 025e 21F0 breq .L47
397:../OSsrc/os_mbox.c **** *perr = OS_ERR_EVENT_TYPE;
732 .LM109:
733 0260 81E0 ldi r24,lo8(1)
734 0262 FA01 movw r30,r20
735 0264 8083 st Z,r24
736 0266 28C0 rjmp .L58
737 .L47:
398:../OSsrc/os_mbox.c **** return (0);
399:../OSsrc/os_mbox.c **** }
400:../OSsrc/os_mbox.c **** OS_ENTER_CRITICAL();
739 .LM110:
740 /* #APP */
741 0268 F894 cli
401:../OSsrc/os_mbox.c **** if (pevent->OSEventGrp != 0) { /* See if any task waiting on mailbox?
743 .LM111:
744 /* #NOAPP */
745 026a 8D81 ldd r24,Y+5
746 026c 8823 tst r24
747 026e 09F1 breq .L48
402:../OSsrc/os_mbox.c **** nbr_tasks = 0;
749 .LM112:
750 0270 FF24 clr r15
403:../OSsrc/os_mbox.c **** switch (opt) {
752 .LM113:
753 0272 6130 cpi r22,lo8(1)
754 0274 61F4 brne .L55
755 .L53:
404:../OSsrc/os_mbox.c **** case OS_PEND_OPT_BROADCAST: /* Do we need to abort ALL waiting tasks
405:../OSsrc/os_mbox.c **** while (pevent->OSEventGrp != 0) { /* Yes, ready ALL tasks waiting on mailb
406:../OSsrc/os_mbox.c **** (void)OS_EventTaskRdy(pevent, (void *)0, OS_STAT_MBOX, OS_STAT_PEND_ABORT);
757 .LM114:
758 0276 22E0 ldi r18,lo8(2)
759 0278 422F mov r20,r18
760 027a 60E0 ldi r22,lo8(0)
761 027c 70E0 ldi r23,hi8(0)
762 027e CE01 movw r24,r28
763 0280 0E94 0000 call OS_EventTaskRdy
407:../OSsrc/os_mbox.c **** nbr_tasks++;
765 .LM115:
766 0284 F394 inc r15
767 0286 8D81 ldd r24,Y+5
768 0288 8823 tst r24
769 028a A9F7 brne .L53
408:../OSsrc/os_mbox.c **** }
409:../OSsrc/os_mbox.c **** break;
771 .LM116:
772 028c 09C0 rjmp .L49
773 .L55:
410:../OSsrc/os_mbox.c ****
411:../OSsrc/os_mbox.c **** case OS_PEND_OPT_NONE: /* No, ready HPT waiting on mailb
412:../OSsrc/os_mbox.c **** default:
413:../OSsrc/os_mbox.c **** (void)OS_EventTaskRdy(pevent, (void *)0, OS_STAT_MBOX, OS_STAT_PEND_ABORT);
775 .LM117:
776 028e 22E0 ldi r18,lo8(2)
777 0290 422F mov r20,r18
778 0292 60E0 ldi r22,lo8(0)
779 0294 70E0 ldi r23,hi8(0)
780 0296 CE01 movw r24,r28
781 0298 0E94 0000 call OS_EventTaskRdy
414:../OSsrc/os_mbox.c **** nbr_tasks++;
783 .LM118:
784 029c 21E0 ldi r18,lo8(1)
785 029e F22E mov r15,r18
786 .L49:
415:../OSsrc/os_mbox.c **** break;
416:../OSsrc/os_mbox.c **** }
417:../OSsrc/os_mbox.c **** OS_EXIT_CRITICAL();
788 .LM119:
789 /* #APP */
790 02a0 7894 sei
418:../OSsrc/os_mbox.c **** OS_Sched(); /* Find HPT ready to run
792 .LM120:
793 /* #NOAPP */
794 02a2 0E94 0000 call OS_Sched
419:../OSsrc/os_mbox.c **** *perr = OS_ERR_PEND_ABORT;
796 .LM121:
797 02a6 8EE0 ldi r24,lo8(14)
798 02a8 F801 movw r30,r16
799 02aa 8083 st Z,r24
420:../OSsrc/os_mbox.c **** return (nbr_tasks);
801 .LM122:
802 02ac 4F2D mov r20,r15
803 02ae 5527 clr r21
804 02b0 05C0 rjmp .L44
805 .L48:
421:../OSsrc/os_mbox.c **** }
422:../OSsrc/os_mbox.c **** OS_EXIT_CRITICAL();
807 .LM123:
808 /* #APP */
809 02b2 7894 sei
423:../OSsrc/os_mbox.c **** *perr = OS_ERR_NONE;
811 .LM124:
812 /* #NOAPP */
813 02b4 FA01 movw r30,r20
814 02b6 1082 st Z,__zero_reg__
815 .L58:
424:../OSsrc/os_mbox.c **** return (0); /* No tasks waiting on mailbox
817 .LM125:
818 02b8 40E0 ldi r20,lo8(0)
819 02ba 50E0 ldi r21,hi8(0)
820 .L44:
425:../OSsrc/os_mbox.c **** }
822 .LM126:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -