?? os_mbox.lst
字號(hào):
\ 00000094 8046 MOV R8,R0
335 switch (OSTCBCur->OSTCBStatPend) { /* See if we timed-out or aborted */
\ 00000096 .... LDR.N R0,??DataTable3_4
\ 00000098 0068 LDR R0,[R0, #+0]
\ 0000009A 90F83500 LDRB R0,[R0, #+53]
\ 0000009E 0028 CMP R0,#+0
\ 000000A0 02D0 BEQ.N ??OSMboxPend_5
\ 000000A2 0228 CMP R0,#+2
\ 000000A4 07D0 BEQ.N ??OSMboxPend_6
\ 000000A6 0BE0 B.N ??OSMboxPend_7
336 case OS_STAT_PEND_OK:
337 pmsg = OSTCBCur->OSTCBMsg;
\ ??OSMboxPend_5:
\ 000000A8 .... LDR.N R0,??DataTable3_4
\ 000000AA 0068 LDR R0,[R0, #+0]
\ 000000AC 406A LDR R0,[R0, #+36]
\ 000000AE 0700 MOVS R7,R0
338 *perr = OS_ERR_NONE;
\ 000000B0 0020 MOVS R0,#+0
\ 000000B2 3070 STRB R0,[R6, #+0]
339 break;
\ 000000B4 0DE0 B.N ??OSMboxPend_8
340
341 case OS_STAT_PEND_ABORT:
342 pmsg = (void *)0;
\ ??OSMboxPend_6:
\ 000000B6 0020 MOVS R0,#+0
\ 000000B8 0700 MOVS R7,R0
343 *perr = OS_ERR_PEND_ABORT; /* Indicate that we aborted */
\ 000000BA 0E20 MOVS R0,#+14
\ 000000BC 3070 STRB R0,[R6, #+0]
344 break;
\ 000000BE 08E0 B.N ??OSMboxPend_8
345
346 case OS_STAT_PEND_TO:
347 default:
348 OS_EventTaskRemove(OSTCBCur, pevent);
\ ??OSMboxPend_7:
\ 000000C0 2100 MOVS R1,R4
\ 000000C2 .... LDR.N R0,??DataTable3_4
\ 000000C4 0068 LDR R0,[R0, #+0]
\ 000000C6 ........ BL OS_EventTaskRemove
349 pmsg = (void *)0;
\ 000000CA 0020 MOVS R0,#+0
\ 000000CC 0700 MOVS R7,R0
350 *perr = OS_ERR_TIMEOUT; /* Indicate that we didn't get event within TO */
\ 000000CE 0A20 MOVS R0,#+10
\ 000000D0 3070 STRB R0,[R6, #+0]
351 break;
352 }
353 OSTCBCur->OSTCBStat = OS_STAT_RDY; /* Set task status to ready */
\ ??OSMboxPend_8:
\ 000000D2 .... LDR.N R0,??DataTable3_4
\ 000000D4 0068 LDR R0,[R0, #+0]
\ 000000D6 0021 MOVS R1,#+0
\ 000000D8 80F83410 STRB R1,[R0, #+52]
354 OSTCBCur->OSTCBStatPend = OS_STAT_PEND_OK; /* Clear pend status */
\ 000000DC .... LDR.N R0,??DataTable3_4
\ 000000DE 0068 LDR R0,[R0, #+0]
\ 000000E0 0021 MOVS R1,#+0
\ 000000E2 80F83510 STRB R1,[R0, #+53]
355 OSTCBCur->OSTCBEventPtr = (OS_EVENT *)0; /* Clear event pointers */
\ 000000E6 .... LDR.N R0,??DataTable3_4
\ 000000E8 0068 LDR R0,[R0, #+0]
\ 000000EA 0021 MOVS R1,#+0
\ 000000EC C161 STR R1,[R0, #+28]
356 #if (OS_EVENT_MULTI_EN > 0u)
357 OSTCBCur->OSTCBEventMultiPtr = (OS_EVENT **)0;
\ 000000EE .... LDR.N R0,??DataTable3_4
\ 000000F0 0068 LDR R0,[R0, #+0]
\ 000000F2 0021 MOVS R1,#+0
\ 000000F4 0162 STR R1,[R0, #+32]
358 #endif
359 OSTCBCur->OSTCBMsg = (void *)0; /* Clear received message */
\ 000000F6 .... LDR.N R0,??DataTable3_4
\ 000000F8 0068 LDR R0,[R0, #+0]
\ 000000FA 0021 MOVS R1,#+0
\ 000000FC 4162 STR R1,[R0, #+36]
360 OS_EXIT_CRITICAL();
\ 000000FE 4046 MOV R0,R8
\ 00000100 ........ BL OS_CPU_SR_Restore
361 return (pmsg); /* Return received message */
\ 00000104 3800 MOVS R0,R7
\ ??OSMboxPend_1:
\ 00000106 BDE8F081 POP {R4-R8,PC} ;; return
362 }
363 /*$PAGE*/
364 /*
365 *********************************************************************************************************
366 * ABORT WAITING ON A MESSAGE MAILBOX
367 *
368 * Description: This function aborts & readies any tasks currently waiting on a mailbox. This function
369 * should be used to fault-abort the wait on the mailbox, rather than to normally signal
370 * the mailbox via OSMboxPost() or OSMboxPostOpt().
371 *
372 * Arguments : pevent is a pointer to the event control block associated with the desired mailbox.
373 *
374 * opt determines the type of ABORT performed:
375 * OS_PEND_OPT_NONE ABORT wait for a single task (HPT) waiting on the
376 * mailbox
377 * OS_PEND_OPT_BROADCAST ABORT wait for ALL tasks that are waiting on the
378 * mailbox
379 *
380 * perr is a pointer to where an error message will be deposited. Possible error
381 * messages are:
382 *
383 * OS_ERR_NONE No tasks were waiting on the mailbox.
384 * OS_ERR_PEND_ABORT At least one task waiting on the mailbox was readied
385 * and informed of the aborted wait; check return value
386 * for the number of tasks whose wait on the mailbox
387 * was aborted.
388 * OS_ERR_EVENT_TYPE If you didn't pass a pointer to a mailbox.
389 * OS_ERR_PEVENT_NULL If 'pevent' is a NULL pointer.
390 *
391 * Returns : == 0 if no tasks were waiting on the mailbox, or upon error.
392 * > 0 if one or more tasks waiting on the mailbox are now readied and informed.
393 *********************************************************************************************************
394 */
395
396 #if OS_MBOX_PEND_ABORT_EN > 0u
\ In section .text, align 2, keep-with-next
397 INT8U OSMboxPendAbort (OS_EVENT *pevent,
398 INT8U opt,
399 INT8U *perr)
400 {
\ OSMboxPendAbort:
\ 00000000 2DE9F041 PUSH {R4-R8,LR}
\ 00000004 0400 MOVS R4,R0
\ 00000006 0D00 MOVS R5,R1
\ 00000008 1600 MOVS R6,R2
401 INT8U nbr_tasks;
402 #if OS_CRITICAL_METHOD == 3u /* Allocate storage for CPU status register */
403 OS_CPU_SR cpu_sr = 0u;
\ 0000000A 5FF00008 MOVS R8,#+0
404 #endif
405
406
407
408 #ifdef OS_SAFETY_CRITICAL
409 if (perr == (INT8U *)0) {
410 OS_SAFETY_CRITICAL_EXCEPTION();
411 return (0u);
412 }
413 #endif
414
415 #if OS_ARG_CHK_EN > 0u
416 if (pevent == (OS_EVENT *)0) { /* Validate 'pevent' */
417 *perr = OS_ERR_PEVENT_NULL;
418 return (0u);
419 }
420 #endif
421 if (pevent->OSEventType != OS_EVENT_TYPE_MBOX) { /* Validate event block type */
\ 0000000E 2078 LDRB R0,[R4, #+0]
\ 00000010 0128 CMP R0,#+1
\ 00000012 03D0 BEQ.N ??OSMboxPendAbort_0
422 *perr = OS_ERR_EVENT_TYPE;
\ 00000014 0120 MOVS R0,#+1
\ 00000016 3070 STRB R0,[R6, #+0]
423 return (0u);
\ 00000018 0020 MOVS R0,#+0
\ 0000001A 2DE0 B.N ??OSMboxPendAbort_1
424 }
425 OS_ENTER_CRITICAL();
\ ??OSMboxPendAbort_0:
\ 0000001C ........ BL OS_CPU_SR_Save
\ 00000020 8046 MOV R8,R0
426 if (pevent->OSEventGrp != 0u) { /* See if any task waiting on mailbox? */
\ 00000022 A07A LDRB R0,[R4, #+10]
\ 00000024 0028 CMP R0,#+0
\ 00000026 21D0 BEQ.N ??OSMboxPendAbort_2
427 nbr_tasks = 0u;
\ 00000028 0020 MOVS R0,#+0
\ 0000002A 0700 MOVS R7,R0
428 switch (opt) {
\ 0000002C EDB2 UXTB R5,R5 ;; ZeroExt R5,R5,#+24,#+24
\ 0000002E 012D CMP R5,#+1
\ 00000030 0BD1 BNE.N ??OSMboxPendAbort_3
429 case OS_PEND_OPT_BROADCAST: /* Do we need to abort ALL waiting tasks? */
430 while (pevent->OSEventGrp != 0u) { /* Yes, ready ALL tasks waiting on mailbox */
\ ??OSMboxPendAbort_4:
\ 00000032 A07A LDRB R0,[R4, #+10]
\ 00000034 0028 CMP R0,#+0
\ 00000036 07D0 BEQ.N ??OSMboxPendAbort_5
431 (void)OS_EventTaskRdy(pevent, (void *)0, OS_STAT_MBOX, OS_STAT_PEND_ABORT);
\ 00000038 0223 MOVS R3,#+2
\ 0000003A 0222 MOVS R2,#+2
\ 0000003C 0021 MOVS R1,#+0
\ 0000003E 2000 MOVS R0,R4
\ 00000040 ........ BL OS_EventTaskRdy
432 nbr_tasks++;
\ 00000044 7F1C ADDS R7,R7,#+1
\ 00000046 F4E7 B.N ??OSMboxPendAbort_4
433 }
434 break;
\ ??OSMboxPendAbort_5:
\ 00000048 06E0 B.N ??OSMboxPendAbort_6
435
436 case OS_PEND_OPT_NONE:
437 default: /* No, ready HPT waiting on mailbox */
438 (void)OS_EventTaskRdy(pevent, (void *)0, OS_STAT_MBOX, OS_STAT_PEND_ABORT);
\ ??OSMboxPendAbort_3:
\ 0000004A 0223 MOVS R3,#+2
\ 0000004C 0222 MOVS R2,#+2
\ 0000004E 0021 MOVS R1,#+0
\ 00000050 2000 MOVS R0,R4
\ 00000052 ........ BL OS_EventTaskRdy
439 nbr_tasks++;
\ 00000056 7F1C ADDS R7,R7,#+1
440 break;
441 }
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -