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

📄 os_mbox.lst

📁 stm32+ucos-ii
💻 LST
📖 第 1 页 / 共 5 页
字号:
###############################################################################
#                                                                             #
# IAR ANSI C/C++ Compiler V6.10.2.52244/W32 for ARM     07/Aug/2011  12:10:29 #
# Copyright 1999-2010 IAR Systems AB.                                         #
#                                                                             #
#    Cpu mode     =  thumb                                                    #
#    Endian       =  little                                                   #
#    Source file  =  F:\stm32\我的程序\Micrium\Software\uCOS-II\Source\os_mbo #
#                    x.c                                                      #
#    Command line =  F:\stm32\我的程序\Micrium\Software\uCOS-II\Source\os_mbo #
#                    x.c -D USE_STDPERIPH_DRIVER -D STM32F10X_CL -lCN         #
#                    F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\Flash\Lis #
#                    t\ -o F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\Fla #
#                    sh\Obj\ --no_cse --no_unroll --no_inline                 #
#                    --no_code_motion --no_tbaa --no_clustering               #
#                    --no_scheduling --debug --endian=little --cpu=Cortex-M3  #
#                    -e --fpu=None --dlib_config                              #
#                    D:\arm\INC\c\DLib_Config_Normal.h -I                     #
#                    F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\APP\ -I   #
#                    F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\BSP\   #
#                    -I F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\BSP #
#                    \ST\CMSIS\CM3\CoreSupport\ -I                            #
#                    F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\BSP\ST #
#                    \CMSIS\CM3\DeviceSupport\ST\STM32F10x\ -I                #
#                    F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\BSP\ST #
#                    \STM32F10x_StdPeriph_Driver\inc\ -I                      #
#                    F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\BSP\uC #
#                    OS-II\ -I F:\stm32\我的程序\Micrium\Software\EWARM\OS-II #
#                    \..\..\uCOS-II\Ports\ARM-Cortex-M3\Generic\IAR\ -I       #
#                    F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\..\uCO #
#                    S-II\Source\ -I F:\stm32\我的程序\Micrium\Software\EWARM #
#                    \OS-II\..\..\uC-LIB\ -I F:\stm32\我的程序\Micrium\Softwa #
#                    re\EWARM\OS-II\..\..\uC-LIB\Ports\ARM-Cortex-M3\IAR\ -I  #
#                    F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\..\..\uC- #
#                    CPU\ -I F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\. #
#                    .\..\uC-CPU\ARM-Cortex-M3\IAR\ -On --use_c++_inline      #
#    List file    =  F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\Flash\Lis #
#                    t\os_mbox.lst                                            #
#    Object file  =  F:\stm32\我的程序\Micrium\Software\EWARM\OS-II\Flash\Obj #
#                    \os_mbox.o                                               #
#                                                                             #
#                                                                             #
###############################################################################

F:\stm32\我的程序\Micrium\Software\uCOS-II\Source\os_mbox.c
      1          /*
      2          *********************************************************************************************************
      3          *                                                uC/OS-II
      4          *                                          The Real-Time Kernel
      5          *                                       MESSAGE MAILBOX MANAGEMENT
      6          *
      7          *                              (c) Copyright 1992-2010, Micrium, Weston, FL
      8          *                                           All Rights Reserved
      9          *
     10          * File    : OS_MBOX.C
     11          * By      : Jean J. Labrosse
     12          * Version : V2.92
     13          *
     14          * LICENSING TERMS:
     15          * ---------------
     16          *   uC/OS-II is provided in source form for FREE evaluation, for educational use or for peaceful research.
     17          * If you plan on using  uC/OS-II  in a commercial product you need to contact Micri祄 to properly license
     18          * its use in your product. We provide ALL the source code for your convenience and to help you experience
     19          * uC/OS-II.   The fact that the  source is provided does  NOT  mean that you can use it without  paying a
     20          * licensing fee.
     21          *********************************************************************************************************
     22          */
     23          
     24          #ifndef  OS_MASTER_FILE
     25          #include <ucos_ii.h>
     26          #endif
     27          
     28          #if OS_MBOX_EN > 0u
     29          /*
     30          *********************************************************************************************************
     31          *                                     ACCEPT MESSAGE FROM MAILBOX
     32          *
     33          * Description: This function checks the mailbox to see if a message is available.  Unlike OSMboxPend(),
     34          *              OSMboxAccept() does not suspend the calling task if a message is not available.
     35          *
     36          * Arguments  : pevent        is a pointer to the event control block
     37          *
     38          * Returns    : != (void *)0  is the message in the mailbox if one is available.  The mailbox is cleared
     39          *                            so the next time OSMboxAccept() is called, the mailbox will be empty.
     40          *              == (void *)0  if the mailbox is empty or,
     41          *                            if 'pevent' is a NULL pointer or,
     42          *                            if you didn't pass the proper event pointer.
     43          *********************************************************************************************************
     44          */
     45          
     46          #if OS_MBOX_ACCEPT_EN > 0u

   \                                 In section .text, align 2, keep-with-next
     47          void  *OSMboxAccept (OS_EVENT *pevent)
     48          {
   \                     OSMboxAccept:
   \   00000000   70B5               PUSH     {R4-R6,LR}
   \   00000002   0400               MOVS     R4,R0
     49              void      *pmsg;
     50          #if OS_CRITICAL_METHOD == 3u                              /* Allocate storage for CPU status register  */
     51              OS_CPU_SR  cpu_sr = 0u;
   \   00000004   0026               MOVS     R6,#+0
     52          #endif
     53          
     54          
     55          
     56          #if OS_ARG_CHK_EN > 0u
     57              if (pevent == (OS_EVENT *)0) {                        /* Validate 'pevent'                         */
     58                  return ((void *)0);
     59              }
     60          #endif
     61              if (pevent->OSEventType != OS_EVENT_TYPE_MBOX) {      /* Validate event block type                 */
   \   00000006   2078               LDRB     R0,[R4, #+0]
   \   00000008   0128               CMP      R0,#+1
   \   0000000A   01D0               BEQ.N    ??OSMboxAccept_0
     62                  return ((void *)0);
   \   0000000C   0020               MOVS     R0,#+0
   \   0000000E   0AE0               B.N      ??OSMboxAccept_1
     63              }
     64              OS_ENTER_CRITICAL();
   \                     ??OSMboxAccept_0:
   \   00000010   ........           BL       OS_CPU_SR_Save
   \   00000014   0600               MOVS     R6,R0
     65              pmsg               = pevent->OSEventPtr;
   \   00000016   6068               LDR      R0,[R4, #+4]
   \   00000018   0500               MOVS     R5,R0
     66              pevent->OSEventPtr = (void *)0;                       /* Clear the mailbox                         */
   \   0000001A   0020               MOVS     R0,#+0
   \   0000001C   6060               STR      R0,[R4, #+4]
     67              OS_EXIT_CRITICAL();
   \   0000001E   3000               MOVS     R0,R6
   \   00000020   ........           BL       OS_CPU_SR_Restore
     68              return (pmsg);                                        /* Return the message received (or NULL)     */
   \   00000024   2800               MOVS     R0,R5
   \                     ??OSMboxAccept_1:
   \   00000026   70BD               POP      {R4-R6,PC}       ;; return
     69          }
     70          #endif
     71          /*$PAGE*/
     72          /*
     73          *********************************************************************************************************
     74          *                                        CREATE A MESSAGE MAILBOX
     75          *
     76          * Description: This function creates a message mailbox if free event control blocks are available.
     77          *
     78          * Arguments  : pmsg          is a pointer to a message that you wish to deposit in the mailbox.  If
     79          *                            you set this value to the NULL pointer (i.e. (void *)0) then the mailbox
     80          *                            will be considered empty.
     81          *
     82          * Returns    : != (OS_EVENT *)0  is a pointer to the event control clock (OS_EVENT) associated with the
     83          *                                created mailbox
     84          *              == (OS_EVENT *)0  if no event control blocks were available
     85          *********************************************************************************************************
     86          */
     87          

   \                                 In section .text, align 2, keep-with-next
     88          OS_EVENT  *OSMboxCreate (void *pmsg)
     89          {
   \                     OSMboxCreate:
   \   00000000   70B5               PUSH     {R4-R6,LR}
   \   00000002   0400               MOVS     R4,R0
     90              OS_EVENT  *pevent;
     91          #if OS_CRITICAL_METHOD == 3u                     /* Allocate storage for CPU status register           */
     92              OS_CPU_SR  cpu_sr = 0u;
   \   00000004   0026               MOVS     R6,#+0
     93          #endif
     94          
     95          
     96          
     97          #ifdef OS_SAFETY_CRITICAL_IEC61508
     98              if (OSSafetyCriticalStartFlag == OS_TRUE) {
     99                  OS_SAFETY_CRITICAL_EXCEPTION();
    100                  return ((OS_EVENT *)0);
    101              }
    102          #endif
    103          
    104              if (OSIntNesting > 0u) {                     /* See if called from ISR ...                         */
   \   00000006   ....               LDR.N    R0,??DataTable3_1
   \   00000008   0078               LDRB     R0,[R0, #+0]
   \   0000000A   0028               CMP      R0,#+0
   \   0000000C   01D0               BEQ.N    ??OSMboxCreate_0
    105                  return ((OS_EVENT *)0);                  /* ... can't CREATE from an ISR                       */
   \   0000000E   0020               MOVS     R0,#+0
   \   00000010   1EE0               B.N      ??OSMboxCreate_1
    106              }
    107              OS_ENTER_CRITICAL();
   \                     ??OSMboxCreate_0:
   \   00000012   ........           BL       OS_CPU_SR_Save
   \   00000016   0600               MOVS     R6,R0
    108              pevent = OSEventFreeList;                    /* Get next free event control block                  */
   \   00000018   ....               LDR.N    R0,??DataTable3_2
   \   0000001A   0068               LDR      R0,[R0, #+0]
   \   0000001C   0500               MOVS     R5,R0
    109              if (OSEventFreeList != (OS_EVENT *)0) {      /* See if pool of free ECB pool was empty             */
   \   0000001E   ....               LDR.N    R0,??DataTable3_2
   \   00000020   0068               LDR      R0,[R0, #+0]
   \   00000022   0028               CMP      R0,#+0
   \   00000024   04D0               BEQ.N    ??OSMboxCreate_2
    110                  OSEventFreeList = (OS_EVENT *)OSEventFreeList->OSEventPtr;
   \   00000026   ....               LDR.N    R0,??DataTable3_2
   \   00000028   0068               LDR      R0,[R0, #+0]
   \   0000002A   4068               LDR      R0,[R0, #+4]
   \   0000002C   ....               LDR.N    R1,??DataTable3_2
   \   0000002E   0860               STR      R0,[R1, #+0]
    111              }
    112              OS_EXIT_CRITICAL();
   \                     ??OSMboxCreate_2:
   \   00000030   3000               MOVS     R0,R6
   \   00000032   ........           BL       OS_CPU_SR_Restore
    113              if (pevent != (OS_EVENT *)0) {

⌨️ 快捷键说明

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