📄 os_mbox.txt
字号:
0005f0 eafffff4 B |L1.1480|
|L1.1524|
0005f4 ebfffffe BL OS_CPU_SR_Save
0005f8 e1a06000 MOV r6,r0
0005fc e5d4000a LDRB r0,[r4,#0xa]
000600 e3500000 CMP r0,#0
000604 0a000009 BEQ |L1.1584|
000608 e3a03000 MOV r3,#0
00060c e3a02002 MOV r2,#2
000610 e1a01005 MOV r1,r5
000614 e1a00004 MOV r0,r4
000618 ebfffffe BL OS_EventTaskRdy
00061c e1a00006 MOV r0,r6
000620 ebfffffe BL OS_CPU_SR_Restore
000624 ebfffffe BL OS_Sched
000628 e3a00000 MOV r0,#0
00062c eaffffe5 B |L1.1480|
|L1.1584|
000630 e5940004 LDR r0,[r4,#4]
000634 e3500000 CMP r0,#0
000638 0a000003 BEQ |L1.1612|
00063c e1a00006 MOV r0,r6
000640 ebfffffe BL OS_CPU_SR_Restore
000644 e3a00014 MOV r0,#0x14
000648 eaffffde B |L1.1480|
|L1.1612|
00064c e5845004 STR r5,[r4,#4]
000650 e1a00006 MOV r0,r6
000654 ebfffffe BL OS_CPU_SR_Restore
000658 e3a00000 MOV r0,#0
00065c eaffffd9 B |L1.1480|
ENDP
OSMboxPostOpt PROC
;;;523 INT8U OSMboxPostOpt (OS_EVENT *pevent, void *msg, INT8U opt)
;;;524 {
000660 e92d41f0 PUSH {r4-r8,lr}
000664 e1a04000 MOV r4,r0
000668 e1a05001 MOV r5,r1
00066c e1a06002 MOV r6,r2
;;;525 #if OS_CRITICAL_METHOD == 3 /* Allocate storage for CPU status register */
;;;526 OS_CPU_SR cpu_sr = 0;
000670 e3a07000 MOV r7,#0
;;;527 #endif
;;;528
;;;529
;;;530
;;;531 #if OS_ARG_CHK_EN > 0
;;;532 if (pevent == (OS_EVENT *)0) { /* Validate 'pevent' */
000674 e3540000 CMP r4,#0
000678 1a000002 BNE |L1.1672|
;;;533 return (OS_ERR_PEVENT_NULL);
00067c e3a00004 MOV r0,#4
|L1.1664|
000680 e8bd41f0 POP {r4-r8,lr}
;;;534 }
;;;535 if (msg == (void *)0) { /* Make sure we are not posting a NULL pointer */
;;;536 return (OS_ERR_POST_NULL_PTR);
;;;537 }
;;;538 #endif
;;;539 if (pevent->OSEventType != OS_EVENT_TYPE_MBOX) { /* Validate event block type */
;;;540 return (OS_ERR_EVENT_TYPE);
;;;541 }
;;;542 OS_ENTER_CRITICAL();
;;;543 if (pevent->OSEventGrp != 0) { /* See if any task pending on mailbox */
;;;544 if ((opt & OS_POST_OPT_BROADCAST) != 0x00) { /* Do we need to post msg to ALL waiting tasks ? */
;;;545 while (pevent->OSEventGrp != 0) { /* Yes, Post to ALL tasks waiting on mailbox */
;;;546 (void)OS_EventTaskRdy(pevent, msg, OS_STAT_MBOX, OS_STAT_PEND_OK);
;;;547 }
;;;548 } else { /* No, Post to HPT waiting on mbox */
;;;549 (void)OS_EventTaskRdy(pevent, msg, OS_STAT_MBOX, OS_STAT_PEND_OK);
;;;550 }
;;;551 OS_EXIT_CRITICAL();
;;;552 if ((opt & OS_POST_OPT_NO_SCHED) == 0) { /* See if scheduler needs to be invoked */
;;;553 OS_Sched(); /* Find HPT ready to run */
;;;554 }
;;;555 return (OS_ERR_NONE);
;;;556 }
;;;557 if (pevent->OSEventPtr != (void *)0) { /* Make sure mailbox doesn't already have a msg */
;;;558 OS_EXIT_CRITICAL();
;;;559 return (OS_ERR_MBOX_FULL);
;;;560 }
;;;561 pevent->OSEventPtr = msg; /* Place message in mailbox */
;;;562 OS_EXIT_CRITICAL();
;;;563 return (OS_ERR_NONE);
;;;564 }
000684 e12fff1e BX lr
|L1.1672|
000688 e3550000 CMP r5,#0
00068c 1a000001 BNE |L1.1688|
000690 e3a00003 MOV r0,#3
000694 eafffff9 B |L1.1664|
|L1.1688|
000698 e5d40000 LDRB r0,[r4,#0]
00069c e3500001 CMP r0,#1
0006a0 0a000001 BEQ |L1.1708|
0006a4 e3a00001 MOV r0,#1
0006a8 eafffff4 B |L1.1664|
|L1.1708|
0006ac ebfffffe BL OS_CPU_SR_Save
0006b0 e1a07000 MOV r7,r0
0006b4 e5d4000a LDRB r0,[r4,#0xa]
0006b8 e3500000 CMP r0,#0
0006bc 0a000017 BEQ |L1.1824|
0006c0 e3160001 TST r6,#1
0006c4 0a000009 BEQ |L1.1776|
0006c8 ea000004 B |L1.1760|
|L1.1740|
0006cc e3a03000 MOV r3,#0
0006d0 e3a02002 MOV r2,#2
0006d4 e1a01005 MOV r1,r5
0006d8 e1a00004 MOV r0,r4
0006dc ebfffffe BL OS_EventTaskRdy
|L1.1760|
0006e0 e5d4000a LDRB r0,[r4,#0xa]
0006e4 e3500000 CMP r0,#0
0006e8 1afffff7 BNE |L1.1740|
0006ec ea000004 B |L1.1796|
|L1.1776|
0006f0 e3a03000 MOV r3,#0
0006f4 e3a02002 MOV r2,#2
0006f8 e1a01005 MOV r1,r5
0006fc e1a00004 MOV r0,r4
000700 ebfffffe BL OS_EventTaskRdy
|L1.1796|
000704 e1a00007 MOV r0,r7
000708 ebfffffe BL OS_CPU_SR_Restore
00070c e3160004 TST r6,#4
000710 1a000000 BNE |L1.1816|
000714 ebfffffe BL OS_Sched
|L1.1816|
000718 e3a00000 MOV r0,#0
00071c eaffffd7 B |L1.1664|
|L1.1824|
000720 e5940004 LDR r0,[r4,#4]
000724 e3500000 CMP r0,#0
000728 0a000003 BEQ |L1.1852|
00072c e1a00007 MOV r0,r7
000730 ebfffffe BL OS_CPU_SR_Restore
000734 e3a00014 MOV r0,#0x14
000738 eaffffd0 B |L1.1664|
|L1.1852|
00073c e5845004 STR r5,[r4,#4]
000740 e1a00007 MOV r0,r7
000744 ebfffffe BL OS_CPU_SR_Restore
000748 e3a00000 MOV r0,#0
00074c eaffffcb B |L1.1664|
ENDP
OSMboxQuery PROC
;;;587 INT8U OSMboxQuery (OS_EVENT *pevent, OS_MBOX_DATA *p_mbox_data)
;;;588 {
000750 e92d47f0 PUSH {r4-r10,lr}
000754 e1a04000 MOV r4,r0
000758 e1a05001 MOV r5,r1
;;;589 INT8U i;
;;;590 #if OS_LOWEST_PRIO <= 63
;;;591 INT8U *psrc;
;;;592 INT8U *pdest;
;;;593 #else
;;;594 INT16U *psrc;
;;;595 INT16U *pdest;
;;;596 #endif
;;;597 #if OS_CRITICAL_METHOD == 3 /* Allocate storage for CPU status register */
;;;598 OS_CPU_SR cpu_sr = 0;
00075c e3a09000 MOV r9,#0
;;;599 #endif
;;;600
;;;601
;;;602
;;;603 #if OS_ARG_CHK_EN > 0
;;;604 if (pevent == (OS_EVENT *)0) { /* Validate 'pevent' */
000760 e3540000 CMP r4,#0
000764 1a000002 BNE |L1.1908|
;;;605 return (OS_ERR_PEVENT_NULL);
000768 e3a00004 MOV r0,#4
|L1.1900|
00076c e8bd47f0 POP {r4-r10,lr}
;;;606 }
;;;607 if (p_mbox_data == (OS_MBOX_DATA *)0) { /* Validate 'p_mbox_data' */
;;;608 return (OS_ERR_PDATA_NULL);
;;;609 }
;;;610 #endif
;;;611 if (pevent->OSEventType != OS_EVENT_TYPE_MBOX) { /* Validate event block type */
;;;612 return (OS_ERR_EVENT_TYPE);
;;;613 }
;;;614 OS_ENTER_CRITICAL();
;;;615 p_mbox_data->OSEventGrp = pevent->OSEventGrp; /* Copy message mailbox wait list */
;;;616 psrc = &pevent->OSEventTbl[0];
;;;617 pdest = &p_mbox_data->OSEventTbl[0];
;;;618 for (i = 0; i < OS_EVENT_TBL_SIZE; i++) {
;;;619 *pdest++ = *psrc++;
;;;620 }
;;;621 p_mbox_data->OSMsg = pevent->OSEventPtr; /* Get message from mailbox */
;;;622 OS_EXIT_CRITICAL();
;;;623 return (OS_ERR_NONE);
;;;624 }
000770 e12fff1e BX lr
|L1.1908|
000774 e3550000 CMP r5,#0
000778 1a000001 BNE |L1.1924|
00077c e3a00009 MOV r0,#9
000780 eafffff9 B |L1.1900|
|L1.1924|
000784 e5d40000 LDRB r0,[r4,#0]
000788 e3500001 CMP r0,#1
00078c 0a000001 BEQ |L1.1944|
000790 e3a00001 MOV r0,#1
000794 eafffff4 B |L1.1900|
|L1.1944|
000798 ebfffffe BL OS_CPU_SR_Save
00079c e1a09000 MOV r9,r0
0007a0 e5d4000a LDRB r0,[r4,#0xa]
0007a4 e5c50008 STRB r0,[r5,#8]
0007a8 e284700b ADD r7,r4,#0xb
0007ac e2858004 ADD r8,r5,#4
0007b0 e3a06000 MOV r6,#0
0007b4 ea000003 B |L1.1992|
|L1.1976|
0007b8 e4d70001 LDRB r0,[r7],#1
0007bc e4c80001 STRB r0,[r8],#1
0007c0 e2860001 ADD r0,r6,#1
0007c4 e20060ff AND r6,r0,#0xff
|L1.1992|
0007c8 e3560004 CMP r6,#4
0007cc bafffff9 BLT |L1.1976|
0007d0 e5940004 LDR r0,[r4,#4]
0007d4 e5850000 STR r0,[r5,#0]
0007d8 e1a00009 MOV r0,r9
0007dc ebfffffe BL OS_CPU_SR_Restore
0007e0 e3a00000 MOV r0,#0
0007e4 eaffffe0 B |L1.1900|
ENDP
|L1.2024|
0007e8 00000000 DCD OSIntNesting
|L1.2028|
0007ec 00000000 DCD OSEventFreeList
|L1.2032|
0007f0 00000000 DCD OSLockNesting
|L1.2036|
0007f4 00000000 DCD OSTCBCur
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -