os_q.lst

来自「称植到lpc2124上的UCOS2.85版 是本人初学移植和ARM的成果 可」· LST 代码 · 共 1,276 行 · 第 1/5 页

LST
1,276 行
字号
 859 02fe E091 0000 		lds r30,OSTCBCur
 860 0302 F091 0000 		lds r31,(OSTCBCur)+1
 861 0306 818D      		ldd r24,Z+25
 862 0308 8460      		ori r24,lo8(4)
 863 030a 818F      		std Z+25,r24
 433:../OSsrc/os_q.c ****     OSTCBCur->OSTCBStatPend  = OS_STAT_PEND_OK;
 865               	.LM132:
 866 030c E091 0000 		lds r30,OSTCBCur
 867 0310 F091 0000 		lds r31,(OSTCBCur)+1
 868 0314 128E      		std Z+26,__zero_reg__
 434:../OSsrc/os_q.c ****     OSTCBCur->OSTCBDly       = timeout;          /* Load timeout into TCB                          
 870               	.LM133:
 871 0316 E091 0000 		lds r30,OSTCBCur
 872 031a F091 0000 		lds r31,(OSTCBCur)+1
 873 031e 708F      		std Z+24,r23
 874 0320 678B      		std Z+23,r22
 435:../OSsrc/os_q.c ****     OS_EventTaskWait(pevent);                    /* Suspend task until event or timeout occurs     
 876               	.LM134:
 877 0322 C701      		movw r24,r14
 878 0324 0E94 0000 		call OS_EventTaskWait
 436:../OSsrc/os_q.c ****     OS_EXIT_CRITICAL();
 880               	.LM135:
 881               	/* #APP */
 882 0328 7894      		sei
 437:../OSsrc/os_q.c ****     OS_Sched();                                  /* Find next highest priority task ready to run   
 884               	.LM136:
 885               	/* #NOAPP */
 886 032a 0E94 0000 		call OS_Sched
 438:../OSsrc/os_q.c ****     OS_ENTER_CRITICAL();
 888               	.LM137:
 889               	/* #APP */
 890 032e F894      		cli
 439:../OSsrc/os_q.c ****     if (OSTCBCur->OSTCBStatPend != OS_STAT_PEND_OK) { /* Was task readied because timed-out or abor
 892               	.LM138:
 893               	/* #NOAPP */
 894 0330 E091 0000 		lds r30,OSTCBCur
 895 0334 F091 0000 		lds r31,(OSTCBCur)+1
 896 0338 128D      		ldd r17,Z+26
 897 033a 1123      		tst r17
 898 033c 69F0      		breq .L46
 440:../OSsrc/os_q.c ****         pend_stat = OSTCBCur->OSTCBStatPend;
 441:../OSsrc/os_q.c ****         OS_EventTOAbort(pevent);
 900               	.LM139:
 901 033e C701      		movw r24,r14
 902 0340 0E94 0000 		call OS_EventTOAbort
 442:../OSsrc/os_q.c ****         OS_EXIT_CRITICAL();
 904               	.LM140:
 905               	/* #APP */
 906 0344 7894      		sei
 443:../OSsrc/os_q.c ****         switch (pend_stat) {
 908               	.LM141:
 909               	/* #NOAPP */
 910 0346 1230      		cpi r17,lo8(2)
 911 0348 11F0      		breq .L50
 444:../OSsrc/os_q.c ****             case OS_STAT_PEND_TO:
 445:../OSsrc/os_q.c ****             default:
 446:../OSsrc/os_q.c ****                  *perr = OS_ERR_TIMEOUT;         /*     Indicate a timeout occured                 
 913               	.LM142:
 914 034a 8AE0      		ldi r24,lo8(10)
 915 034c 01C0      		rjmp .L51
 916               	.L50:
 447:../OSsrc/os_q.c ****                  break;
 448:../OSsrc/os_q.c **** 
 449:../OSsrc/os_q.c ****             case OS_STAT_PEND_ABORT:
 450:../OSsrc/os_q.c ****                  *perr = OS_ERR_PEND_ABORT;      /*     Indicate that we aborted                   
 918               	.LM143:
 919 034e 8EE0      		ldi r24,lo8(14)
 920               	.L51:
 921 0350 8883      		st Y,r24
 922               	.L52:
 451:../OSsrc/os_q.c ****                  break;
 452:../OSsrc/os_q.c ****         }
 453:../OSsrc/os_q.c ****         return ((void *)0);                      /*     No message received                        
 924               	.LM144:
 925 0352 40E0      		ldi r20,lo8(0)
 926 0354 50E0      		ldi r21,hi8(0)
 927 0356 0EC0      		rjmp .L38
 928               	.L46:
 454:../OSsrc/os_q.c ****     }
 455:../OSsrc/os_q.c ****     pmsg                    = OSTCBCur->OSTCBMsg;/* No, Extract message from TCB (Put there by QPos
 930               	.LM145:
 931 0358 8489      		ldd r24,Z+20
 932 035a 9589      		ldd r25,Z+21
 456:../OSsrc/os_q.c ****     OSTCBCur->OSTCBMsg      = (void *)0;
 934               	.LM146:
 935 035c 158A      		std Z+21,__zero_reg__
 936 035e 148A      		std Z+20,__zero_reg__
 457:../OSsrc/os_q.c ****     OSTCBCur->OSTCBStat     = OS_STAT_RDY;
 938               	.LM147:
 939 0360 118F      		std Z+25,r17
 458:../OSsrc/os_q.c ****     OSTCBCur->OSTCBEventPtr = (OS_EVENT *)0;     /*     No longer waiting for event                
 941               	.LM148:
 942 0362 E091 0000 		lds r30,OSTCBCur
 943 0366 F091 0000 		lds r31,(OSTCBCur)+1
 944 036a 138A      		std Z+19,__zero_reg__
 945 036c 128A      		std Z+18,__zero_reg__
 459:../OSsrc/os_q.c ****     OS_EXIT_CRITICAL();
 947               	.LM149:
 948               	/* #APP */
 949 036e 7894      		sei
 460:../OSsrc/os_q.c ****     *perr                   = OS_ERR_NONE;
 951               	.LM150:
 952               	/* #NOAPP */
 953 0370 1882      		st Y,__zero_reg__
 461:../OSsrc/os_q.c ****     return (pmsg);                               /*     Return message received                    
 955               	.LM151:
 956 0372 AC01      		movw r20,r24
 957               	.L38:
 462:../OSsrc/os_q.c **** }
 959               	.LM152:
 960 0374 CA01      		movw r24,r20
 961               	/* epilogue: frame size=0 */
 962 0376 DF91      		pop r29
 963 0378 CF91      		pop r28
 964 037a 1F91      		pop r17
 965 037c FF90      		pop r15
 966 037e EF90      		pop r14
 967 0380 0895      		ret
 968               	/* epilogue end (size=6) */
 969               	/* function OSQPend size 140 (129) */
 976               	.Lscope4:
 981               	.global	OSQPendAbort
 983               	OSQPendAbort:
 463:../OSsrc/os_q.c **** /*$PAGE*/
 464:../OSsrc/os_q.c **** /*
 465:../OSsrc/os_q.c **** ***************************************************************************************************
 466:../OSsrc/os_q.c **** *                                      ABORT WAITING ON A MESSAGE QUEUE
 467:../OSsrc/os_q.c **** *
 468:../OSsrc/os_q.c **** * Description: This function aborts & readies any tasks currently waiting on a queue.  This functio
 469:../OSsrc/os_q.c **** *              should be used to fault-abort the wait on the queue, rather than to normally signal
 470:../OSsrc/os_q.c **** *              the queue via OSQPost(), OSQPostFront() or OSQPostOpt().
 471:../OSsrc/os_q.c **** *
 472:../OSsrc/os_q.c **** * Arguments  : pevent        is a pointer to the event control block associated with the desired qu
 473:../OSsrc/os_q.c **** *
 474:../OSsrc/os_q.c **** *              opt           determines the type of ABORT performed:
 475:../OSsrc/os_q.c **** *                            OS_PEND_OPT_NONE         ABORT wait for a single task (HPT) waiting on
 476:../OSsrc/os_q.c **** *                                                     queue
 477:../OSsrc/os_q.c **** *                            OS_PEND_OPT_BROADCAST    ABORT wait for ALL tasks that are  waiting on
 478:../OSsrc/os_q.c **** *                                                     queue
 479:../OSsrc/os_q.c **** *
 480:../OSsrc/os_q.c **** *              perr          is a pointer to where an error message will be deposited.  Possible er
 481:../OSsrc/os_q.c **** *                            messages are:
 482:../OSsrc/os_q.c **** *
 483:../OSsrc/os_q.c **** *                            OS_ERR_NONE         No tasks were     waiting on the queue.
 484:../OSsrc/os_q.c **** *                            OS_ERR_PEND_ABORT   At least one task waiting on the queue was readied
 485:../OSsrc/os_q.c **** *                                                and informed of the aborted wait; check return val
 486:../OSsrc/os_q.c **** *                                                for the number of tasks whose wait on the queue 
 487:../OSsrc/os_q.c **** *                                                was aborted.
 488:../OSsrc/os_q.c **** *                            OS_ERR_EVENT_TYPE   If you didn't pass a pointer to a queue.
 489:../OSsrc/os_q.c **** *                            OS_ERR_PEVENT_NULL  If 'pevent' is a NULL pointer.
 490:../OSsrc/os_q.c **** *
 491:../OSsrc/os_q.c **** * Returns    : == 0          if no tasks were waiting on the queue, or upon error.
 492:../OSsrc/os_q.c **** *              >  0          if one or more tasks waiting on the queue are now readied and informed
 493:../OSsrc/os_q.c **** ***************************************************************************************************
 494:../OSsrc/os_q.c **** */
 495:../OSsrc/os_q.c **** 
 496:../OSsrc/os_q.c **** #if OS_Q_PEND_ABORT_EN > 0
 497:../OSsrc/os_q.c **** INT8U  OSQPendAbort (OS_EVENT *pevent, INT8U opt, INT8U *perr)
 498:../OSsrc/os_q.c **** {
 985               	.LM153:
 986               	/* prologue: frame size=0 */
 987 0382 FF92      		push r15
 988 0384 0F93      		push r16
 989 0386 1F93      		push r17
 990 0388 CF93      		push r28
 991 038a DF93      		push r29
 992               	/* prologue end (size=5) */
 993 038c EC01      		movw r28,r24
 994 038e 8A01      		movw r16,r20
 499:../OSsrc/os_q.c ****     INT8U      nbr_tasks;
 500:../OSsrc/os_q.c **** #if OS_CRITICAL_METHOD == 3                                /* Allocate storage for CPU status regis
 501:../OSsrc/os_q.c ****     OS_CPU_SR  cpu_sr = 0;
 502:../OSsrc/os_q.c **** #endif
 503:../OSsrc/os_q.c **** 
 504:../OSsrc/os_q.c **** 
 505:../OSsrc/os_q.c **** 
 506:../OSsrc/os_q.c **** #if OS_ARG_CHK_EN > 0
 507:../OSsrc/os_q.c ****     if (perr == (INT8U *)0) {                              /* Validate 'perr'                      
 996               	.LM154:
 997 0390 4115      		cp r20,__zero_reg__
 998 0392 5105      		cpc r21,__zero_reg__
 999 0394 C1F1      		breq .L53
 508:../OSsrc/os_q.c ****         return (0);
 509:../OSsrc/os_q.c ****     }
 510:../OSsrc/os_q.c ****     if (pevent == (OS_EVENT *)0) {                         /* Validate 'pevent'                    
 1001               	.LM155:
 1002 0396 892B      		or r24,r25
 1003 0398 29F4      		brne .L55
 511:../OSsrc/os_q.c ****         *perr = OS_ERR_PEVENT_NULL;
 1005               	.LM156:
 1006 039a 84E0      		ldi r24,lo8(4)
 1007 039c FA01      		movw r30,r20
 1008 039e 8083      		st Z,r24
 512:../OSsrc/os_q.c ****         return (0);
 1010               	.LM157:
 1011 03a0 AE01      		movw r20,r28
 1012 03a2 31C0      		rjmp .L53
 1013               	.L55:
 513:../OSsrc/os_q.c ****     }
 514:../OSsrc/os_q.c **** #endif
 515:../OSsrc/os_q.c ****     if (pevent->OSEventType != OS_EVENT_TYPE_Q) {          /* Validate event block type            
 1015               	.LM158:
 1016 03a4 8881      		ld r24,Y
 1017 03a6 8230      		cpi r24,lo8(2)
 1018 03a8 21F0      		breq .L56
 516:../OSsrc/os_q.c ****         *perr = OS_ERR_EVENT_TYPE;
 1020               	.LM159:
 1021 03aa 81E0      		ldi r24,lo8(1)
 1022 03ac FA01      		movw r30,r20
 1023 03ae 8083      		st Z,r24
 1024 03b0 28C0      		rjmp .L67
 1025               	.L56:
 517:../OSsrc/os_q.c ****         return (0);
 518:../OSsrc/os_q.c ****     }
 519:../OSsrc/os_q.c ****     OS_ENTER_CRITICAL();
 1027               	.LM160:
 1028               	/* #APP */
 1029 03b2 F894      		cli
 520:../OSsrc/os_q.c ****     if (pevent->OSEventGrp != 0) {                         /* See if any task waiting on queue?    
 1031               	.LM161:
 1032               	/* #NOAPP */
 1033 03b4 8D81      		ldd r24,Y+5
 1034 03b6 8823      		tst r24
 1035 03b8 09F1      		breq .L57
 521:../OSsrc/os_q.c ****         nbr_tasks = 0;
 1037               	.LM162:
 1038 03ba FF24      		clr r15
 522:../OSsrc/os_q.c ****         switch (opt) {
 1040               	.LM163:
 1041 03bc 6130      		cpi r22,lo8(1)
 1042 03be 61F4      		brne .L64
 1043               	.L62:
 523:../OSsrc/os_q.c ****             case OS_PEND_OPT_BROADCAST:                    /* Do we need to abort ALL waiting tasks
 524:../OSsrc/os_q.c ****                  while (pevent->OSEventGrp != 0) {         /* Yes, ready ALL tasks waiting on queue
 525:../OSsrc/os_q.c ****                      (void)OS_EventTaskRdy(pevent, (void *)0, OS_STAT_Q, OS_STAT_PEND_ABORT);
 1045               	.LM164:
 1046 03c0 22E0      		ldi r18,lo8(2)
 1047 03c2 44E0      		ldi r20,lo8(4)
 1048 03c4 60E0      		ldi r22,lo8(0)
 1049 03c6 70E0      		ldi r23,hi8(0)
 1050 03c8 CE01      		movw r24,r28
 1051 03ca 0E94 0000 		call OS_EventTaskRdy
 526:../OSsrc/os_q.c ****                      nbr_tasks++;
 1053               	.LM165:
 1054 03ce F394      		inc r15
 1055 03d0 8D81      		ldd r24,Y+5
 1056 03d2 8823      		tst r24
 1057 03d4 A9F7      		brne .L62
 527:../OSsrc/os_q.c ****                  }
 528:../OSsrc/os_q.c ****                  break;
 1059               	.LM166:
 1060 03d6 09C0      		rjmp .L58

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?