00001 /** 00002 * @file MemoryDefs.h 00003 * 00004 * @brief Definitions for Memory module. 00005 * 00006 * This provides macros and type definitions for the Memory module. 00007 * 00008 * 00009 * @ver 02.00.00.68_beta1 00010 * 00011 * ============================================================================ 00012 * 00013 * Copyright (c) 2008-2009, Texas Instruments Incorporated 00014 * 00015 * Redistribution and use in source and binary forms, with or without 00016 * modification, are permitted provided that the following conditions 00017 * are met: 00018 * 00019 * * Redistributions of source code must retain the above copyright 00020 * notice, this list of conditions and the following disclaimer. 00021 * 00022 * * Redistributions in binary form must reproduce the above copyright 00023 * notice, this list of conditions and the following disclaimer in the 00024 * documentation and/or other materials provided with the distribution. 00025 * 00026 * * Neither the name of Texas Instruments Incorporated nor the names of 00027 * its contributors may be used to endorse or promote products derived 00028 * from this software without specific prior written permission. 00029 * 00030 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00031 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 00032 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00033 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 00034 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00035 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00036 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 00037 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 00038 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 00039 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 00040 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00041 * Contact information for paper mail: 00042 * Texas Instruments 00043 * Post Office Box 655303 00044 * Dallas, Texas 75265 00045 * Contact information: 00046 * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm? 00047 * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact 00048 * ============================================================================ 00049 * 00050 */ 00051 00052 00053 #ifndef MEMORYDEFS_H_0x73E4 00054 #define MEMORYDEFS_H_0x73E4 00055 00056 00057 #if defined (__cplusplus) 00058 extern "C" { 00059 #endif 00060 00061 00062 /* ============================================================================= 00063 * Macros and types 00064 * ============================================================================= 00065 */ 00066 /*! 00067 * @brief Structure defining memory related statistics 00068 */ 00069 typedef struct Memory_Stats_tag { 00070 UInt32 totalSize; 00071 /*!< Total memory size */ 00072 UInt32 totalFreeSize; 00073 /*!< Total free memory size */ 00074 UInt32 largestFreeSize; 00075 /*!< Largest free memory size */ 00076 } Memory_Stats; 00077 00078 /*! 00079 * @brief Enumerates the types of Caching for memory regions 00080 */ 00081 typedef enum { 00082 MemoryOS_CacheFlags_Default = 0x00000000, 00083 /*!< Default flags - Cached */ 00084 MemoryOS_CacheFlags_Cached = 0x00010000, 00085 /*!< Cached memory */ 00086 MemoryOS_CacheFlags_Uncached = 0x00020000, 00087 /*!< Uncached memory */ 00088 MemoryOS_CacheFlags_EndValue = 0x00030000 00089 /*!< End delimiter indicating start of invalid values for this enum */ 00090 } MemoryOS_CacheFlags; 00091 00092 /*! 00093 * @brief Enumerates the types of memory allocation 00094 */ 00095 typedef enum { 00096 MemoryOS_MemTypeFlags_Default = 0x00000000, 00097 /*!< Default flags - virtually contiguous */ 00098 MemoryOS_MemTypeFlags_Physical = 0x00000001, 00099 /*!< Physically contiguous */ 00100 MemoryOS_MemTypeFlags_Dma = 0x00000002, 00101 /*!< Physically contiguous */ 00102 MemoryOS_MemTypeFlags_EndValue = 0x00000003 00103 /*!< End delimiter indicating start of invalid values for this enum */ 00104 } MemoryOS_MemTypeFlags; 00105 00106 /*! 00107 * @brief Enumerates the types of translation 00108 */ 00109 typedef enum { 00110 Memory_XltFlags_Virt2Phys = 0x00000000, 00111 /*!< Virtual to physical */ 00112 Memory_XltFlags_Phys2Virt = 0x00000001, 00113 /*!< Virtual to physical */ 00114 Memory_XltFlags_EndValue = 0x00000002 00115 /*!< End delimiter indicating start of invalid values for this enum */ 00116 } Memory_XltFlags; 00117 00118 00119 /*! 00120 * @brief Structure containing information required for mapping a 00121 * memory region. 00122 */ 00123 typedef struct MemoryOS_MapInfo_tag { 00124 UInt32 src; 00125 /*!< Address to be mapped. */ 00126 UInt32 size; 00127 /*!< Size of memory region to be mapped. */ 00128 UInt32 dst; 00129 /*!< Mapped address. */ 00130 Bool isCached; 00131 /*!< Whether the mapping is to a cached area or uncached area. */ 00132 Ptr drvHandle; 00133 /*!< Handle to the driver that is implementing the mmap call. Ignored for 00134 Kernel-side version. */ 00135 } MemoryOS_MapInfo ; 00136 00137 /*! 00138 * @brief Structure containing information required for unmapping a 00139 * memory region. 00140 */ 00141 typedef struct MemoryOS_UnmapInfo_tag { 00142 UInt32 addr; 00143 /*!< Address to be unmapped.*/ 00144 UInt32 size; 00145 /*!< Size of memory region to be unmapped.*/ 00146 Bool isCached; 00147 /*!< Whether the mapping is to a cached area or uncached area. */ 00148 } MemoryOS_UnmapInfo; 00149 00150 /*! 00151 * @brief Structure for scatter-gathered list. 00152 */ 00153 typedef struct MemoryOS_SGList { 00154 UInt32 paddr; 00155 /*!< Page address.*/ 00156 UInt32 offset; 00157 /*!< Offset of memory segment in the page.*/ 00158 UInt32 size; 00159 /*!< Size of memory segment in the page.*/ 00160 } MemoryOS_SGList; 00161 00162 /*! 00163 * @brief Structure containing information required for mapping a 00164 * memory region. 00165 */ 00166 #define Memory_MapInfo MemoryOS_MapInfo 00167 00168 /*! 00169 * @brief Structure containing information required for unmapping a 00170 * memory region. 00171 */ 00172 #define Memory_UnmapInfo MemoryOS_UnmapInfo 00173 00174 /*! 00175 * @brief Structure for scatter-gathered list. 00176 */ 00177 #define Memory_SGList MemoryOS_SGList 00178 00179 00180 #if defined (__cplusplus) 00181 } 00182 #endif /* defined (__cplusplus) */ 00183 00184 #endif /* ifndef MEMORYDEFS_H_0x73E4 */
1.4.4