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

📄 os_mem.lst

📁 IARSOURCECODE是基于LPC2478嵌入式软件IAR EWARM V4.42的应用实例代码
💻 LST
📖 第 1 页 / 共 4 页
字号:
##############################################################################
#                                                                            #
# IAR ARM ANSI C/C++ Compiler V4.42A/W32 KICKSTART     10/Jan/2008  16:48:29 #
# Copyright 1999-2005 IAR Systems. All rights reserved.                      #
#                                                                            #
#    Cpu mode        =  arm                                                  #
#    Endian          =  little                                               #
#    Stack alignment =  4                                                    #
#    Source file     =  D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
#                       \uCOS-II\Source\os_mem.c                             #
#    Command line    =  D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
#                       \uCOS-II\Source\os_mem.c -lCN                        #
#                       D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
#                       \EvalBoards\NXP\LPC2468-EA\IAR\OS-View\Flash\List\   #
#                       -o D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Softw #
#                       are\EvalBoards\NXP\LPC2468-EA\IAR\OS-View\Flash\Obj\ #
#                        -z3 --no_cse --no_unroll --no_inline                #
#                       --no_code_motion --no_tbaa --no_clustering           #
#                       --no_scheduling --debug --cpu_mode arm --endian      #
#                       little --cpu ARM7TDMI-S --stack_align 4 -e --fpu     #
#                       None --dlib_config "C:\Program Files\IAR             #
#                       Systems\Embedded Workbench 4.0                       #
#                       Kickstart\arm\LIB\dl4tpannl8n.h" -I                  #
#                       D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
#                       \EvalBoards\NXP\LPC2468-EA\IAR\OS-View\ -I           #
#                       D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
#                       \EvalBoards\NXP\LPC2468-EA\IAR\OS-View\..\..\..\..\. #
#                       .\ucos-ii\ports\arm\generic\iar\ -I                  #
#                       D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
#                       \EvalBoards\NXP\LPC2468-EA\IAR\OS-View\..\..\..\..\. #
#                       .\ucos-ii\source\ -I D:\work\资料\嵌入式操作系统\UCO #
#                       S-II\Micrium\Software\EvalBoards\NXP\LPC2468-EA\IAR\ #
#                       OS-View\..\..\..\..\..\ucosview\source\ -I           #
#                       D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
#                       \EvalBoards\NXP\LPC2468-EA\IAR\OS-View\..\..\..\..\. #
#                       .\ucosview\ports\arm7\lpc2468\iar\ -I                #
#                       D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
#                       \EvalBoards\NXP\LPC2468-EA\IAR\OS-View\..\..\..\..\. #
#                       .\uc-lib\ -I D:\work\资料\嵌入式操作系统\UCOS-II\Mic #
#                       rium\Software\EvalBoards\NXP\LPC2468-EA\IAR\OS-View\ #
#                       ..\..\..\..\..\uc-cpu\ -I                            #
#                       D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
#                       \EvalBoards\NXP\LPC2468-EA\IAR\OS-View\..\..\..\..\. #
#                       .\uc-cpu\arm\IAR\ -I D:\work\资料\嵌入式操作系统\UCO #
#                       S-II\Micrium\Software\EvalBoards\NXP\LPC2468-EA\IAR\ #
#                       OS-View\..\BSP\ -I "C:\Program Files\IAR             #
#                       Systems\Embedded Workbench 4.0 Kickstart\arm\INC\"   #
#    List file       =  D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
#                       \EvalBoards\NXP\LPC2468-EA\IAR\OS-View\Flash\List\os #
#                       _mem.lst                                             #
#    Object file     =  D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
#                       \EvalBoards\NXP\LPC2468-EA\IAR\OS-View\Flash\Obj\os_ #
#                       mem.r79                                              #
#                                                                            #
#                                                                            #
##############################################################################

D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software\uCOS-II\Source\os_mem.c
      1          /*
      2          *********************************************************************************************************
      3          *                                                uC/OS-II
      4          *                                          The Real-Time Kernel
      5          *                                            MEMORY MANAGEMENT
      6          *
      7          *                          (c) Copyright 1992-2007, Jean J. Labrosse, Weston, FL
      8          *                                           All Rights Reserved
      9          *
     10          * File    : OS_MEM.C
     11          * By      : Jean J. Labrosse
     12          * Version : V2.84
     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_MEM_EN > 0) && (OS_MAX_MEM_PART > 0)
     29          /*
     30          *********************************************************************************************************
     31          *                                        CREATE A MEMORY PARTITION
     32          *
     33          * Description : Create a fixed-sized memory partition that will be managed by uC/OS-II.
     34          *
     35          * Arguments   : addr     is the starting address of the memory partition
     36          *
     37          *               nblks    is the number of memory blocks to create from the partition.
     38          *
     39          *               blksize  is the size (in bytes) of each block in the memory partition.
     40          *
     41          *               err      is a pointer to a variable containing an error message which will be set by
     42          *                        this function to either:
     43          *
     44          *                        OS_ERR_NONE              if the memory partition has been created correctly.
     45          *                        OS_ERR_MEM_INVALID_ADDR  if you are specifying an invalid address for the memory
     46          *                                                 storage of the partition or, the block does not align
     47          *                                                 on a pointer boundary
     48          *                        OS_ERR_MEM_INVALID_PART  no free partitions available
     49          *                        OS_ERR_MEM_INVALID_BLKS  user specified an invalid number of blocks (must be >= 2)
     50          *                        OS_ERR_MEM_INVALID_SIZE  user specified an invalid block size
     51          *                                                   - must be greater than the size of a pointer
     52          *                                                   - must be able to hold an integral number of pointers
     53          * Returns    : != (OS_MEM *)0  is the partition was created
     54          *              == (OS_MEM *)0  if the partition was not created because of invalid arguments or, no
     55          *                              free partition is available.
     56          *********************************************************************************************************
     57          */
     58          

   \                                 In segment CODE, align 4, keep-with-next
     59          OS_MEM  *OSMemCreate (void *addr, INT32U nblks, INT32U blksize, INT8U *err)
     60          {
   \                     OSMemCreate:
   \   00000000   F0412DE9           PUSH     {R4-R8,LR}
   \   00000004   0050B0E1           MOVS     R5,R0
   \   00000008   0160B0E1           MOVS     R6,R1
   \   0000000C   0270B0E1           MOVS     R7,R2
   \   00000010   0340B0E1           MOVS     R4,R3
     61              OS_MEM    *pmem;
     62              INT8U     *pblk;
     63              void     **plink;
     64              INT32U     i;
     65          #if OS_CRITICAL_METHOD == 3                           /* Allocate storage for CPU status register      */
     66              OS_CPU_SR  cpu_sr = 0;
   \   00000014   0000A0E3           MOV      R0,#+0
     67          #endif
     68          
     69          
     70          
     71          #if OS_ARG_CHK_EN > 0              
     72              if (err == (INT8U *)0) {                          /* Validate 'err'                                */
   \   00000018   000054E3           CMP      R4,#+0
   \   0000001C   0100001A           BNE      ??OSMemCreate_0
     73                  return ((OS_MEM *)0);
   \   00000020   0000A0E3           MOV      R0,#+0
   \   00000024   460000EA           B        ??OSMemCreate_1
     74              }
     75              if (addr == (void *)0) {                          /* Must pass a valid address for the memory part.*/
   \                     ??OSMemCreate_0:
   \   00000028   000055E3           CMP      R5,#+0
   \   0000002C   0300001A           BNE      ??OSMemCreate_2
     76                  *err = OS_ERR_MEM_INVALID_ADDR;
   \   00000030   6200A0E3           MOV      R0,#+98
   \   00000034   0000C4E5           STRB     R0,[R4, #+0]
     77                  return ((OS_MEM *)0);
   \   00000038   0000A0E3           MOV      R0,#+0
   \   0000003C   400000EA           B        ??OSMemCreate_1
     78              }
     79              if (((INT32U)addr & (sizeof(void *) - 1)) != 0){  /* Must be pointer size aligned                  */
   \                     ??OSMemCreate_2:
   \   00000040   030015E3           TST      R5,#0x3
   \   00000044   0300000A           BEQ      ??OSMemCreate_3
     80                  *err = OS_ERR_MEM_INVALID_ADDR;
   \   00000048   6200A0E3           MOV      R0,#+98
   \   0000004C   0000C4E5           STRB     R0,[R4, #+0]
     81                  return ((OS_MEM *)0);
   \   00000050   0000A0E3           MOV      R0,#+0
   \   00000054   3A0000EA           B        ??OSMemCreate_1
     82              }
     83              if (nblks < 2) {                                  /* Must have at least 2 blocks per partition     */
   \                     ??OSMemCreate_3:
   \   00000058   020056E3           CMP      R6,#+2
   \   0000005C   0300002A           BCS      ??OSMemCreate_4
     84                  *err = OS_ERR_MEM_INVALID_BLKS;
   \   00000060   5B00A0E3           MOV      R0,#+91
   \   00000064   0000C4E5           STRB     R0,[R4, #+0]
     85                  return ((OS_MEM *)0);
   \   00000068   0000A0E3           MOV      R0,#+0
   \   0000006C   340000EA           B        ??OSMemCreate_1
     86              }
     87              if (blksize < sizeof(void *)) {                   /* Must contain space for at least a pointer     */
   \                     ??OSMemCreate_4:
   \   00000070   040057E3           CMP      R7,#+4
   \   00000074   0300002A           BCS      ??OSMemCreate_5
     88                  *err = OS_ERR_MEM_INVALID_SIZE;
   \   00000078   5C00A0E3           MOV      R0,#+92
   \   0000007C   0000C4E5           STRB     R0,[R4, #+0]
     89                  return ((OS_MEM *)0);
   \   00000080   0000A0E3           MOV      R0,#+0
   \   00000084   2E0000EA           B        ??OSMemCreate_1
     90              }
     91              if ((blksize % sizeof(void *)) != 0) {            /* Must contain space for an integral number ... */
   \                     ??OSMemCreate_5:
   \   00000088   030017E2           ANDS     R0,R7,#0x3       ;; Zero extend
   \   0000008C   000050E3           CMP      R0,#+0
   \   00000090   0300000A           BEQ      ??OSMemCreate_6
     92                  *err = OS_ERR_MEM_INVALID_SIZE;               /* ... of pointer sized items                    */
   \   00000094   5C00A0E3           MOV      R0,#+92
   \   00000098   0000C4E5           STRB     R0,[R4, #+0]
     93                  return ((OS_MEM *)0);
   \   0000009C   0000A0E3           MOV      R0,#+0
   \   000000A0   270000EA           B        ??OSMemCreate_1
     94              }
     95          #endif
     96              OS_ENTER_CRITICAL();
   \                     ??OSMemCreate_6:
   \   000000A4   ........           _BLF     OS_CPU_SR_Save,??OS_CPU_SR_Save??rA
     97              pmem = OSMemFreeList;                             /* Get next free memory partition                */
   \   000000A8   ........           LDR      R1,??DataTable4  ;; OSMemFreeList
   \   000000AC   008091E5           LDR      R8,[R1, #+0]
     98              if (OSMemFreeList != (OS_MEM *)0) {               /* See if pool of free partitions was empty      */
   \   000000B0   ........           LDR      R1,??DataTable4  ;; OSMemFreeList
   \   000000B4   001091E5           LDR      R1,[R1, #+0]
   \   000000B8   000051E3           CMP      R1,#+0
   \   000000BC   0400000A           BEQ      ??OSMemCreate_7
     99                  OSMemFreeList = (OS_MEM *)OSMemFreeList->OSMemFreeList;
   \   000000C0   ........           LDR      R1,??DataTable4  ;; OSMemFreeList
   \   000000C4   ........           LDR      R2,??DataTable4  ;; OSMemFreeList
   \   000000C8   002092E5           LDR      R2,[R2, #+0]
   \   000000CC   042092E5           LDR      R2,[R2, #+4]
   \   000000D0   002081E5           STR      R2,[R1, #+0]
    100              }

⌨️ 快捷键说明

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