![]() |
![]() |
00001 00010 /* 00011 * ============================================================================ 00012 * 00013 * Copyright (c) 2008-2012, 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 FRAMEQ_SHMEM_H 00054 #define FRAMEQ_SHMEM_H 00055 00056 #include <ti/ipc/GateMP.h> 00057 00058 #if defined (__cplusplus) 00059 extern "C" { 00060 #endif 00061 00062 /* ============================================================================= 00063 * Macros & defines 00064 * ============================================================================= 00065 */ 00066 00067 typedef FrameQ_Config FrameQ_ShMem_Config ; 00068 00069 /* ============================================================================= 00070 * Structures & Enums 00071 * ============================================================================= 00072 */ 00073 00078 typedef struct FrameQ_ShMem_Params_tag { 00079 FrameQ_CreateParams commonCreateParams; 00082 GateMP_Handle gate; 00095 GateMP_LocalProtect localProtect; 00101 GateMP_RemoteProtect remoteProtect; 00107 Ptr sharedAddr; 00118 UInt32 sharedAddrSize; 00128 UInt32 regionId; 00136 UInt32 numReaders; 00141 UInt32 numQueues; 00145 UInt32 cpuAccessFlags; 00152 String frameQBufMgrName; 00160 Ptr frameQBufMgrSharedAddr; 00165 } FrameQ_ShMem_Params; 00166 00167 00172 typedef struct FrameQ_ShMem_OpenParams_tag { 00173 FrameQ_CommonOpenParams commonOpenParams; 00175 }FrameQ_ShMem_OpenParams; 00176 00177 00178 /* ============================================================================= 00179 * APIs 00180 * ============================================================================= 00181 */ 00182 00192 void 00193 FrameQ_ShMem_Params_init(FrameQ_ShMem_Params * params); 00194 00207 UInt32 00208 FrameQ_ShMem_sharedMemReq (const FrameQ_ShMem_Params * params); 00209 00210 /* 00211 * @brief Get the default configuration for the FrameQ_ShMem module. 00212 * 00213 * This function can be called by the application to get their 00214 * configuration parameter to FrameQ_setup filled in by 00215 * the FrameQ module with the default parameters. If the 00216 * user does not wish to make any change in the default parameters, 00217 * this API is not required to be called. 00218 * 00219 * @param cfg Pointer to the FrameQ module configuration 00220 * structure in which the default config is to be 00221 * returned. 00222 * 00223 * @sa FrameQ_setup 00224 */ 00225 Void FrameQ_ShMem_getConfig(FrameQ_ShMem_Config *cfg); 00226 00227 /* 00228 * @brief Setup the FrameQ module. 00229 * 00230 * This function sets up the FrameQ module. This function 00231 * must be called before any other instance-level APIs can be 00232 * invoked. 00233 * Module-level configuration needs to be provided to this 00234 * function. If the user wishes to change some specific config 00235 * parameters, then FrameQ_getConfig can be called to get 00236 * the configuration filled with the default values. After this, 00237 * only the required configuration values can be changed. If the 00238 * user does not wish to make any change in the default parameters, 00239 * the application can simply call FrameQ_setup with NULL 00240 * parameters. The default parameters would get automatically used. 00241 * 00242 * @param cfg Optional FrameQ module configuration. If provided 00243 * as NULL, default configuration is used. 00244 * 00245 * @sa FrameQ_destroy, FrameQ_getConfig 00246 */ 00247 Int32 00248 FrameQ_ShMem_setup (FrameQ_ShMem_Config * cfg); 00249 00250 /* 00251 * ======== FrameQ_ShMem_destroy ======== 00252 * API to finalize the module. 00253 */ 00254 Int32 00255 FrameQ_ShMem_destroy (void); 00256 00257 #if defined (__cplusplus) 00258 } 00259 #endif 00260 00261 00262 #endif /* FRAMEQ_SHMEM_H */ 00263