⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 os_mbox.lst

📁 IARSOURCECODE是基于LPC2478嵌入式软件IAR EWARM V4.42的应用实例代码
💻 LST
📖 第 1 页 / 共 5 页
字号:
   \   000000B8   ........           _BLF     OS_CPU_SR_Restore,??OS_CPU_SR_Restore??rA
    310                  *err = OS_ERR_NONE;
   \   000000BC   0000A0E3           MOV      R0,#+0
   \   000000C0   0000C4E5           STRB     R0,[R4, #+0]
    311                  return (msg);                                 /* Return the message received (or NULL)         */
   \   000000C4   0800B0E1           MOVS     R0,R8
   \   000000C8   3D0000EA           B        ??OSMboxPend_1
    312              }
    313              OSTCBCur->OSTCBStat     |= OS_STAT_MBOX;          /* Message not available, task will pend         */
   \                     ??OSMboxPend_7:
   \   000000CC   F8009FE5           LDR      R0,??OSMboxPend_5+0x4  ;; OSTCBCur
   \   000000D0   000090E5           LDR      R0,[R0, #+0]
   \   000000D4   F0109FE5           LDR      R1,??OSMboxPend_5+0x4  ;; OSTCBCur
   \   000000D8   001091E5           LDR      R1,[R1, #+0]
   \   000000DC   2C10D1E5           LDRB     R1,[R1, #+44]
   \   000000E0   021091E3           ORRS     R1,R1,#0x2
   \   000000E4   2C10C0E5           STRB     R1,[R0, #+44]
    314              OSTCBCur->OSTCBStatPend  = OS_STAT_PEND_OK;
   \   000000E8   DC009FE5           LDR      R0,??OSMboxPend_5+0x4  ;; OSTCBCur
   \   000000EC   000090E5           LDR      R0,[R0, #+0]
   \   000000F0   0010A0E3           MOV      R1,#+0
   \   000000F4   2D10C0E5           STRB     R1,[R0, #+45]
    315              OSTCBCur->OSTCBDly       = timeout;               /* Load timeout in TCB                           */
   \   000000F8   CC009FE5           LDR      R0,??OSMboxPend_5+0x4  ;; OSTCBCur
   \   000000FC   000090E5           LDR      R0,[R0, #+0]
   \   00000100   BA62C0E1           STRH     R6,[R0, #+42]
    316              OS_EventTaskWait(pevent);                         /* Suspend task until event or timeout occurs    */
   \   00000104   0500B0E1           MOVS     R0,R5
   \   00000108   ........           _BLF     OS_EventTaskWait,??OS_EventTaskWait??rA
    317              OS_EXIT_CRITICAL();
   \   0000010C   0700B0E1           MOVS     R0,R7
   \   00000110   ........           _BLF     OS_CPU_SR_Restore,??OS_CPU_SR_Restore??rA
    318              OS_Sched();                                       /* Find next highest priority task ready to run  */
   \   00000114   ........           _BLF     OS_Sched,??OS_Sched??rA
    319              OS_ENTER_CRITICAL();
   \   00000118   ........           _BLF     OS_CPU_SR_Save,??OS_CPU_SR_Save??rA
   \   0000011C   0070B0E1           MOVS     R7,R0
    320              if (OSTCBCur->OSTCBStatPend != OS_STAT_PEND_OK) { /* See if we weren't given the message           */
   \   00000120   A4009FE5           LDR      R0,??OSMboxPend_5+0x4  ;; OSTCBCur
   \   00000124   000090E5           LDR      R0,[R0, #+0]
   \   00000128   2D00D0E5           LDRB     R0,[R0, #+45]
   \   0000012C   000050E3           CMP      R0,#+0
   \   00000130   0F00000A           BEQ      ??OSMboxPend_8
    321                  pend_stat = OSTCBCur->OSTCBStatPend;
   \   00000134   90009FE5           LDR      R0,??OSMboxPend_5+0x4  ;; OSTCBCur
   \   00000138   000090E5           LDR      R0,[R0, #+0]
   \   0000013C   2D60D0E5           LDRB     R6,[R0, #+45]
    322                  OS_EventTOAbort(pevent);                      /* Timed out, Make task ready                    */
   \   00000140   0500B0E1           MOVS     R0,R5
   \   00000144   ........           _BLF     OS_EventTOAbort,??OS_EventTOAbort??rA
    323                  OS_EXIT_CRITICAL();
   \   00000148   0700B0E1           MOVS     R0,R7
   \   0000014C   ........           _BLF     OS_CPU_SR_Restore,??OS_CPU_SR_Restore??rA
    324                  switch (pend_stat) {
   \   00000150   020056E3           CMP      R6,#+2
   \   00000154   0200000A           BEQ      ??OSMboxPend_9
    325                      case OS_STAT_PEND_TO:
    326                      default:
    327                           *err = OS_ERR_TIMEOUT;               /* Indicate that a timeout occured               */
   \                     ??OSMboxPend_10:
   \   00000158   0A00A0E3           MOV      R0,#+10
   \   0000015C   0000C4E5           STRB     R0,[R4, #+0]
   \   00000160   010000EA           B        ??OSMboxPend_11
    328                           break;
    329          
    330                      case OS_STAT_PEND_ABORT:
    331                           *err = OS_ERR_PEND_ABORT;            /* Indicate that we aborted                      */
   \                     ??OSMboxPend_9:
   \   00000164   0E00A0E3           MOV      R0,#+14
   \   00000168   0000C4E5           STRB     R0,[R4, #+0]
    332                           break;
    333                  }
    334                  return ((void *)0);                           /* Return a NULL message                         */
   \                     ??OSMboxPend_11:
   \   0000016C   0000A0E3           MOV      R0,#+0
   \   00000170   130000EA           B        ??OSMboxPend_1
    335              }
    336              msg                     = OSTCBCur->OSTCBMsg;
   \                     ??OSMboxPend_8:
   \   00000174   50009FE5           LDR      R0,??OSMboxPend_5+0x4  ;; OSTCBCur
   \   00000178   000090E5           LDR      R0,[R0, #+0]
   \   0000017C   208090E5           LDR      R8,[R0, #+32]
    337              OSTCBCur->OSTCBMsg      = (void *)0;              /* Yes, clear message received                   */
   \   00000180   44009FE5           LDR      R0,??OSMboxPend_5+0x4  ;; OSTCBCur
   \   00000184   000090E5           LDR      R0,[R0, #+0]
   \   00000188   0010A0E3           MOV      R1,#+0
   \   0000018C   201080E5           STR      R1,[R0, #+32]
    338              OSTCBCur->OSTCBStat     = OS_STAT_RDY;
   \   00000190   34009FE5           LDR      R0,??OSMboxPend_5+0x4  ;; OSTCBCur
   \   00000194   000090E5           LDR      R0,[R0, #+0]
   \   00000198   0010A0E3           MOV      R1,#+0
   \   0000019C   2C10C0E5           STRB     R1,[R0, #+44]
    339              OSTCBCur->OSTCBEventPtr = (OS_EVENT *)0;          /* No longer waiting for event                   */
   \   000001A0   24009FE5           LDR      R0,??OSMboxPend_5+0x4  ;; OSTCBCur
   \   000001A4   000090E5           LDR      R0,[R0, #+0]
   \   000001A8   0010A0E3           MOV      R1,#+0
   \   000001AC   1C1080E5           STR      R1,[R0, #+28]
    340              OS_EXIT_CRITICAL();
   \   000001B0   0700B0E1           MOVS     R0,R7
   \   000001B4   ........           _BLF     OS_CPU_SR_Restore,??OS_CPU_SR_Restore??rA
    341              *err                    = OS_ERR_NONE;
   \   000001B8   0000A0E3           MOV      R0,#+0
   \   000001BC   0000C4E5           STRB     R0,[R4, #+0]
    342              return (msg);                                     /* Return the message received                   */
   \   000001C0   0800B0E1           MOVS     R0,R8
   \                     ??OSMboxPend_1:
   \   000001C4   F081BDE8           POP      {R4-R8,PC}       ;; return
   \                     ??OSMboxPend_5:
   \   000001C8   ........           DC32     OSLockNesting
   \   000001CC   ........           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          *              err           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 *err)
    379          {
   \                     OSMboxPendAbort:
   \   00000000   F0412DE9           PUSH     {R4-R8,LR}
   \   00000004   0050B0E1           MOVS     R5,R0
   \   00000008   0160B0E1           MOVS     R6,R1
   \   0000000C   0240B0E1           MOVS     R4,R2
    380              INT8U      nbr_tasks;
    381          #if OS_CRITICAL_METHOD == 3                                /* Allocate storage for CPU status register */
    382              OS_CPU_SR  cpu_sr = 0;
   \   00000010   0080A0E3           MOV      R8,#+0
    383          #endif
    384          
    385          
    386          
    387          #if OS_ARG_CHK_EN > 0
    388              if (err == (INT8U *)0) {                               /* Validate 'err'                           */
   \   00000014   000054E3           CMP      R4,#+0
   \   00000018   0100001A           BNE      ??OSMboxPendAbort_0
    389                  return (0);
   \   0000001C   0000A0E3           MOV      R0,#+0
   \   00000020   310000EA           B        ??OSMboxPendAbort_1
    390              }
    391              if (pevent == (OS_EVENT *)0) {                         /* Validate 'pevent'                        */
   \                     ??OSMboxPendAbort_0:
   \   00000024   000055E3           CMP      R5,#+0
   \   00000028   0300001A           BNE      ??OSMboxPendAbort_2
    392                  *err = OS_ERR_PEVENT_NULL;
   \   0000002C   0400A0E3           MOV      R0,#+4
   \   00000030   0000C4E5           STRB     R0,[R4, #+0]
    393                  return (0);
   \   00000034   0000A0E3           MOV      R0,#+0
   \   00000038   2B0000EA           B        ??OSMboxPendAbort_1
    394              }
    395          #endif
    396              if (pevent->OSEventType != OS_EVENT_TYPE_MBOX) {       /* Validate event block type                */
   \                     ??OSMboxPendAbort_2:
   \   0000003C   0000D5E5           LDRB     R0,[R5, #+0]
   \   00000040   010050E3           CMP      R0,#+1
   \   00000044   0300000A           BEQ      ??OSMboxPendAbort_3
    397                  *err = OS_ERR_EVENT_TYPE;
   \   00000048   0100A0E3           MOV      R0,#+1
   \   0000004C   0000C4E5           STRB     R0,[R4, #+0]
    398                  return (0);
   \   00000050   0000A0E3           MOV      R0,#+0
   \   00000054   240000EA           B        ??OSMboxPendAbort_1
    399              }
    400              OS_ENTER_CRITICAL();
   \                     ??OSMboxPendAbort_3:
   \   00000058   ........           _BLF     OS_CPU_SR_Save,??OS_CPU_SR_Save??rA
   \   0000005C   0080B0E1           MOVS     R8,R0
    401              if (pevent->OSEventGrp != 0) {                         /* See if any task waiting on mailbox?      */
   \   00000060   0A00D5E5           LDRB     R0,[R5, #+10]
   \   00000064   000050E3           CMP      R0,#+0
   \   00000068   1A00000A           BEQ      ??OSMboxPendAbort_4
    402                  nbr_tasks = 0;
   \   0000006C   0070A0E3           MOV      R7,#+0

⌨️ 快捷键说明

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