00001 00012 /* 00013 * ============================================================================ 00014 * 00015 * Copyright (c) 2008-2009, Texas Instruments Incorporated 00016 * 00017 * Redistribution and use in source and binary forms, with or without 00018 * modification, are permitted provided that the following conditions 00019 * are met: 00020 * 00021 * * Redistributions of source code must retain the above copyright 00022 * notice, this list of conditions and the following disclaimer. 00023 * 00024 * * Redistributions in binary form must reproduce the above copyright 00025 * notice, this list of conditions and the following disclaimer in the 00026 * documentation and/or other materials provided with the distribution. 00027 * 00028 * * Neither the name of Texas Instruments Incorporated nor the names of 00029 * its contributors may be used to endorse or promote products derived 00030 * from this software without specific prior written permission. 00031 * 00032 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00033 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 00034 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00035 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 00036 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00037 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00038 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 00039 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 00040 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 00041 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 00042 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00043 * Contact information for paper mail: 00044 * Texas Instruments 00045 * Post Office Box 655303 00046 * Dallas, Texas 75265 00047 * Contact information: 00048 * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm? 00049 * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact 00050 * ============================================================================ 00051 * 00052 */ 00053 00054 00055 00056 #ifndef RINGIOSHM_H_ 00057 #define RINGIOSHM_H_ 00058 00059 #include <ti/ipc/GateMP.h> 00060 00061 00062 #if defined (__cplusplus) 00063 extern "C" { 00064 #endif 00065 /* ============================================================================= 00066 * All success and failure codes for the module 00067 * ============================================================================= 00068 */ 00069 00074 #define RingIOShm_MODULEID (0x3bff) 00075 00076 /* ============================================================================= 00077 * All success and failure codes for the module 00078 * ============================================================================= 00079 */ 00084 #define RingIOShm_STATUSCODEBASE \ 00085 (RingIOShm_MODULEID << 12u) 00086 00091 #define RingIOShm_MAKE_FAILURE(x) ((Int32) ( 0x80000000 \ 00092 + (RingIOShm_STATUSCODEBASE \ 00093 + (x)))) 00094 00099 #define RingIOShm_MAKE_SUCCESS(x) \ 00100 (RingIOShm_STATUSCODEBASE + (x)) 00101 00106 #define RingIOShm_E_INVALIDARG RingIOShm_MAKE_FAILURE(-1) 00107 00112 #define RingIOShm_E_INVALIDSIZE RingIOShm_MAKE_FAILURE(-2) 00113 00118 #define RingIOShm_E_INVALIDSTATE RingIOShm_MAKE_FAILURE(-3) 00119 00124 #define RingIOShm_E_BADVERSION RingIOShm_MAKE_FAILURE(-4) 00125 00130 #define RingIOShm_E_FAIL RingIOShm_MAKE_FAILURE(-5) 00131 00136 #define RingIOShm_E_MEMORY RingIOShm_MAKE_FAILURE(-6) 00137 00142 #define RingIOShm_E_OSFAILURE RingIOShm_MAKE_FAILURE(-7) 00143 00148 #define RingIOShm_E_HANDLE RingIOShm_MAKE_FAILURE(-8) 00149 00155 #define RingIOShm_E_BUFWRAP RingIOShm_MAKE_FAILURE(-9) 00156 00161 #define RingIOShm_E_BUFEMPTY RingIOShm_MAKE_FAILURE(-10) 00162 00167 #define RingIOShm_E_BUFFULL RingIOShm_MAKE_FAILURE(-11) 00168 00174 #define RingIOShm_E_PENDINGDATA RingIOShm_MAKE_FAILURE(-12) 00175 00181 #define RingIOShm_E_VARIABLEATTRIBUTE RingIOShm_MAKE_FAILURE(-13) 00182 00188 #define RingIOShm_E_NOTCONTIGUOUSDATA RingIOShm_MAKE_FAILURE(-14) 00189 00194 #define RingIOShm_E_WRONGSTATE RingIOShm_MAKE_FAILURE(-15) 00195 00200 #define RingIOShm_E_INVALIDPROCID RingIOShm_MAKE_FAILURE(-16) 00201 00205 #define RingIOShm_E_INVALIDCONTEXT RingIOShm_MAKE_FAILURE(-17) 00206 00211 #define RingIOShm_S_SUCCESS RingIOShm_MAKE_SUCCESS(0) 00212 00218 #define RingIOShm_S_ALREADYSETUP RingIOShm_MAKE_SUCCESS(1) 00219 00228 #define RingIOShm_S_PENDINGATTRIBUTE RingIOShm_MAKE_SUCCESS(1) 00229 00230 00231 /* ============================================================================= 00232 * Structures & Enums 00233 * ============================================================================= 00234 */ 00239 typedef struct RingIOShm_Params_Tag { 00240 RingIO_Params commonParams; 00242 UInt16 ctrlRegionId; 00250 UInt16 dataRegionId; 00258 UInt16 attrRegionId; 00266 Ptr ctrlSharedAddr; 00274 Ptr dataSharedAddr; 00280 UInt32 dataSharedAddrSize; 00282 UInt32 footBufSize; 00284 Ptr attrSharedAddr; 00289 UInt32 attrSharedAddrSize; 00291 GateMP_Handle gateHandle; 00302 GateMP_LocalProtect localProtect; 00304 GateMP_RemoteProtect remoteProtect; 00306 UInt16 remoteProcId; 00308 } RingIOShm_Params; 00309 00310 00314 typedef struct RingIOShm_Config_Tag { 00315 UInt32 notifyEventNo; 00317 } RingIOShm_Config; 00318 00319 /* ============================================================================= 00320 * APIs 00321 * ============================================================================= 00322 */ 00337 Void RingIOShm_Params_init (Void * params); 00353 Void RingIOShm_getConfig (RingIOShm_Config * cfgParams); 00354 00379 Int RingIOShm_setup (const RingIOShm_Config * cfgParams); 00380 00390 Int RingIOShm_destroy (Void); 00391 00392 00393 00394 #if defined (__cplusplus) 00395 } 00396 #endif /* defined (__cplusplus) */ 00397 00398 00399 #endif /* RINGIOSHM_H_ */