00001 /** ============================================================================ 00002 * @file pooldefs.h 00003 * 00004 * @path $(DSPLINK)/gpp/inc/usr/ 00005 * 00006 * @brief Definitions of constants and structures for pools. 00007 * 00008 * @ver 1.65.00.03 00009 * ============================================================================ 00010 * @copyright Copyright (C) 2002-2009, Texas Instruments Incorporated - 00011 * http://www.ti.com/ 00012 * 00013 * Redistribution and use in source and binary forms, with or without 00014 * modification, are permitted provided that the following conditions 00015 * are met: 00016 * 00017 * * Redistributions of source code must retain the above copyright 00018 * notice, this list of conditions and the following disclaimer. 00019 * 00020 * * Redistributions in binary form must reproduce the above copyright 00021 * notice, this list of conditions and the following disclaimer in the 00022 * documentation and/or other materials provided with the distribution. 00023 * 00024 * * Neither the name of Texas Instruments Incorporated nor the names of 00025 * its contributors may be used to endorse or promote products derived 00026 * from this software without specific prior written permission. 00027 * 00028 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00029 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 00030 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00031 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 00032 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00033 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00034 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 00035 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 00036 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 00037 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 00038 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00039 * ============================================================================ 00040 */ 00041 00042 00043 #if !defined (POOLDEFS_H) 00044 #define POOLDEFS_H 00045 00046 00047 /* ----------------------------------- DSP/BIOS LINK Headers */ 00048 #include <dsplink.h> 00049 00050 00051 #if defined (__cplusplus) 00052 extern "C" { 00053 #endif 00054 00055 00056 /** ============================================================================ 00057 * @name POOL_makePoolId 00058 * 00059 * @brief This macro returns a Pool Id by combining PROCID and POOL No in the 00060 * Following format: 00061 * |<--- 8 bit --->|<--- 8 bit --->| 00062 * | ProcId | PoolNo | 00063 * ============================================================================ 00064 */ 00065 #define POOL_makePoolId(procId, poolNo) ( ((poolNo) & 0xFFu) \ 00066 | ((((procId) & 0xFFu) << 8u) & 0xFFFFu)) 00067 00068 /** ============================================================================ 00069 * @name POOL_getProcId 00070 * 00071 * @brief Returns the processor Identifier from the PoolId. 00072 * ============================================================================ 00073 */ 00074 #define POOL_getProcId(poolId) ((((poolId) & 0xFF00u) >> 8u) & 0x00FFu) 00075 00076 /** ============================================================================ 00077 * @name POOL_getPoolNo 00078 * 00079 * @brief Returns the pool Number from the PoolId. 00080 * ============================================================================ 00081 */ 00082 #define POOL_getPoolNo(poolId) ((poolId) & 0x00FFu) 00083 00084 /** ============================================================================ 00085 * @name MAX_POOLENTRIES 00086 * 00087 * @brief The maximum number of pools that can be configured per processors. 00088 * ============================================================================ 00089 */ 00090 #define MAX_POOLENTRIES 32u 00091 00092 /** ============================================================================ 00093 * @macro IS_VALID_POOLID 00094 * 00095 * @brief Is the pool ID valid for a processor. 00096 * ============================================================================ 00097 */ 00098 #define IS_VALID_POOLID(id) (POOL_getPoolNo((id)) < MAX_POOLENTRIES) 00099 00100 /** ============================================================================ 00101 * @name MAX_SMABUFENTRIES 00102 * 00103 * @brief The maximum number of buffer pools that can be configured for SMA. 00104 * ============================================================================ 00105 */ 00106 #define MAX_SMABUFENTRIES 16u 00107 00108 /** ============================================================================ 00109 * @name MAX_DMABUFENTRIES 00110 * 00111 * @brief The maximum number of buffer pools that can be configured for DMA. 00112 * ============================================================================ 00113 */ 00114 #define MAX_DMABUFENTRIES 16u 00115 00116 00117 /** ============================================================================ 00118 * @name AddrType 00119 * 00120 * @brief Enumerates the various types of addresses that can be translated 00121 * by the POOL. 00122 * 00123 * @param AddrType_Usr 00124 * User virtual address 00125 * @param AddrType_Phy 00126 * Physical address 00127 * @param AddrType_Knl 00128 * Kernel address 00129 * @param AddrType_Dsp 00130 * DSP address (if the buffer is in shared memory). 00131 * ============================================================================ 00132 */ 00133 typedef enum { 00134 AddrType_Usr = 0u, 00135 AddrType_Phy = 1u, 00136 AddrType_Knl = 2u, 00137 AddrType_Dsp = 3u 00138 } AddrType ; 00139 00140 00141 /** ============================================================================ 00142 * @name BUFPOOL_Attrs 00143 * 00144 * @brief This structure defines the attributes required for initialization of 00145 * the buffer pool. 00146 * 00147 * @param numBufPools 00148 * Number of entries in the arrays of buffer sizes and number of 00149 * buffers in the params structure. 00150 * @param bufSizes 00151 * Array of sizes of the buffers in the buffer pools. 00152 * This array is of size numBufObjs. 00153 * @param numBuffers 00154 * Array of number of buffers in all buffer pools. 00155 * This array is of size numBufObjs. 00156 * ============================================================================ 00157 */ 00158 typedef struct BUFPOOL_Attrs_tag { 00159 Uint32 numBufPools ; 00160 Uint32 * bufSizes ; 00161 Uint32 * numBuffers ; 00162 } BUFPOOL_Attrs ; 00163 00164 /** ============================================================================ 00165 * @name SMAPOOL_Attrs 00166 * 00167 * @brief This structure defines the attributes of the SMA POOL. 00168 * 00169 * @param numBufPools 00170 * Number of buffer pools. 00171 * @param bufSizes 00172 * Array of sizes of the buffers in each buffer pools. 00173 * @param numBuffers 00174 * Array of number of buffers in each buffer pools. 00175 * @param exactMatchReq 00176 * Flag indicating whether requested size is to be rounded to 00177 * nearest available size in Pools or exact match has to be 00178 * performed. 00179 * ============================================================================ 00180 */ 00181 typedef struct SMAPOOL_Attrs_tag { 00182 Uint32 numBufPools ; 00183 Uint32 * bufSizes ; 00184 Uint32 * numBuffers ; 00185 Bool exactMatchReq ; 00186 } SMAPOOL_Attrs ; 00187 00188 00189 /** ============================================================================ 00190 * @name DMAPOOL_Attrs 00191 * 00192 * @brief This structure defines the attributes of the DMA POOL. 00193 * 00194 * @param numBufPools 00195 * Number of buffer pools. 00196 * @param bufSizes 00197 * Array of sizes of the buffers in each buffer pools. 00198 * @param numBuffers 00199 * Array of number of buffers in each buffer pools. 00200 * @param exactMatchReq 00201 * Flag indicating whether requested size is to be rounded to 00202 * nearest available size in Pools or exact match has to be 00203 * performed. 00204 * ============================================================================ 00205 */ 00206 typedef struct DMAPOOL_Attrs_tag { 00207 Uint32 numBufPools ; 00208 Uint32 * bufSizes ; 00209 Uint32 * numBuffers ; 00210 Bool exactMatchReq ; 00211 } DMAPOOL_Attrs ; 00212 00213 00214 /** ============================================================================ 00215 * @deprecated The deprecated data structure BUFPOOL_Attrs has been replaced 00216 * with BUFPOOL_Attrs. 00217 * 00218 * ============================================================================ 00219 */ 00220 #define BufPoolAttrs BUFPOOL_Attrs 00221 00222 /** ============================================================================ 00223 * @deprecated The deprecated data structure SmaPoolAttrs has been replaced 00224 * with SMAPOOL_Attrs. 00225 * 00226 * ============================================================================ 00227 */ 00228 #define SmaPoolAttrs SMAPOOL_Attrs 00229 00230 00231 #if defined (__cplusplus) 00232 } 00233 #endif 00234 00235 00236 #endif /* !defined (POOLDEFS_H) */