00001 00008 /* 00009 * ============================================================================ 00010 * 00011 * Copyright (c) 2008-2012, Texas Instruments Incorporated 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 * Contact information for paper mail: 00040 * Texas Instruments 00041 * Post Office Box 655303 00042 * Dallas, Texas 75265 00043 * Contact information: 00044 * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm? 00045 * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact 00046 * ============================================================================ 00047 * 00048 */ 00049 00050 00051 #ifndef FRAMEQ_SHMEM_H 00052 #define FRAMEQ_SHMEM_H 00053 00054 #include <ti/ipc/GateMP.h> 00055 00056 #if defined (__cplusplus) 00057 extern "C" { 00058 #endif 00059 00060 /* ============================================================================= 00061 * Macros & defines 00062 * ============================================================================= 00063 */ 00064 00065 typedef FrameQ_Config FrameQ_ShMem_Config ; 00066 00067 /* ============================================================================= 00068 * Structures & Enums 00069 * ============================================================================= 00070 */ 00071 00076 typedef struct FrameQ_ShMem_Params_tag { 00077 FrameQ_CreateParams commonCreateParams; 00080 GateMP_Handle gate; 00093 GateMP_LocalProtect localProtect; 00099 GateMP_RemoteProtect remoteProtect; 00105 Ptr sharedAddr; 00116 UInt32 sharedAddrSize; 00126 UInt32 regionId; 00134 UInt32 numReaders; 00139 UInt32 numQueues; 00143 UInt32 cpuAccessFlags; 00150 String frameQBufMgrName; 00158 Ptr frameQBufMgrSharedAddr; 00163 } FrameQ_ShMem_Params; 00164 00165 00170 typedef struct FrameQ_ShMem_OpenParams_tag { 00171 FrameQ_CommonOpenParams commonOpenParams; 00173 }FrameQ_ShMem_OpenParams; 00174 00175 00176 /* ============================================================================= 00177 * APIs 00178 * ============================================================================= 00179 */ 00180 00190 void 00191 FrameQ_ShMem_Params_init(FrameQ_ShMem_Params * params); 00192 00205 UInt32 00206 FrameQ_ShMem_sharedMemReq (const FrameQ_ShMem_Params * params); 00207 00208 /* 00209 * @brief Get the default configuration for the FrameQ_ShMem module. 00210 * 00211 * This function can be called by the application to get their 00212 * configuration parameter to FrameQ_setup filled in by 00213 * the FrameQ module with the default parameters. If the 00214 * user does not wish to make any change in the default parameters, 00215 * this API is not required to be called. 00216 * 00217 * @param cfg Pointer to the FrameQ module configuration 00218 * structure in which the default config is to be 00219 * returned. 00220 * 00221 * @sa FrameQ_setup 00222 */ 00223 Void FrameQ_ShMem_getConfig(FrameQ_ShMem_Config *cfg); 00224 00225 /* 00226 * @brief Setup the FrameQ module. 00227 * 00228 * This function sets up the FrameQ module. This function 00229 * must be called before any other instance-level APIs can be 00230 * invoked. 00231 * Module-level configuration needs to be provided to this 00232 * function. If the user wishes to change some specific config 00233 * parameters, then FrameQ_getConfig can be called to get 00234 * the configuration filled with the default values. After this, 00235 * only the required configuration values can be changed. If the 00236 * user does not wish to make any change in the default parameters, 00237 * the application can simply call FrameQ_setup with NULL 00238 * parameters. The default parameters would get automatically used. 00239 * 00240 * @param cfg Optional FrameQ module configuration. If provided 00241 * as NULL, default configuration is used. 00242 * 00243 * @sa FrameQ_destroy, FrameQ_getConfig 00244 */ 00245 Int32 00246 FrameQ_ShMem_setup (FrameQ_ShMem_Config * cfg); 00247 00248 /* 00249 * ======== FrameQ_ShMem_destroy ======== 00250 * API to finalize the module. 00251 */ 00252 Int32 00253 FrameQ_ShMem_destroy (void); 00254 00255 #if defined (__cplusplus) 00256 } 00257 #endif 00258 00259 00260 #endif /* FRAMEQ_SHMEM_H */ 00261