os_q.lst

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

LST
1,276
字号
 255               	.LM23:
 256 008c 80E0      		ldi r24,lo8(0)
 257 008e 90E0      		ldi r25,hi8(0)
 258 0090 4AC0      		rjmp .L8
 259               	.L9:
 133:../OSsrc/os_q.c ****     }
 134:../OSsrc/os_q.c ****     OS_ENTER_CRITICAL();
 261               	.LM24:
 262               	/* #APP */
 263 0092 F894      		cli
 135:../OSsrc/os_q.c ****     pevent = OSEventFreeList;                    /* Get next free event control block              
 265               	.LM25:
 266               	/* #NOAPP */
 267 0094 C091 0000 		lds r28,OSEventFreeList
 268 0098 D091 0000 		lds r29,(OSEventFreeList)+1
 136:../OSsrc/os_q.c ****     if (OSEventFreeList != (OS_EVENT *)0) {      /* See if pool of free ECB pool was empty         
 270               	.LM26:
 271 009c 2097      		sbiw r28,0
 272 009e 31F0      		breq .L10
 137:../OSsrc/os_q.c ****         OSEventFreeList = (OS_EVENT *)OSEventFreeList->OSEventPtr;
 274               	.LM27:
 275 00a0 8981      		ldd r24,Y+1
 276 00a2 9A81      		ldd r25,Y+2
 277 00a4 9093 0000 		sts (OSEventFreeList)+1,r25
 278 00a8 8093 0000 		sts OSEventFreeList,r24
 279               	.L10:
 138:../OSsrc/os_q.c ****     }
 139:../OSsrc/os_q.c ****     OS_EXIT_CRITICAL();
 281               	.LM28:
 282               	/* #APP */
 283 00ac 7894      		sei
 140:../OSsrc/os_q.c ****     if (pevent != (OS_EVENT *)0) {               /* See if we have an event control block          
 285               	.LM29:
 286               	/* #NOAPP */
 287 00ae 2097      		sbiw r28,0
 288 00b0 C9F1      		breq .L11
 141:../OSsrc/os_q.c ****         OS_ENTER_CRITICAL();
 290               	.LM30:
 291               	/* #APP */
 292 00b2 F894      		cli
 142:../OSsrc/os_q.c ****         pq = OSQFreeList;                        /* Get a free queue control block                 
 294               	.LM31:
 295               	/* #NOAPP */
 296 00b4 E091 0000 		lds r30,OSQFreeList
 297 00b8 F091 0000 		lds r31,(OSQFreeList)+1
 143:../OSsrc/os_q.c ****         if (pq != (OS_Q *)0) {                   /* Were we able to get a queue control block ?    
 299               	.LM32:
 300 00bc 3097      		sbiw r30,0
 301 00be 29F1      		breq .L12
 144:../OSsrc/os_q.c ****             OSQFreeList            = OSQFreeList->OSQPtr; /* Yes, Adjust free list pointer to next 
 303               	.LM33:
 304 00c0 8081      		ld r24,Z
 305 00c2 9181      		ldd r25,Z+1
 306 00c4 9093 0000 		sts (OSQFreeList)+1,r25
 307 00c8 8093 0000 		sts OSQFreeList,r24
 145:../OSsrc/os_q.c ****             OS_EXIT_CRITICAL();
 309               	.LM34:
 310               	/* #APP */
 311 00cc 7894      		sei
 146:../OSsrc/os_q.c ****             pq->OSQStart           = start;               /*      Initialize the queue             
 313               	.LM35:
 314               	/* #NOAPP */
 315 00ce 3383      		std Z+3,r19
 316 00d0 2283      		std Z+2,r18
 147:../OSsrc/os_q.c ****             pq->OSQEnd             = &start[size];
 318               	.LM36:
 319 00d2 CB01      		movw r24,r22
 320 00d4 860F      		add r24,r22
 321 00d6 971F      		adc r25,r23
 322 00d8 820F      		add r24,r18
 323 00da 931F      		adc r25,r19
 324 00dc 9583      		std Z+5,r25
 325 00de 8483      		std Z+4,r24
 148:../OSsrc/os_q.c ****             pq->OSQIn              = start;
 327               	.LM37:
 328 00e0 3783      		std Z+7,r19
 329 00e2 2683      		std Z+6,r18
 149:../OSsrc/os_q.c ****             pq->OSQOut             = start;
 331               	.LM38:
 332 00e4 3187      		std Z+9,r19
 333 00e6 2087      		std Z+8,r18
 150:../OSsrc/os_q.c ****             pq->OSQSize            = size;
 335               	.LM39:
 336 00e8 7387      		std Z+11,r23
 337 00ea 6287      		std Z+10,r22
 151:../OSsrc/os_q.c ****             pq->OSQEntries         = 0;
 339               	.LM40:
 340 00ec 1586      		std Z+13,__zero_reg__
 341 00ee 1486      		std Z+12,__zero_reg__
 152:../OSsrc/os_q.c ****             pevent->OSEventType    = OS_EVENT_TYPE_Q;
 343               	.LM41:
 344 00f0 82E0      		ldi r24,lo8(2)
 345 00f2 8883      		st Y,r24
 153:../OSsrc/os_q.c ****             pevent->OSEventCnt     = 0;
 347               	.LM42:
 348 00f4 1C82      		std Y+4,__zero_reg__
 349 00f6 1B82      		std Y+3,__zero_reg__
 154:../OSsrc/os_q.c ****             pevent->OSEventPtr     = pq;
 351               	.LM43:
 352 00f8 FA83      		std Y+2,r31
 353 00fa E983      		std Y+1,r30
 155:../OSsrc/os_q.c **** #if OS_EVENT_NAME_SIZE > 1
 156:../OSsrc/os_q.c ****             pevent->OSEventName[0] = '?';                  /* Unknown name                         
 355               	.LM44:
 356 00fc 8FE3      		ldi r24,lo8(63)
 357 00fe 8E87      		std Y+14,r24
 157:../OSsrc/os_q.c ****             pevent->OSEventName[1] = OS_ASCII_NUL;
 359               	.LM45:
 360 0100 1F86      		std Y+15,__zero_reg__
 158:../OSsrc/os_q.c **** #endif
 159:../OSsrc/os_q.c ****             OS_EventWaitListInit(pevent);                 /*      Initalize the wait list          
 362               	.LM46:
 363 0102 CE01      		movw r24,r28
 364 0104 0E94 0000 		call OS_EventWaitListInit
 365 0108 0DC0      		rjmp .L11
 366               	.L12:
 160:../OSsrc/os_q.c ****         } else {
 161:../OSsrc/os_q.c ****             pevent->OSEventPtr = (void *)OSEventFreeList; /* No,  Return event control block on err
 368               	.LM47:
 369 010a 8091 0000 		lds r24,OSEventFreeList
 370 010e 9091 0000 		lds r25,(OSEventFreeList)+1
 371 0112 9A83      		std Y+2,r25
 372 0114 8983      		std Y+1,r24
 162:../OSsrc/os_q.c ****             OSEventFreeList    = pevent;
 374               	.LM48:
 375 0116 D093 0000 		sts (OSEventFreeList)+1,r29
 376 011a C093 0000 		sts OSEventFreeList,r28
 163:../OSsrc/os_q.c ****             OS_EXIT_CRITICAL();
 378               	.LM49:
 379               	/* #APP */
 380 011e 7894      		sei
 164:../OSsrc/os_q.c ****             pevent = (OS_EVENT *)0;
 382               	.LM50:
 383               	/* #NOAPP */
 384 0120 C0E0      		ldi r28,lo8(0)
 385 0122 D0E0      		ldi r29,hi8(0)
 386               	.L11:
 165:../OSsrc/os_q.c ****         }
 166:../OSsrc/os_q.c ****     }
 167:../OSsrc/os_q.c ****     return (pevent);
 388               	.LM51:
 389 0124 CE01      		movw r24,r28
 390               	.L8:
 391               	/* epilogue: frame size=0 */
 392 0126 DF91      		pop r29
 393 0128 CF91      		pop r28
 394 012a 0895      		ret
 395               	/* epilogue end (size=3) */
 396               	/* function OSQCreate size 92 (87) */
 402               	.Lscope1:
 407               	.global	OSQDel
 409               	OSQDel:
 168:../OSsrc/os_q.c **** }
 169:../OSsrc/os_q.c **** /*$PAGE*/
 170:../OSsrc/os_q.c **** /*
 171:../OSsrc/os_q.c **** ***************************************************************************************************
 172:../OSsrc/os_q.c **** *                                        DELETE A MESSAGE QUEUE
 173:../OSsrc/os_q.c **** *
 174:../OSsrc/os_q.c **** * Description: This function deletes a message queue and readies all tasks pending on the queue.
 175:../OSsrc/os_q.c **** *
 176:../OSsrc/os_q.c **** * Arguments  : pevent        is a pointer to the event control block associated with the desired
 177:../OSsrc/os_q.c **** *                            queue.
 178:../OSsrc/os_q.c **** *
 179:../OSsrc/os_q.c **** *              opt           determines delete options as follows:
 180:../OSsrc/os_q.c **** *                            opt == OS_DEL_NO_PEND   Delete the queue ONLY if no task pending
 181:../OSsrc/os_q.c **** *                            opt == OS_DEL_ALWAYS    Deletes the queue even if tasks are waiting.
 182:../OSsrc/os_q.c **** *                                                    In this case, all the tasks pending will be re
 183:../OSsrc/os_q.c **** *
 184:../OSsrc/os_q.c **** *              perr          is a pointer to an error code that can contain one of the following va
 185:../OSsrc/os_q.c **** *                            OS_ERR_NONE             The call was successful and the queue was dele
 186:../OSsrc/os_q.c **** *                            OS_ERR_DEL_ISR          If you tried to delete the queue from an ISR
 187:../OSsrc/os_q.c **** *                            OS_ERR_INVALID_OPT      An invalid option was specified
 188:../OSsrc/os_q.c **** *                            OS_ERR_TASK_WAITING     One or more tasks were waiting on the queue
 189:../OSsrc/os_q.c **** *                            OS_ERR_EVENT_TYPE       If you didn't pass a pointer to a queue
 190:../OSsrc/os_q.c **** *                            OS_ERR_PEVENT_NULL      If 'pevent' is a NULL pointer.
 191:../OSsrc/os_q.c **** *
 192:../OSsrc/os_q.c **** * Returns    : pevent        upon error
 193:../OSsrc/os_q.c **** *              (OS_EVENT *)0 if the queue was successfully deleted.
 194:../OSsrc/os_q.c **** *
 195:../OSsrc/os_q.c **** * Note(s)    : 1) This function must be used with care.  Tasks that would normally expect the prese
 196:../OSsrc/os_q.c **** *                 the queue MUST check the return code of OSQPend().
 197:../OSsrc/os_q.c **** *              2) OSQAccept() callers will not know that the intended queue has been deleted unless
 198:../OSsrc/os_q.c **** *                 they check 'pevent' to see that it's a NULL pointer.
 199:../OSsrc/os_q.c **** *              3) This call can potentially disable interrupts for a long time.  The interrupt disa
 200:../OSsrc/os_q.c **** *                 time is directly proportional to the number of tasks waiting on the queue.
 201:../OSsrc/os_q.c **** *              4) Because ALL tasks pending on the queue will be readied, you MUST be careful in
 202:../OSsrc/os_q.c **** *                 applications where the queue is used for mutual exclusion because the resource(s)
 203:../OSsrc/os_q.c **** *                 will no longer be guarded by the queue.
 204:../OSsrc/os_q.c **** *              5) If the storage for the message queue was allocated dynamically (i.e. using a mall
 205:../OSsrc/os_q.c **** *                 type call) then your application MUST release the memory storage by call the coun
 206:../OSsrc/os_q.c **** *                 call of the dynamic allocation scheme used.  If the queue storage was created sta
 207:../OSsrc/os_q.c **** *                 then, the storage can be reused.
 208:../OSsrc/os_q.c **** ***************************************************************************************************
 209:../OSsrc/os_q.c **** */
 210:../OSsrc/os_q.c **** 
 211:../OSsrc/os_q.c **** #if OS_Q_DEL_EN > 0
 212:../OSsrc/os_q.c **** OS_EVENT  *OSQDel (OS_EVENT *pevent, INT8U opt, INT8U *perr)
 213:../OSsrc/os_q.c **** {
 411               	.LM52:
 412               	/* prologue: frame size=0 */
 413 012c FF92      		push r15
 414 012e 0F93      		push r16
 415 0130 1F93      		push r17
 416 0132 CF93      		push r28
 417 0134 DF93      		push r29
 418               	/* prologue end (size=5) */
 419 0136 EC01      		movw r28,r24
 420 0138 8A01      		movw r16,r20
 214:../OSsrc/os_q.c ****     BOOLEAN    tasks_waiting;
 215:../OSsrc/os_q.c ****     OS_EVENT  *pevent_return;
 216:../OSsrc/os_q.c ****     OS_Q      *pq;
 217:../OSsrc/os_q.c **** #if OS_CRITICAL_METHOD == 3                                /* Allocate storage for CPU status regis
 218:../OSsrc/os_q.c ****     OS_CPU_SR  cpu_sr = 0;
 219:../OSsrc/os_q.c **** #endif
 220:../OSsrc/os_q.c **** 
 221:../OSsrc/os_q.c **** 
 222:../OSsrc/os_q.c **** 
 223:../OSsrc/os_q.c **** #if OS_ARG_CHK_EN > 0
 224:../OSsrc/os_q.c ****     if (perr == (INT8U *)0) {                              /* Validate 'perr'                      
 422               	.LM53:
 423 013a 452B      		or r20,r21
 424 013c 09F4      		brne .+2
 425 013e 78C0      		rjmp .L34
 225:../OSsrc/os_q.c ****         return (pevent);
 226:../OSsrc/os_q.c ****     }
 227:../OSsrc/os_q.c ****     if (pevent == (OS_EVENT *)0) {                         /* Validate 'pevent'                    
 427               	.LM54:
 428 0140 892B      		or r24,r25
 429 0142 11F4      		brne .L16
 228:../OSsrc/os_q.c ****         *perr = OS_ERR_PEVENT_NULL;
 431               	.LM55:
 432 0144 84E0      		ldi r24,lo8(4)
 433 0146 72C0      		rjmp .L33
 434               	.L16:
 229:../OSsrc/os_q.c ****         return (pevent);
 230:../OSsrc/os_q.c ****     }
 231:../OSsrc/os_q.c **** #endif
 232:../OSsrc/os_q.c ****     if (pevent->OSEventType != OS_EVENT_TYPE_Q) {          /* Validate event block type            
 436               	.LM56:
 437 0148 8881      		ld r24,Y
 438 014a 8230      		cpi r24,lo8(2)
 439 014c 11F0      		breq .L17
 233:../OSsrc/os_q.c ****         *perr = OS_ERR_EVENT_TYPE;
 441               	.LM57:
 442 014e 81E0      		ldi r24,lo8(1)
 443 0150 6DC0      		rjmp .L33
 444               	.L17:
 234:../OSsrc/os_q.c ****         return (pevent);
 235:../OSsrc/os_q.c ****     }
 236:../OSsrc/os_q.c ****     if (OSIntNesting > 0) {                                /* See if called from ISR ...           
 446               	.LM58:
 447 0152 8091 0000 		lds r24,OSIntNesting
 448 0156 8823      		tst r24
 449 0158 11F0      		breq .L18
 237:../OSsrc/os_q.c ****         *perr = OS_ERR_DEL_ISR;                            /* ... can't DELETE from an ISR         
 451               	.LM59:

⌨️ 快捷键说明

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