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

📄 os_mbox.lst

📁 针对STM32F103的UCOS移植
💻 LST
📖 第 1 页 / 共 5 页
字号:
##############################################################################
#                                                                            #
# IAR ARM ANSI C/C++ Compiler V4.42A/W32 KICKSTART     13/Mar/2009  16:01:00 #
# Copyright 1999-2005 IAR Systems. All rights reserved.                      #
#                                                                            #
#    Cpu mode        =  thumb                                                #
#    Endian          =  little                                               #
#    Stack alignment =  4                                                    #
#    Source file     =  E:\UC_OS\Micrium\Software\uCOS-II\Source\os_mbox.c   #
#    Command line    =  E:\UC_OS\Micrium\Software\uCOS-II\Source\os_mbox.c   #
#                       -lCN E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210 #
#                       B-EVAL\IAR\OS-Probe\Flash\List\ -o                   #
#                       E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
#                       L\IAR\OS-Probe\Flash\Obj\ -z6 --no_unroll            #
#                       --no_inline --no_tbaa --no_scheduling --debug        #
#                       --cpu_mode thumb --endian little --cpu cortex-M3     #
#                       --stack_align 4 -e --fpu None --dlib_config          #
#                       "C:\Program Files\IAR Systems\Embedded Workbench     #
#                       4.0 Kickstart\arm\LIB\dl7mptnnl8n.h" -I              #
#                       E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
#                       L\IAR\OS-Probe\ -I E:\UC_OS\Micrium\Software\EvalBoa #
#                       rds\ST\STM3210B-EVAL\IAR\OS-Probe\..\..\..\..\..\uco #
#                       s-ii\ports\arm-cortex-m3\generic\iar\ -I             #
#                       E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
#                       L\IAR\OS-Probe\..\..\..\..\..\ucos-ii\source\ -I     #
#                       E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
#                       L\IAR\OS-Probe\..\..\..\..\..\uc-lib\ -I             #
#                       E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
#                       L\IAR\OS-Probe\..\..\..\..\..\uc-cpu\ -I             #
#                       E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
#                       L\IAR\OS-Probe\..\..\..\..\..\uc-cpu\ARM-Cortex-M3\I #
#                       AR\ -I E:\UC_OS\Micrium\Software\EvalBoards\ST\STM32 #
#                       10B-EVAL\IAR\OS-Probe\..\..\..\..\..\cpu\st\stm32\in #
#                       c\ -I E:\UC_OS\Micrium\Software\EvalBoards\ST\STM321 #
#                       0B-EVAL\IAR\OS-Probe\..\BSP\ -I                      #
#                       E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
#                       L\IAR\OS-Probe\..\..\..\..\..\uC-Probe\Target\Commun #
#                       ication\Generic\RS-232\Source\ -I                    #
#                       E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
#                       L\IAR\OS-Probe\..\..\..\..\..\uC-Probe\Target\Commun #
#                       ication\Generic\RS-232\Ports\ST\STM32\ -I            #
#                       E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
#                       L\IAR\OS-Probe\..\..\..\..\..\uC-Probe\Target\Commun #
#                       ication\Generic\Source\ -I                           #
#                       E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
#                       L\IAR\OS-Probe\..\..\..\..\..\uC-Probe\Target\Plugin #
#                       s\uCOS-II\ -I "C:\Program Files\IAR                  #
#                       Systems\Embedded Workbench 4.0 Kickstart\arm\INC\"   #
#    List file       =  E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
#                       L\IAR\OS-Probe\Flash\List\os_mbox.lst                #
#    Object file     =  E:\UC_OS\Micrium\Software\EvalBoards\ST\STM3210B-EVA #
#                       L\IAR\OS-Probe\Flash\Obj\os_mbox.r79                 #
#                                                                            #
#                                                                            #
##############################################################################

E:\UC_OS\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-2007, Jean J. Labrosse, Weston, FL
      8          *                                           All Rights Reserved
      9          *
     10          * File    : OS_MBOX.C
     11          * By      : Jean J. Labrosse
     12          * Version : V2.85
     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 > 0
     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 > 0

   \                                 In segment CODE, align 4, keep-with-next
     47          void  *OSMboxAccept (OS_EVENT *pevent)
     48          {
   \                     OSMboxAccept:
   \   00000000   30B5               PUSH     {R4,R5,LR}
   \   00000002   0400               MOVS     R4,R0
     49              void      *pmsg;
     50          #if OS_CRITICAL_METHOD == 3                               /* Allocate storage for CPU status register  */
     51              OS_CPU_SR  cpu_sr = 0;
     52          #endif
     53          
     54          
     55          
     56          #if OS_ARG_CHK_EN > 0
     57              if (pevent == (OS_EVENT *)0) {                        /* Validate 'pevent'                         */
   \   00000004   01D1               BNE.N    ??OSMboxAccept_0
     58                  return ((void *)0);
   \   00000006   0020               MOVS     R0,#+0
   \   00000008   30BD               POP      {R4,R5,PC}
     59              }
     60          #endif
     61              if (pevent->OSEventType != OS_EVENT_TYPE_MBOX) {      /* Validate event block type                 */
   \                     ??OSMboxAccept_0:
   \   0000000A   2078               LDRB     R0,[R4, #+0]
   \   0000000C   0128               CMP      R0,#+1
   \   0000000E   01D0               BEQ.N    ??OSMboxAccept_1
     62                  return ((void *)0);
   \   00000010   0020               MOVS     R0,#+0
   \   00000012   30BD               POP      {R4,R5,PC}
     63              }
     64              OS_ENTER_CRITICAL();
   \                     ??OSMboxAccept_1:
   \   00000014   ........           _BLF     OS_CPU_SR_Save,??OS_CPU_SR_Save??rT
     65              pmsg               = pevent->OSEventPtr;
   \   00000018   6568               LDR      R5,[R4, #+4]
     66              pevent->OSEventPtr = (void *)0;                       /* Clear the mailbox                         */
   \   0000001A   0021               MOVS     R1,#+0
   \   0000001C   6160               STR      R1,[R4, #+4]
     67              OS_EXIT_CRITICAL();
   \   0000001E   ........           _BLF     OS_CPU_SR_Restore,??OS_CPU_SR_Restore??rT
     68              return (pmsg);                                        /* Return the message received (or NULL)     */
   \   00000022   2800               MOVS     R0,R5
   \   00000024   30BD               POP      {R4,R5,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 segment CODE, align 4, keep-with-next
     88          OS_EVENT  *OSMboxCreate (void *pmsg)
     89          {
   \                     OSMboxCreate:
   \   00000000   30B5               PUSH     {R4,R5,LR}
   \   00000002   0400               MOVS     R4,R0
     90              OS_EVENT  *pevent;
     91          #if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
     92              OS_CPU_SR  cpu_sr = 0;
     93          #endif
     94          
     95          
     96          
     97              if (OSIntNesting > 0) {                      /* See if called from ISR ...                         */
   \   00000004   ....               LDR.N    R0,??DataTable4  ;; OSIntNesting
   \   00000006   0078               LDRB     R0,[R0, #+0]
   \   00000008   0028               CMP      R0,#+0
   \   0000000A   01D0               BEQ.N    ??OSMboxCreate_0
     98                  return ((OS_EVENT *)0);                  /* ... can't CREATE from an ISR                       */
   \   0000000C   0020               MOVS     R0,#+0
   \   0000000E   30BD               POP      {R4,R5,PC}
     99              }
    100              OS_ENTER_CRITICAL();
   \                     ??OSMboxCreate_0:
   \   00000010   ........           _BLF     OS_CPU_SR_Save,??OS_CPU_SR_Save??rT
    101              pevent = OSEventFreeList;                    /* Get next free event control block                  */
   \   00000014   ....               LDR.N    R1,??DataTable3  ;; OSEventFreeList
   \   00000016   0A68               LDR      R2,[R1, #+0]
   \   00000018   1500               MOVS     R5,R2
    102              if (OSEventFreeList != (OS_EVENT *)0) {      /* See if pool of free ECB pool was empty             */
   \   0000001A   01D0               BEQ.N    ??OSMboxCreate_1
    103                  OSEventFreeList = (OS_EVENT *)OSEventFreeList->OSEventPtr;
   \   0000001C   5268               LDR      R2,[R2, #+4]
   \   0000001E   0A60               STR      R2,[R1, #+0]
    104              }
    105              OS_EXIT_CRITICAL();
   \                     ??OSMboxCreate_1:
   \   00000020   ........           _BLF     OS_CPU_SR_Restore,??OS_CPU_SR_Restore??rT
    106              if (pevent != (OS_EVENT *)0) {

⌨️ 快捷键说明

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