![]() |
![]() |
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 * */ 00067 #ifndef ti_ipc_HeapMemMP__include 00068 #define ti_ipc_HeapMemMP__include 00069 00070 #if defined (__cplusplus) 00071 extern "C" { 00072 #endif 00073 00074 #include <ti/ipc/GateMP.h> 00075 00076 /* ============================================================================= 00077 * All success and failure codes for the module 00078 * ============================================================================= 00079 */ 00080 00085 #define HeapMemMP_S_BUSY 2 00086 00091 #define HeapMemMP_S_ALREADYSETUP 1 00092 00097 #define HeapMemMP_S_SUCCESS 0 00098 00103 #define HeapMemMP_E_FAIL -1 00104 00109 #define HeapMemMP_E_INVALIDARG -2 00110 00115 #define HeapMemMP_E_MEMORY -3 00116 00121 #define HeapMemMP_E_ALREADYEXISTS -4 00122 00127 #define HeapMemMP_E_NOTFOUND -5 00128 00133 #define HeapMemMP_E_TIMEOUT -6 00134 00139 #define HeapMemMP_E_INVALIDSTATE -7 00140 00144 #define HeapMemMP_E_OSFAILURE -8 00145 00149 #define HeapMemMP_E_RESOURCE -9 00150 00154 #define HeapMemMP_E_RESTART -10 00155 00156 /* ============================================================================= 00157 * Structures & Enums 00158 * ============================================================================= 00159 */ 00160 00164 typedef struct HeapMemMP_Object *HeapMemMP_Handle; 00165 00169 typedef struct HeapMemMP_Params { 00170 String name; 00178 UInt16 regionId; 00186 Ptr sharedAddr; 00197 SizeT sharedBufSize; 00211 GateMP_Handle gate; 00218 } HeapMemMP_Params; 00219 00223 typedef struct HeapMemMP_ExtendedStats { 00224 Ptr buf; 00227 SizeT size; 00229 } HeapMemMP_ExtendedStats; 00230 00231 /* ============================================================================= 00232 * HeapMemMP Module-wide Functions 00233 * ============================================================================= 00234 */ 00235 00245 Int HeapMemMP_close(HeapMemMP_Handle *handlePtr); 00246 00254 HeapMemMP_Handle HeapMemMP_create(const HeapMemMP_Params *params); 00255 00261 Int HeapMemMP_delete(HeapMemMP_Handle *handlePtr); 00262 00287 Int HeapMemMP_open(String name, HeapMemMP_Handle *handlePtr); 00288 00290 Int HeapMemMP_openByAddr(Ptr sharedAddr, HeapMemMP_Handle *handlePtr); 00291 00300 Void HeapMemMP_Params_init(HeapMemMP_Params *params); 00301 00311 SizeT HeapMemMP_sharedMemReq(const HeapMemMP_Params *params); 00312 00315 /* ============================================================================= 00316 * HeapMemMP Per-instance Functions 00317 * ============================================================================= 00318 */ 00319 00345 Void *HeapMemMP_alloc(HeapMemMP_Handle handle, SizeT size, SizeT align); 00346 00364 Void HeapMemMP_free(HeapMemMP_Handle handle, Ptr block, SizeT size); 00365 00378 Void HeapMemMP_getExtendedStats(HeapMemMP_Handle handle, 00379 HeapMemMP_ExtendedStats *stats); 00380 00389 Void HeapMemMP_getStats(HeapMemMP_Handle handle, Ptr stats); 00390 00401 Void HeapMemMP_restore(HeapMemMP_Handle handle); 00402 00403 #if defined (__cplusplus) 00404 } 00405 #endif /* defined (__cplusplus) */ 00406 #endif /* ti_ipc_HeapMemMP__include */ 00407 00408 /* 00409 */ 00410 00411 /* 00412 * @(#) ti.ipc; 1, 0, 0, 0,83; 4-9-2010 18:37:32; /db/vtree/library/trees/ipc/ipc-d23x/src/ 00413 */ 00414