00001 /* 00002 * Copyright (c) 2011, 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 * */ 00097 #ifndef ti_ipc_SharedRegion__include 00098 #define ti_ipc_SharedRegion__include 00099 00100 00101 #if defined (__cplusplus) 00102 extern "C" { 00103 #endif 00104 00105 /* ============================================================================ 00106 * All success and failure codes for the module 00107 * ============================================================================= 00108 */ 00109 00114 #define SharedRegion_S_BUSY 2 00115 00120 #define SharedRegion_S_ALREADYSETUP 1 00121 00126 #define SharedRegion_S_SUCCESS 0 00127 00132 #define SharedRegion_E_FAIL -1 00133 00138 #define SharedRegion_E_INVALIDARG -2 00139 00144 #define SharedRegion_E_MEMORY -3 00145 00150 #define SharedRegion_E_ALREADYEXISTS -4 00151 00156 #define SharedRegion_E_NOTFOUND -5 00157 00162 #define SharedRegion_E_TIMEOUT -6 00163 00168 #define SharedRegion_E_INVALIDSTATE -7 00169 00174 #define SharedRegion_E_OSFAILURE -8 00175 00180 #define SharedRegion_E_RESOURCE -9 00181 00186 #define SharedRegion_E_RESTART -10 00187 00188 /* ============================================================================= 00189 * Macros 00190 * ============================================================================= 00191 */ 00192 00197 #define SharedRegion_INVALIDREGIONID (0xFFFF) 00198 00203 #define SharedRegion_DEFAULTOWNERID (UInt16)(~0) 00204 00205 /* ============================================================================= 00206 * Structures & Enums 00207 * ============================================================================= 00208 */ 00209 00213 typedef Bits32 SharedRegion_SRPtr; 00214 00218 typedef struct SharedRegion_Entry { 00219 Ptr base; 00222 SizeT len; 00229 UInt16 ownerProcId; 00236 Bool isValid; 00239 Bool cacheEnable; 00248 SizeT cacheLineSize; 00256 Bool createHeap; 00265 String name; 00271 } SharedRegion_Entry; 00272 00273 00274 /* ============================================================================= 00275 * SharedRegion Module-wide Functions 00276 * ============================================================================= 00277 */ 00278 00300 Int SharedRegion_clearEntry(UInt16 regionId); 00301 00309 Void SharedRegion_entryInit(SharedRegion_Entry *entry); 00310 00320 SizeT SharedRegion_getCacheLineSize(UInt16 regionId); 00321 00334 Int SharedRegion_getEntry(UInt16 regionId, SharedRegion_Entry *entry); 00335 00372 Ptr SharedRegion_getHeap(UInt16 regionId); 00373 00381 UInt16 SharedRegion_getId(Ptr addr); 00382 00390 UInt16 SharedRegion_getIdByName(String name); 00391 00397 UInt16 SharedRegion_getNumRegions(Void); 00398 00408 Ptr SharedRegion_getPtr(SharedRegion_SRPtr srptr); 00409 00420 SharedRegion_SRPtr SharedRegion_getSRPtr(Ptr addr, UInt16 regionId); 00421 00429 Bool SharedRegion_isCacheEnabled(UInt16 regionId); 00430 00459 Int SharedRegion_setEntry(UInt16 regionId, SharedRegion_Entry *entry); 00460 00466 Bool SharedRegion_translateEnabled(Void); 00467 00473 SharedRegion_SRPtr SharedRegion_invalidSRPtr(Void); 00474 00475 #if defined (__cplusplus) 00476 } 00477 #endif /* defined (__cplusplus) */ 00478 00479 #endif /* ti_ipc_SharedRegion__include */ 00480 00481 /* 00482 */ 00483 /* 00484 * @(#) ti.ipc; 1, 0, 0, 0,4; 7-20-2011 15:51:06; /db/vtree/library/trees/ipc/ipc.git/src/ null 00485 */ 00486