00001 /* 00002 * Copyright (c) 2012, Texas Instruments Incorporated 00003 * All rights reserved. 00004 * 00005 * Redistribution and use in source and binary forms, with or without 00006 * modification, are permitted provided that the following conditions 00007 * are met: 00008 * 00009 * * Redistributions of source code must retain the above copyright 00010 * notice, this list of conditions and the following disclaimer. 00011 * 00012 * * Redistributions in binary form must reproduce the above copyright 00013 * notice, this list of conditions and the following disclaimer in the 00014 * documentation and/or other materials provided with the distribution. 00015 * 00016 * * Neither the name of Texas Instruments Incorporated nor the names of 00017 * its contributors may be used to endorse or promote products derived 00018 * from this software without specific prior written permission. 00019 * 00020 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00021 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 00022 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00023 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 00024 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00025 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00026 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 00027 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 00028 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 00029 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 00030 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00031 * */ 00101 #ifndef ti_ipc_SharedRegion__include 00102 #define ti_ipc_SharedRegion__include 00103 00104 00105 #if defined (__cplusplus) 00106 extern "C" { 00107 #endif 00108 00109 /* ============================================================================ 00110 * All success and failure codes for the module 00111 * ============================================================================= 00112 */ 00113 00118 #define SharedRegion_S_BUSY 2 00119 00124 #define SharedRegion_S_ALREADYSETUP 1 00125 00130 #define SharedRegion_S_SUCCESS 0 00131 00136 #define SharedRegion_E_FAIL -1 00137 00142 #define SharedRegion_E_INVALIDARG -2 00143 00148 #define SharedRegion_E_MEMORY -3 00149 00154 #define SharedRegion_E_ALREADYEXISTS -4 00155 00160 #define SharedRegion_E_NOTFOUND -5 00161 00166 #define SharedRegion_E_TIMEOUT -6 00167 00172 #define SharedRegion_E_INVALIDSTATE -7 00173 00178 #define SharedRegion_E_OSFAILURE -8 00179 00184 #define SharedRegion_E_RESOURCE -9 00185 00190 #define SharedRegion_E_RESTART -10 00191 00192 /* ============================================================================= 00193 * Macros 00194 * ============================================================================= 00195 */ 00196 00201 #define SharedRegion_INVALIDREGIONID (0xFFFF) 00202 00203 /* ============================================================================= 00204 * Structures & Enums 00205 * ============================================================================= 00206 */ 00207 00211 typedef Bits32 SharedRegion_SRPtr; 00212 00216 typedef struct SharedRegion_Entry { 00217 Ptr base; 00220 SizeT len; 00227 UInt16 ownerProcId; 00234 Bool isValid; 00237 Bool cacheEnable; 00246 SizeT cacheLineSize; 00254 Bool createHeap; 00263 String name; 00269 } SharedRegion_Entry; 00270 00271 00272 /* ============================================================================= 00273 * SharedRegion Module-wide Functions 00274 * ============================================================================= 00275 */ 00276 00298 Int SharedRegion_clearEntry(UInt16 regionId); 00299 00307 Void SharedRegion_entryInit(SharedRegion_Entry *entry); 00308 00318 SizeT SharedRegion_getCacheLineSize(UInt16 regionId); 00319 00332 Int SharedRegion_getEntry(UInt16 regionId, SharedRegion_Entry *entry); 00333 00370 Ptr SharedRegion_getHeap(UInt16 regionId); 00371 00379 UInt16 SharedRegion_getId(Ptr addr); 00380 00388 UInt16 SharedRegion_getIdByName(String name); 00389 00395 UInt16 SharedRegion_getNumRegions(Void); 00396 00406 Ptr SharedRegion_getPtr(SharedRegion_SRPtr srptr); 00407 00418 SharedRegion_SRPtr SharedRegion_getSRPtr(Ptr addr, UInt16 regionId); 00419 00427 Bool SharedRegion_isCacheEnabled(UInt16 regionId); 00428 00457 Int SharedRegion_setEntry(UInt16 regionId, SharedRegion_Entry *entry); 00458 00464 Bool SharedRegion_translateEnabled(Void); 00465 00471 SharedRegion_SRPtr SharedRegion_invalidSRPtr(Void); 00472 00473 #if defined (__cplusplus) 00474 } 00475 #endif /* defined (__cplusplus) */ 00476 00477 #endif /* ti_ipc_SharedRegion__include */ 00478 00479 /* 00480 * @(#) ti.ipc; 1, 0, 0, 0,2; 2-11-2012 16:30:15; /db/vtree/library/trees/ipc/ipc-h27/src/ xlibrary 00481 00482 */ 00483