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

📄 os_mbox.lst

📁 stm32+ucos-ii
💻 LST
📖 第 1 页 / 共 5 页
字号:
   \                     ??OSMboxDel_11:
   \   000000AC   ....               ADR.N    R0,??DataTable3  ;; "\?"
   \   000000AE   C9F81400           STR      R0,[R9, #+20]
    227          #endif
    228                       pevent->OSEventType    = OS_EVENT_TYPE_UNUSED;
   \   000000B2   0020               MOVS     R0,#+0
   \   000000B4   89F80000           STRB     R0,[R9, #+0]
    229                       pevent->OSEventPtr     = OSEventFreeList;     /* Return Event Control Block to free list  */
   \   000000B8   ....               LDR.N    R0,??DataTable3_2
   \   000000BA   0068               LDR      R0,[R0, #+0]
   \   000000BC   C9F80400           STR      R0,[R9, #+4]
    230                       pevent->OSEventCnt     = 0u;
   \   000000C0   0020               MOVS     R0,#+0
   \   000000C2   A9F80800           STRH     R0,[R9, #+8]
    231                       OSEventFreeList        = pevent;              /* Get next free event control block        */
   \   000000C6   ....               LDR.N    R0,??DataTable3_2
   \   000000C8   C0F80090           STR      R9,[R0, #+0]
    232                       OS_EXIT_CRITICAL();
   \   000000CC   4046               MOV      R0,R8
   \   000000CE   ........           BL       OS_CPU_SR_Restore
    233                       if (tasks_waiting == OS_TRUE) {               /* Reschedule only if task(s) were waiting  */
   \   000000D2   F6B2               UXTB     R6,R6            ;; ZeroExt  R6,R6,#+24,#+24
   \   000000D4   012E               CMP      R6,#+1
   \   000000D6   01D1               BNE.N    ??OSMboxDel_12
    234                           OS_Sched();                               /* Find highest priority task ready to run  */
   \   000000D8   ........           BL       OS_Sched
    235                       }
    236                       *perr         = OS_ERR_NONE;
   \                     ??OSMboxDel_12:
   \   000000DC   0020               MOVS     R0,#+0
   \   000000DE   2870               STRB     R0,[R5, #+0]
    237                       pevent_return = (OS_EVENT *)0;                /* Mailbox has been deleted                 */
   \   000000E0   0020               MOVS     R0,#+0
   \   000000E2   0700               MOVS     R7,R0
    238                       break;
   \   000000E4   05E0               B.N      ??OSMboxDel_10
    239          
    240                  default:
    241                       OS_EXIT_CRITICAL();
   \                     ??OSMboxDel_7:
   \   000000E6   4046               MOV      R0,R8
   \   000000E8   ........           BL       OS_CPU_SR_Restore
    242                       *perr         = OS_ERR_INVALID_OPT;
   \   000000EC   0720               MOVS     R0,#+7
   \   000000EE   2870               STRB     R0,[R5, #+0]
    243                       pevent_return = pevent;
   \   000000F0   4F46               MOV      R7,R9
    244                       break;
    245              }
    246              return (pevent_return);
   \                     ??OSMboxDel_10:
   \   000000F2   3800               MOVS     R0,R7
   \                     ??OSMboxDel_1:
   \   000000F4   BDE8F283           POP      {R1,R4-R9,PC}    ;; return
    247          }
    248          #endif
    249          
    250          /*$PAGE*/
    251          /*
    252          *********************************************************************************************************
    253          *                                      PEND ON MAILBOX FOR A MESSAGE
    254          *
    255          * Description: This function waits for a message to be sent to a mailbox
    256          *
    257          * Arguments  : pevent        is a pointer to the event control block associated with the desired mailbox
    258          *
    259          *              timeout       is an optional timeout period (in clock ticks).  If non-zero, your task will
    260          *                            wait for a message to arrive at the mailbox up to the amount of time
    261          *                            specified by this argument.  If you specify 0, however, your task will wait
    262          *                            forever at the specified mailbox or, until a message arrives.
    263          *
    264          *              perr          is a pointer to where an error message will be deposited.  Possible error
    265          *                            messages are:
    266          *
    267          *                            OS_ERR_NONE         The call was successful and your task received a
    268          *                                                message.
    269          *                            OS_ERR_TIMEOUT      A message was not received within the specified 'timeout'.
    270          *                            OS_ERR_PEND_ABORT   The wait on the mailbox was aborted.
    271          *                            OS_ERR_EVENT_TYPE   Invalid event type
    272          *                            OS_ERR_PEND_ISR     If you called this function from an ISR and the result
    273          *                                                would lead to a suspension.
    274          *                            OS_ERR_PEVENT_NULL  If 'pevent' is a NULL pointer
    275          *                            OS_ERR_PEND_LOCKED  If you called this function when the scheduler is locked
    276          *
    277          * Returns    : != (void *)0  is a pointer to the message received
    278          *              == (void *)0  if no message was received or,
    279          *                            if 'pevent' is a NULL pointer or,
    280          *                            if you didn't pass the proper pointer to the event control block.
    281          *********************************************************************************************************
    282          */
    283          /*$PAGE*/

   \                                 In section .text, align 2, keep-with-next
    284          void  *OSMboxPend (OS_EVENT  *pevent,
    285                             INT32U     timeout,
    286                             INT8U     *perr)
    287          {
   \                     OSMboxPend:
   \   00000000   2DE9F041           PUSH     {R4-R8,LR}
   \   00000004   0400               MOVS     R4,R0
   \   00000006   0D00               MOVS     R5,R1
   \   00000008   1600               MOVS     R6,R2
    288              void      *pmsg;
    289          #if OS_CRITICAL_METHOD == 3u                          /* Allocate storage for CPU status register      */
    290              OS_CPU_SR  cpu_sr = 0u;
   \   0000000A   5FF00008           MOVS     R8,#+0
    291          #endif
    292          
    293          
    294          
    295          #ifdef OS_SAFETY_CRITICAL
    296              if (perr == (INT8U *)0) {
    297                  OS_SAFETY_CRITICAL_EXCEPTION();
    298                  return ((void *)0);
    299              }
    300          #endif
    301          
    302          #if OS_ARG_CHK_EN > 0u
    303              if (pevent == (OS_EVENT *)0) {                    /* Validate 'pevent'                             */
    304                  *perr = OS_ERR_PEVENT_NULL;
    305                  return ((void *)0);
    306              }
    307          #endif
    308              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    ??OSMboxPend_0
    309                  *perr = OS_ERR_EVENT_TYPE;
   \   00000014   0120               MOVS     R0,#+1
   \   00000016   3070               STRB     R0,[R6, #+0]
    310                  return ((void *)0);
   \   00000018   0020               MOVS     R0,#+0
   \   0000001A   74E0               B.N      ??OSMboxPend_1
    311              }
    312              if (OSIntNesting > 0u) {                          /* See if called from ISR ...                    */
   \                     ??OSMboxPend_0:
   \   0000001C   ....               LDR.N    R0,??DataTable3_1
   \   0000001E   0078               LDRB     R0,[R0, #+0]
   \   00000020   0028               CMP      R0,#+0
   \   00000022   03D0               BEQ.N    ??OSMboxPend_2
    313                  *perr = OS_ERR_PEND_ISR;                      /* ... can't PEND from an ISR                    */
   \   00000024   0220               MOVS     R0,#+2
   \   00000026   3070               STRB     R0,[R6, #+0]
    314                  return ((void *)0);
   \   00000028   0020               MOVS     R0,#+0
   \   0000002A   6CE0               B.N      ??OSMboxPend_1
    315              }
    316              if (OSLockNesting > 0u) {                         /* See if called with scheduler locked ...       */
   \                     ??OSMboxPend_2:
   \   0000002C   ....               LDR.N    R0,??DataTable3_3
   \   0000002E   0078               LDRB     R0,[R0, #+0]
   \   00000030   0028               CMP      R0,#+0
   \   00000032   03D0               BEQ.N    ??OSMboxPend_3
    317                  *perr = OS_ERR_PEND_LOCKED;                   /* ... can't PEND when locked                    */
   \   00000034   0D20               MOVS     R0,#+13
   \   00000036   3070               STRB     R0,[R6, #+0]
    318                  return ((void *)0);
   \   00000038   0020               MOVS     R0,#+0
   \   0000003A   64E0               B.N      ??OSMboxPend_1
    319              }
    320              OS_ENTER_CRITICAL();
   \                     ??OSMboxPend_3:
   \   0000003C   ........           BL       OS_CPU_SR_Save
   \   00000040   8046               MOV      R8,R0
    321              pmsg = pevent->OSEventPtr;
   \   00000042   6068               LDR      R0,[R4, #+4]
   \   00000044   0700               MOVS     R7,R0
    322              if (pmsg != (void *)0) {                          /* See if there is already a message             */
   \   00000046   002F               CMP      R7,#+0
   \   00000048   08D0               BEQ.N    ??OSMboxPend_4
    323                  pevent->OSEventPtr = (void *)0;               /* Clear the mailbox                             */
   \   0000004A   0020               MOVS     R0,#+0
   \   0000004C   6060               STR      R0,[R4, #+4]
    324                  OS_EXIT_CRITICAL();
   \   0000004E   4046               MOV      R0,R8
   \   00000050   ........           BL       OS_CPU_SR_Restore
    325                  *perr = OS_ERR_NONE;
   \   00000054   0020               MOVS     R0,#+0
   \   00000056   3070               STRB     R0,[R6, #+0]
    326                  return (pmsg);                                /* Return the message received (or NULL)         */
   \   00000058   3800               MOVS     R0,R7
   \   0000005A   54E0               B.N      ??OSMboxPend_1
    327              }
    328              OSTCBCur->OSTCBStat     |= OS_STAT_MBOX;          /* Message not available, task will pend         */
   \                     ??OSMboxPend_4:
   \   0000005C   ....               LDR.N    R0,??DataTable3_4
   \   0000005E   0068               LDR      R0,[R0, #+0]
   \   00000060   90F83400           LDRB     R0,[R0, #+52]
   \   00000064   50F00200           ORRS     R0,R0,#0x2
   \   00000068   ....               LDR.N    R1,??DataTable3_4
   \   0000006A   0968               LDR      R1,[R1, #+0]
   \   0000006C   81F83400           STRB     R0,[R1, #+52]
    329              OSTCBCur->OSTCBStatPend  = OS_STAT_PEND_OK;
   \   00000070   ....               LDR.N    R0,??DataTable3_4
   \   00000072   0068               LDR      R0,[R0, #+0]
   \   00000074   0021               MOVS     R1,#+0
   \   00000076   80F83510           STRB     R1,[R0, #+53]
    330              OSTCBCur->OSTCBDly       = timeout;               /* Load timeout in TCB                           */
   \   0000007A   ....               LDR.N    R0,??DataTable3_4
   \   0000007C   0068               LDR      R0,[R0, #+0]
   \   0000007E   0563               STR      R5,[R0, #+48]
    331              OS_EventTaskWait(pevent);                         /* Suspend task until event or timeout occurs    */
   \   00000080   2000               MOVS     R0,R4
   \   00000082   ........           BL       OS_EventTaskWait
    332              OS_EXIT_CRITICAL();
   \   00000086   4046               MOV      R0,R8
   \   00000088   ........           BL       OS_CPU_SR_Restore
    333              OS_Sched();                                       /* Find next highest priority task ready to run  */
   \   0000008C   ........           BL       OS_Sched
    334              OS_ENTER_CRITICAL();
   \   00000090   ........           BL       OS_CPU_SR_Save

⌨️ 快捷键说明

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