📄 os_mbox.lst
字号:
\ 0000009C 0600 MOVS R6,R0
320 if (OSTCBCur->OSTCBStatPend != OS_STAT_PEND_OK) { /* See if we weren't given the message */
\ 0000009E DAF80000 LDR R0,[R10, #+0]
\ 000000A2 2030 ADDS R0,R0,#+32
\ 000000A4 417B LDRB R1,[R0, #+13]
\ 000000A6 0029 CMP R1,#+0
\ 000000A8 0ED0 BEQ.N ??OSMboxPend_9
321 pend_stat = OSTCBCur->OSTCBStatPend;
\ 000000AA 0F46 MOV R7,R1
322 OS_EventTOAbort(pevent); /* Timed out, Make task ready */
\ 000000AC 2000 MOVS R0,R4
\ 000000AE ........ _BLF OS_EventTOAbort,??OS_EventTOAbort??rT
323 OS_EXIT_CRITICAL();
\ 000000B2 3000 MOVS R0,R6
\ 000000B4 ........ _BLF OS_CPU_SR_Restore,??OS_CPU_SR_Restore??rT
324 switch (pend_stat) {
\ 000000B8 022F CMP R7,#+2
\ 000000BA 02D0 BEQ.N ??OSMboxPend_10
325 case OS_STAT_PEND_TO:
326 default:
327 *perr = OS_ERR_TIMEOUT; /* Indicate that a timeout occured */
\ 000000BC 0A20 MOVS R0,#+10
\ 000000BE 2870 STRB R0,[R5, #+0]
\ 000000C0 A4E7 B.N ??OSMboxPend_1
328 break;
329
330 case OS_STAT_PEND_ABORT:
331 *perr = OS_ERR_PEND_ABORT; /* Indicate that we aborted */
\ ??OSMboxPend_10:
\ 000000C2 0E20 MOVS R0,#+14
\ 000000C4 2870 STRB R0,[R5, #+0]
\ 000000C6 A1E7 B.N ??OSMboxPend_1
332 break;
333 }
334 return ((void *)0); /* Return a NULL message */
335 }
336 pmsg = OSTCBCur->OSTCBMsg;
\ ??OSMboxPend_9:
\ 000000C8 0168 LDR R1,[R0, #+0]
\ 000000CA 8946 MOV R9,R1
337 OSTCBCur->OSTCBMsg = (void *)0; /* Yes, clear message received */
\ 000000CC 0760 STR R7,[R0, #+0]
338 OSTCBCur->OSTCBStat = OS_STAT_RDY;
\ 000000CE DAF80000 LDR R0,[R10, #+0]
\ 000000D2 2C30 ADDS R0,R0,#+44
\ 000000D4 3900 MOVS R1,R7
\ 000000D6 0170 STRB R1,[R0, #+0]
339 OSTCBCur->OSTCBEventPtr = (OS_EVENT *)0; /* No longer waiting for event */
\ 000000D8 DAF80000 LDR R0,[R10, #+0]
\ 000000DC C761 STR R7,[R0, #+28]
340 OS_EXIT_CRITICAL();
\ 000000DE 3000 MOVS R0,R6
\ 000000E0 ........ _BLF OS_CPU_SR_Restore,??OS_CPU_SR_Restore??rT
341 *perr = OS_ERR_NONE;
\ 000000E4 2F70 STRB R7,[R5, #+0]
342 return (pmsg); /* Return the message received */
\ 000000E6 4846 MOV R0,R9
\ ??OSMboxPend_2:
\ 000000E8 BDE8F087 POP {R4-R10,PC} ;; return
\ ??OSMboxPend_6:
\ 000000EC ........ DC32 OSLockNesting
\ 000000F0 ........ DC32 OSTCBCur
343 }
344 /*$PAGE*/
345 /*
346 *********************************************************************************************************
347 * ABORT WAITING ON A MESSAGE MAILBOX
348 *
349 * Description: This function aborts & readies any tasks currently waiting on a mailbox. This function
350 * should be used to fault-abort the wait on the mailbox, rather than to normally signal
351 * the mailbox via OSMboxPost() or OSMboxPostOpt().
352 *
353 * Arguments : pevent is a pointer to the event control block associated with the desired mailbox.
354 *
355 * opt determines the type of ABORT performed:
356 * OS_PEND_OPT_NONE ABORT wait for a single task (HPT) waiting on the
357 * mailbox
358 * OS_PEND_OPT_BROADCAST ABORT wait for ALL tasks that are waiting on the
359 * mailbox
360 *
361 * perr is a pointer to where an error message will be deposited. Possible error
362 * messages are:
363 *
364 * OS_ERR_NONE No tasks were waiting on the mailbox.
365 * OS_ERR_PEND_ABORT At least one task waiting on the mailbox was readied
366 * and informed of the aborted wait; check return value
367 * for the number of tasks whose wait on the mailbox
368 * was aborted.
369 * OS_ERR_EVENT_TYPE If you didn't pass a pointer to a mailbox.
370 * OS_ERR_PEVENT_NULL If 'pevent' is a NULL pointer.
371 *
372 * Returns : == 0 if no tasks were waiting on the mailbox, or upon error.
373 * > 0 if one or more tasks waiting on the mailbox are now readied and informed.
374 *********************************************************************************************************
375 */
376
377 #if OS_MBOX_PEND_ABORT_EN > 0
\ In segment CODE, align 4, keep-with-next
378 INT8U OSMboxPendAbort (OS_EVENT *pevent, INT8U opt, INT8U *perr)
379 {
\ OSMboxPendAbort:
\ 00000000 2DE9F043 PUSH {R4-R9,LR}
\ 00000004 8846 MOV R8,R1
\ 00000006 0400 MOVS R4,R0
\ 00000008 1500 MOVS R5,R2
380 INT8U nbr_tasks;
381 #if OS_CRITICAL_METHOD == 3 /* Allocate storage for CPU status register */
382 OS_CPU_SR cpu_sr = 0;
383 #endif
384
385
386
387 #if OS_ARG_CHK_EN > 0
388 if (perr == (INT8U *)0) { /* Validate 'perr' */
\ 0000000A 02D1 BNE.N ??OSMboxPendAbort_0
389 return (0);
\ ??OSMboxPendAbort_1:
\ 0000000C 0020 MOVS R0,#+0
\ ??OSMboxPendAbort_2:
\ 0000000E BDE8F083 POP {R4-R9,PC} ;; return
390 }
391 if (pevent == (OS_EVENT *)0) { /* Validate 'pevent' */
\ ??OSMboxPendAbort_0:
\ 00000012 002C CMP R4,#+0
\ 00000014 02D1 BNE.N ??OSMboxPendAbort_3
392 *perr = OS_ERR_PEVENT_NULL;
\ 00000016 0420 MOVS R0,#+4
\ 00000018 2870 STRB R0,[R5, #+0]
\ 0000001A F7E7 B.N ??OSMboxPendAbort_1
393 return (0);
394 }
395 #endif
396 if (pevent->OSEventType != OS_EVENT_TYPE_MBOX) { /* Validate event block type */
\ ??OSMboxPendAbort_3:
\ 0000001C 0120 MOVS R0,#+1
\ 0000001E 8146 MOV R9,R0
\ 00000020 2078 LDRB R0,[R4, #+0]
\ 00000022 0128 CMP R0,#+1
\ 00000024 02D0 BEQ.N ??OSMboxPendAbort_4
397 *perr = OS_ERR_EVENT_TYPE;
\ 00000026 4846 MOV R0,R9
\ 00000028 2870 STRB R0,[R5, #+0]
\ 0000002A EFE7 B.N ??OSMboxPendAbort_1
398 return (0);
399 }
400 OS_ENTER_CRITICAL();
\ ??OSMboxPendAbort_4:
\ 0000002C ........ _BLF OS_CPU_SR_Save,??OS_CPU_SR_Save??rT
\ 00000030 0600 MOVS R6,R0
401 if (pevent->OSEventGrp != 0) { /* See if any task waiting on mailbox? */
\ 00000032 0027 MOVS R7,#+0
\ 00000034 A07A LDRB R0,[R4, #+10]
\ 00000036 0028 CMP R0,#+0
\ 00000038 1ED0 BEQ.N ??OSMboxPendAbort_5
402 nbr_tasks = 0;
403 switch (opt) {
\ 0000003A 4046 MOV R0,R8
\ 0000003C 0128 CMP R0,#+1
\ 0000003E 0BD1 BNE.N ??OSMboxPendAbort_6
404 case OS_PEND_OPT_BROADCAST: /* Do we need to abort ALL waiting tasks? */
405 while (pevent->OSEventGrp != 0) { /* Yes, ready ALL tasks waiting on mailbox */
\ ??OSMboxPendAbort_7:
\ 00000040 A07A LDRB R0,[R4, #+10]
\ 00000042 0028 CMP R0,#+0
\ 00000044 0FD0 BEQ.N ??OSMboxPendAbort_8
406 (void)OS_EventTaskRdy(pevent, (void *)0, OS_STAT_MBOX, OS_STAT_PEND_ABORT);
\ 00000046 0223 MOVS R3,#+2
\ 00000048 1A46 MOV R2,R3
\ 0000004A 0021 MOVS R1,#+0
\ 0000004C 2000 MOVS R0,R4
\ 0000004E ........ _BLF OS_EventTaskRdy,??OS_EventTaskRdy??rT
407 nbr_tasks++;
\ 00000052 7F1C ADDS R7,R7,#+1
\ 00000054 FFB2 UXTB R7,R7
\ 00000056 F3E7 B.N ??OSMboxPendAbort_7
408 }
409 break;
410
411 case OS_PEND_OPT_NONE: /* No, ready HPT waiting on mailbox */
412 default:
413 (void)OS_EventTaskRdy(pevent, (void *)0, OS_STAT_MBOX, OS_STAT_PEND_ABORT);
\ ??OSMboxPendAbort_6:
\ 00000058 0223 MOVS R3,#+2
\ 0000005A 1A46 MOV R2,R3
\ 0000005C 3946 MOV R1,R7
\ 0000005E 2000 MOVS R0,R4
\ 00000060 ........ _BLF OS_EventTaskRdy,??OS_EventTaskRdy??rT
414 nbr_tasks++;
\ 00000064 4F46 MOV R7,R9
415 break;
416 }
417 OS_EXIT_CRITICAL();
\ ??OSMboxPendAbort_8:
\ 00000066 3000 MOVS R0,R6
\ 00000068 ........ _BLF OS_CPU_SR_Restore,??OS_CPU_SR_Restore??rT
418 OS_Sched(); /* Find HPT ready to run */
\ 0000006C ........ _BLF OS_Sched,??OS_Sched??rT
419 *perr = OS_ERR_PEND_ABORT;
\ 00000070 0E20 MOVS R0,#+14
\ 00000072 2870 STRB R0,[R5, #+0]
420 return (nbr_tasks);
\ 00000074 3800 MOVS R0,R7
\ 00000076 CAE7 B.N ??OSMboxPendAbort_2
421 }
422 OS_EXIT_CRITICAL();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -