![]() |
![]() |
00001 /* 00002 * Copyright (c) 2010, 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 * */ 00092 #ifndef ti_ipc_SharedRegion__include 00093 #define ti_ipc_SharedRegion__include 00094 00095 00096 #if defined (__cplusplus) 00097 extern "C" { 00098 #endif 00099 00100 /* ============================================================================ 00101 * All success and failure codes for the module 00102 * ============================================================================= 00103 */ 00104 00109 #define SharedRegion_S_BUSY 2 00110 00115 #define SharedRegion_S_ALREADYSETUP 1 00116 00121 #define SharedRegion_S_SUCCESS 0 00122 00127 #define SharedRegion_E_FAIL -1 00128 00133 #define SharedRegion_E_INVALIDARG -2 00134 00139 #define SharedRegion_E_MEMORY -3 00140 00145 #define SharedRegion_E_ALREADYEXISTS -4 00146 00151 #define SharedRegion_E_NOTFOUND -5 00152 00157 #define SharedRegion_E_TIMEOUT -6 00158 00163 #define SharedRegion_E_INVALIDSTATE -7 00164 00169 #define SharedRegion_E_OSFAILURE -8 00170 00175 #define SharedRegion_E_RESOURCE -9 00176 00181 #define SharedRegion_E_RESTART -10 00182 00183 /* ============================================================================= 00184 * Macros 00185 * ============================================================================= 00186 */ 00187 00192 #define SharedRegion_INVALIDREGIONID (0xFFFF) 00193 00198 #define SharedRegion_DEFAULTOWNERID (UInt16)(~0) 00199 00200 /* ============================================================================= 00201 * Structures & Enums 00202 * ============================================================================= 00203 */ 00204 00208 typedef Bits32 SharedRegion_SRPtr; 00209 00213 typedef struct SharedRegion_Entry { 00214 Ptr base; 00217 SizeT len; 00220 UInt16 ownerProcId; 00223 Bool isValid; 00226 Bool cacheEnable; 00229 SizeT cacheLineSize; 00232 Bool createHeap; 00235 String name; 00237 } SharedRegion_Entry; 00238 00239 00240 /* ============================================================================= 00241 * SharedRegion Module-wide Functions 00242 * ============================================================================= 00243 */ 00244 00257 Int SharedRegion_clearEntry(UInt16 regionId); 00258 00266 Void SharedRegion_entryInit(SharedRegion_Entry *entry); 00267 00277 SizeT SharedRegion_getCacheLineSize(UInt16 regionId); 00278 00291 Int SharedRegion_getEntry(UInt16 regionId, SharedRegion_Entry *entry); 00292 00300 Ptr SharedRegion_getHeap(UInt16 regionId); 00301 00309 UInt16 SharedRegion_getId(Ptr addr); 00310 00318 UInt16 SharedRegion_getIdByName(String name); 00319 00325 UInt16 SharedRegion_getNumRegions(Void); 00326 00336 Ptr SharedRegion_getPtr(SharedRegion_SRPtr srptr); 00337 00348 SharedRegion_SRPtr SharedRegion_getSRPtr(Ptr addr, UInt16 regionId); 00349 00357 Bool SharedRegion_isCacheEnabled(UInt16 regionId); 00358 00371 Int SharedRegion_setEntry(UInt16 regionId, SharedRegion_Entry *entry); 00372 00378 Bool SharedRegion_translateEnabled(Void); 00379 00385 SharedRegion_SRPtr SharedRegion_invalidSRPtr(Void); 00386 00387 #if defined (__cplusplus) 00388 } 00389 #endif /* defined (__cplusplus) */ 00390 00391 #endif /* ti_ipc_SharedRegion__include */ 00392 00393 /* 00394 */ 00395 /* 00396 * @(#) ti.ipc; 1, 0, 0, 0,83; 4-9-2010 18:37:33; /db/vtree/library/trees/ipc/ipc-d23x/src/ 00397 */ 00398