os_sem.lst
来自「atmega单片机用的ucos系统 占用内存适中 是atmega单片机合适的操作」· LST 代码 · 共 1,188 行 · 第 1/4 页
LST
1,188 行
369:OSsrc/os_sem.c **** * Description: This function obtains information about a semaphore
370:OSsrc/os_sem.c **** *
371:OSsrc/os_sem.c **** * Arguments : pevent is a pointer to the event control block associated with the desired
372:OSsrc/os_sem.c **** * semaphore
373:OSsrc/os_sem.c **** *
374:OSsrc/os_sem.c **** * p_sem_data is a pointer to a structure that will contain information about the
375:OSsrc/os_sem.c **** * semaphore.
376:OSsrc/os_sem.c **** *
377:OSsrc/os_sem.c **** * Returns : OS_NO_ERR The call was successful and the message was sent
378:OSsrc/os_sem.c **** * OS_ERR_EVENT_TYPE If you are attempting to obtain data from a non semaphore.
379:OSsrc/os_sem.c **** * OS_ERR_PEVENT_NULL If 'pevent' is a NULL pointer.
380:OSsrc/os_sem.c **** ***************************************************************************************************
381:OSsrc/os_sem.c **** */
382:OSsrc/os_sem.c ****
383:OSsrc/os_sem.c **** #if OS_SEM_QUERY_EN > 0
384:OSsrc/os_sem.c **** INT8U OSSemQuery (OS_EVENT *pevent, OS_SEM_DATA *p_sem_data)
385:OSsrc/os_sem.c **** {
740 .LM108:
741 /* prologue: frame size=0 */
742 0286 CF93 push r28
743 0288 DF93 push r29
744 /* prologue end (size=2) */
745 028a FC01 movw r30,r24
746 028c DB01 movw r26,r22
386:OSsrc/os_sem.c **** INT8U *psrc;
387:OSsrc/os_sem.c **** INT8U *pdest;
388:OSsrc/os_sem.c **** #if OS_CRITICAL_METHOD == 3 /* Allocate storage for CPU status regis
389:OSsrc/os_sem.c **** OS_CPU_SR cpu_sr;
390:OSsrc/os_sem.c ****
391:OSsrc/os_sem.c ****
392:OSsrc/os_sem.c ****
393:OSsrc/os_sem.c **** cpu_sr = 0; /* Prevent compiler warning
394:OSsrc/os_sem.c **** #endif
395:OSsrc/os_sem.c **** #if OS_ARG_CHK_EN > 0
396:OSsrc/os_sem.c **** if (pevent == (OS_EVENT *)0) { /* Validate 'pevent'
748 .LM109:
749 028e 892B or r24,r25
750 0290 19F4 brne .L43
397:OSsrc/os_sem.c **** return (OS_ERR_PEVENT_NULL);
752 .LM110:
753 0292 84E0 ldi r24,lo8(4)
754 0294 90E0 ldi r25,hi8(4)
755 0296 24C0 rjmp .L42
756 .L43:
398:OSsrc/os_sem.c **** }
399:OSsrc/os_sem.c **** #endif
400:OSsrc/os_sem.c **** if (pevent->OSEventType != OS_EVENT_TYPE_SEM) { /* Validate event block type
758 .LM111:
759 0298 8081 ld r24,Z
760 029a 8330 cpi r24,lo8(3)
761 029c 19F0 breq .L44
401:OSsrc/os_sem.c **** return (OS_ERR_EVENT_TYPE);
763 .LM112:
764 029e 81E0 ldi r24,lo8(1)
765 02a0 90E0 ldi r25,hi8(1)
766 02a2 1EC0 rjmp .L42
767 .L44:
402:OSsrc/os_sem.c **** }
403:OSsrc/os_sem.c **** OS_ENTER_CRITICAL();
769 .LM113:
770 /* #APP */
771 02a4 0FB6 in __tmp_reg__,__SREG__
772 02a6 F894 cli
773 02a8 0F92 push __tmp_reg__
404:OSsrc/os_sem.c **** p_sem_data->OSEventGrp = pevent->OSEventGrp; /* Copy message mailbox wait list
775 .LM114:
776 /* #NOAPP */
777 02aa 8181 ldd r24,Z+1
778 02ac EB01 movw r28,r22
779 02ae 8A87 std Y+10,r24
405:OSsrc/os_sem.c **** psrc = &pevent->OSEventTbl[0];
406:OSsrc/os_sem.c **** pdest = &p_sem_data->OSEventTbl[0];
407:OSsrc/os_sem.c **** #if OS_EVENT_TBL_SIZE > 0
408:OSsrc/os_sem.c **** *pdest++ = *psrc++;
781 .LM115:
782 02b0 8681 ldd r24,Z+6
783 02b2 8A83 std Y+2,r24
409:OSsrc/os_sem.c **** #endif
410:OSsrc/os_sem.c ****
411:OSsrc/os_sem.c **** #if OS_EVENT_TBL_SIZE > 1
412:OSsrc/os_sem.c **** *pdest++ = *psrc++;
785 .LM116:
786 02b4 8781 ldd r24,Z+7
787 02b6 8B83 std Y+3,r24
413:OSsrc/os_sem.c **** #endif
414:OSsrc/os_sem.c ****
415:OSsrc/os_sem.c **** #if OS_EVENT_TBL_SIZE > 2
416:OSsrc/os_sem.c **** *pdest++ = *psrc++;
789 .LM117:
790 02b8 8085 ldd r24,Z+8
791 02ba 8C83 std Y+4,r24
417:OSsrc/os_sem.c **** #endif
418:OSsrc/os_sem.c ****
419:OSsrc/os_sem.c **** #if OS_EVENT_TBL_SIZE > 3
420:OSsrc/os_sem.c **** *pdest++ = *psrc++;
793 .LM118:
794 02bc 8185 ldd r24,Z+9
795 02be 8D83 std Y+5,r24
421:OSsrc/os_sem.c **** #endif
422:OSsrc/os_sem.c ****
423:OSsrc/os_sem.c **** #if OS_EVENT_TBL_SIZE > 4
424:OSsrc/os_sem.c **** *pdest++ = *psrc++;
797 .LM119:
798 02c0 8285 ldd r24,Z+10
799 02c2 8E83 std Y+6,r24
425:OSsrc/os_sem.c **** #endif
426:OSsrc/os_sem.c ****
427:OSsrc/os_sem.c **** #if OS_EVENT_TBL_SIZE > 5
428:OSsrc/os_sem.c **** *pdest++ = *psrc++;
801 .LM120:
802 02c4 8385 ldd r24,Z+11
803 02c6 8F83 std Y+7,r24
429:OSsrc/os_sem.c **** #endif
430:OSsrc/os_sem.c ****
431:OSsrc/os_sem.c **** #if OS_EVENT_TBL_SIZE > 6
432:OSsrc/os_sem.c **** *pdest++ = *psrc++;
805 .LM121:
806 02c8 8485 ldd r24,Z+12
807 02ca 8887 std Y+8,r24
433:OSsrc/os_sem.c **** #endif
434:OSsrc/os_sem.c ****
435:OSsrc/os_sem.c **** #if OS_EVENT_TBL_SIZE > 7
436:OSsrc/os_sem.c **** *pdest = *psrc;
809 .LM122:
810 02cc 8585 ldd r24,Z+13
811 02ce 8987 std Y+9,r24
437:OSsrc/os_sem.c **** #endif
438:OSsrc/os_sem.c **** p_sem_data->OSCnt = pevent->OSEventCnt; /* Get semaphore count
813 .LM123:
814 02d0 8281 ldd r24,Z+2
815 02d2 9381 ldd r25,Z+3
816 02d4 8D93 st X+,r24
817 02d6 9C93 st X,r25
439:OSsrc/os_sem.c **** OS_EXIT_CRITICAL();
819 .LM124:
820 /* #APP */
821 02d8 0F90 pop __tmp_reg__
822 02da 0FBE out __SREG__,__tmp_reg__
440:OSsrc/os_sem.c **** return (OS_NO_ERR);
824 .LM125:
825 /* #NOAPP */
826 02dc 80E0 ldi r24,lo8(0)
827 02de 90E0 ldi r25,hi8(0)
828 .L42:
829 /* epilogue: frame size=0 */
830 02e0 DF91 pop r29
831 02e2 CF91 pop r28
832 02e4 0895 ret
833 /* epilogue end (size=3) */
834 /* function OSSemQuery size 53 (48) */
836 .Lscope5:
841 .global OSSemSet
843 OSSemSet:
441:OSsrc/os_sem.c **** }
442:OSsrc/os_sem.c **** #endif /* OS_SEM_QUERY_EN
443:OSsrc/os_sem.c ****
444:OSsrc/os_sem.c **** /*$PAGE*/
445:OSsrc/os_sem.c **** /*
446:OSsrc/os_sem.c **** ***************************************************************************************************
447:OSsrc/os_sem.c **** * SET SEMAPHORE
448:OSsrc/os_sem.c **** *
449:OSsrc/os_sem.c **** * Description: This function sets the semaphore count to the value specified as an argument. Typic
450:OSsrc/os_sem.c **** * this value would be 0.
451:OSsrc/os_sem.c **** *
452:OSsrc/os_sem.c **** * You would typically use this function when a semaphore is used as a signaling mechan
453:OSsrc/os_sem.c **** * and, you want to reset the count value.
454:OSsrc/os_sem.c **** *
455:OSsrc/os_sem.c **** * Arguments : pevent is a pointer to the event control block
456:OSsrc/os_sem.c **** *
457:OSsrc/os_sem.c **** * cnt is the new value for the semaphore count. You would pass 0 to reset the
458:OSsrc/os_sem.c **** * semaphore count.
459:OSsrc/os_sem.c **** *
460:OSsrc/os_sem.c **** * err is a pointer to an error code returned by the function as follows:
461:OSsrc/os_sem.c **** *
462:OSsrc/os_sem.c **** * OS_NO_ERR The call was successful and the semaphore value wa
463:OSsrc/os_sem.c **** * OS_ERR_EVENT_TYPE If you didn't pass a pointer to a semaphore.
464:OSsrc/os_sem.c **** * OS_ERR_PEVENT_NULL If 'pevent' is a NULL pointer.
465:OSsrc/os_sem.c **** ***************************************************************************************************
466:OSsrc/os_sem.c **** */
467:OSsrc/os_sem.c ****
468:OSsrc/os_sem.c **** #if OS_SEM_SET_EN > 0
469:OSsrc/os_sem.c **** void OSSemSet (OS_EVENT *pevent, INT16U cnt, INT8U *err)
470:OSsrc/os_sem.c **** {
845 .LM126:
846 /* prologue: frame size=0 */
847 /* prologue end (size=0) */
848 02e6 FC01 movw r30,r24
849 02e8 DA01 movw r26,r20
471:OSsrc/os_sem.c **** #if OS_CRITICAL_METHOD == 3 /* Allocate storage for CPU status register
472:OSsrc/os_sem.c **** OS_CPU_SR cpu_sr;
473:OSsrc/os_sem.c ****
474:OSsrc/os_sem.c ****
475:OSsrc/os_sem.c ****
476:OSsrc/os_sem.c **** cpu_sr = 0; /* Prevent compiler warning
477:OSsrc/os_sem.c **** #endif
478:OSsrc/os_sem.c **** #if OS_ARG_CHK_EN > 0
479:OSsrc/os_sem.c **** if (pevent == (OS_EVENT *)0) { /* Validate 'pevent'
851 .LM127:
852 02ea 892B or r24,r25
853 02ec 11F4 brne .L46
480:OSsrc/os_sem.c **** *err = OS_ERR_PEVENT_NULL;
855 .LM128:
856 02ee 84E0 ldi r24,lo8(4)
857 02f0 04C0 rjmp .L52
858 .L46:
481:OSsrc/os_sem.c **** return;
482:OSsrc/os_sem.c **** }
483:OSsrc/os_sem.c **** #endif
484:OSsrc/os_sem.c **** if (pevent->OSEventType != OS_EVENT_TYPE_SEM) { /* Validate event block type
860 .LM129:
861 02f2 8081 ld r24,Z
862 02f4 8330 cpi r24,lo8(3)
863 02f6 19F0 breq .L47
485:OSsrc/os_sem.c **** *err = OS_ERR_EVENT_TYPE;
865 .LM130:
866 02f8 81E0 ldi r24,lo8(1)
867 .L52:
868 02fa 8C93 st X,r24
486:OSsrc/os_sem.c **** return;
870 .LM131:
871 02fc 0895 ret
872 .L47:
487:OSsrc/os_sem.c **** }
488:OSsrc/os_sem.c **** OS_ENTER_CRITICAL();
874 .LM132:
875 /* #APP */
876 02fe 0FB6 in __tmp_reg__,__SREG__
877 0300 F894 cli
878 0302 0F92 push __tmp_reg__
489:OSsrc/os_sem.c **** if (pevent->OSEventCnt > 0) { /* See if semaphore already has a count
880 .LM133:
881 /* #NOAPP */
882 0304 8281 ldd r24,Z+2
883 0306 9381 ldd r25,Z+3
884 0308 892B or r24,r25
885 030a 19F4 brne .L51
490:OSsrc/os_sem.c **** pevent->OSEventCnt = cnt; /* Yes, set it to the new value specified.
491:OSsrc/os_sem.c **** } else { /* No
492:OSsrc/os_sem.c **** if (pevent->OSEventGrp == 0x00) { /* See if task(s) waiting?
887 .LM134:
888 030c 8181 ldd r24,Z+1
889 030e 8823 tst r24
890 0310 11F4 brne .L49
891 .L51:
493:OSsrc/os_sem.c **** pevent->OSEventCnt = cnt; /* No, OK to set the value
893 .LM135:
894 0312 6283 std Z+2,r22
895 0314 7383 std Z+3,r23
896 .L49:
494:OSsrc/os_sem.c **** }
495:OSsrc/os_sem.c **** }
496:OSsrc/os_sem.c **** OS_EXIT_CRITICAL();
898 .LM136:
899 /* #APP */
900 0316 0F90 pop __tmp_reg__
901 0318 0FBE out __SREG__,__tmp_reg__
497:OSsrc/os_sem.c **** *err = OS_NO_ERR;
903 .LM137:
904 /* #NOAPP */
905 031a 1C92 st X,__zero_reg__
906 031c 0895 ret
907 /* epilogue: frame size=0 */
908 031e 0895 ret
909 /* epilogue end (size=1) */
910 /* function OSSemSet size 34 (33) */
912 .Lscope6:
913 .text
915 Letext:
916 /* File "OSsrc/os_sem.c": code 454 = 0x01c6 ( 421), prologues 13, epilogues 20 */
DEFINED SYMBOLS
*ABS*:00000000 os_sem.c
*ABS*:0000003f __SREG__
*ABS*:0000003e __SP_H__
*ABS*:0000003d __SP_L__
*ABS*:00000000 __tmp_reg__
*ABS*:00000001 __zero_reg__
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccs1aaaa.s:87 .text:00000000 OSSemAccept
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccs1aaaa.s:156 .text:00000032 OSSemCreate
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccs1aaaa.s:252 .text:0000008c OSSemDel
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccs1aaaa.s:470 .text:00000172 OSSemPend
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccs1aaaa.s:631 .text:00000224 OSSemPost
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccs1aaaa.s:738 .text:00000286 OSSemQuery
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccs1aaaa.s:843 .text:000002e6 OSSemSet
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccs1aaaa.s:915 .text:00000320 Letext
UNDEFINED SYMBOLS
__do_copy_data
__do_clear_bss
OSIntNesting
OSEventFreeList
OS_EventWaitListInit
OS_EventTaskRdy
OS_Sched
OSTCBCur
OS_EventTaskWait
OS_EventTO
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?