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 00199 /* ============================================================================= 00200 * Structures & Enums 00201 * ============================================================================= 00202 */ 00203 00207 typedef Bits32 SharedRegion_SRPtr; 00208 00212 typedef struct SharedRegion_Entry { 00213 Ptr base; 00216 SizeT len; 00223 UInt16 ownerProcId; 00230 Bool isValid; 00233 Bool cacheEnable; 00242 SizeT cacheLineSize; 00250 Bool createHeap; 00259 String name; 00265 } SharedRegion_Entry; 00266 00267 00268 /* ============================================================================= 00269 * SharedRegion Module-wide Functions 00270 * ============================================================================= 00271 */ 00272 00294 Int SharedRegion_clearEntry(UInt16 regionId); 00295 00303 Void SharedRegion_entryInit(SharedRegion_Entry *entry); 00304 00314 SizeT SharedRegion_getCacheLineSize(UInt16 regionId); 00315 00328 Int SharedRegion_getEntry(UInt16 regionId, SharedRegion_Entry *entry); 00329 00366 Ptr SharedRegion_getHeap(UInt16 regionId); 00367 00375 UInt16 SharedRegion_getId(Ptr addr); 00376 00384 UInt16 SharedRegion_getIdByName(String name); 00385 00391 UInt16 SharedRegion_getNumRegions(Void); 00392 00402 Ptr SharedRegion_getPtr(SharedRegion_SRPtr srptr); 00403 00414 SharedRegion_SRPtr SharedRegion_getSRPtr(Ptr addr, UInt16 regionId); 00415 00423 Bool SharedRegion_isCacheEnabled(UInt16 regionId); 00424 00453 Int SharedRegion_setEntry(UInt16 regionId, SharedRegion_Entry *entry); 00454 00460 Bool SharedRegion_translateEnabled(Void); 00461 00467 SharedRegion_SRPtr SharedRegion_invalidSRPtr(Void); 00468 00469 #if defined (__cplusplus) 00470 } 00471 #endif /* defined (__cplusplus) */ 00472 00473 #endif /* ti_ipc_SharedRegion__include */ 00474 00475 /* 00476 * @(#) ti.ipc; 1, 0, 0, 0,4; 10-19-2011 10:45:10; /db/vtree/library/trees/ipc/ipc.git/src/ null 00477 */ 00478