![]() |
![]() |
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_HeapQueueMgr__include 00068 #define ti_ipc_HeapQueueMgr__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 HeapQueueMgr_S_BUSY 2 00086 00091 #define HeapQueueMgr_S_ALREADYSETUP 1 00092 00097 #define HeapQueueMgr_S_SUCCESS 0 00098 00103 #define HeapQueueMgr_E_FAIL -1 00104 00109 #define HeapQueueMgr_E_INVALIDARG -2 00110 00115 #define HeapQueueMgr_E_MEMORY -3 00116 00121 #define HeapQueueMgr_E_ALREADYEXISTS -4 00122 00127 #define HeapQueueMgr_E_NOTFOUND -5 00128 00133 #define HeapQueueMgr_E_TIMEOUT -6 00134 00139 #define HeapQueueMgr_E_INVALIDSTATE -7 00140 00144 #define HeapQueueMgr_E_OSFAILURE -8 00145 00149 #define HeapQueueMgr_E_RESOURCE -9 00150 00154 #define HeapQueueMgr_E_RESTART -10 00155 00156 /* ============================================================================= 00157 * Structures & Enums 00158 * ============================================================================= 00159 */ 00160 00164 typedef struct HeapQueueMgr_Object *HeapQueueMgr_Handle; 00165 00169 typedef struct HeapQueueMgr_Params { 00170 String name; 00178 UInt16 regionId; 00186 Ptr sharedAddr; 00197 SizeT blockSize; 00210 UInt numBlocks; 00216 } HeapQueueMgr_Params; 00217 00218 00219 /* ============================================================================= 00220 * HeapQueueMgr Module-wide Functions 00221 * ============================================================================= 00222 */ 00223 00235 Int HeapQueueMgr_close(HeapQueueMgr_Handle *handlePtr); 00236 00244 HeapQueueMgr_Handle HeapQueueMgr_create(const HeapQueueMgr_Params *params); 00245 00251 Int HeapQueueMgr_delete(HeapQueueMgr_Handle *handlePtr); 00252 00277 Int HeapQueueMgr_open(String name, HeapQueueMgr_Handle *handlePtr); 00278 00280 Int HeapQueueMgr_openByAddr(Ptr sharedAddr, HeapQueueMgr_Handle *handlePtr); 00281 00290 Void HeapQueueMgr_Params_init(HeapQueueMgr_Params *params); 00291 00301 SizeT HeapQueueMgr_sharedMemReq(const HeapQueueMgr_Params *params); 00302 00305 /* ============================================================================= 00306 * HeapQueueMgr Per-instance Functions 00307 * ============================================================================= 00308 */ 00309 00335 Void *HeapQueueMgr_alloc(HeapQueueMgr_Handle handle, SizeT size, 00336 SizeT align); 00337 00355 Void HeapQueueMgr_free(HeapQueueMgr_Handle handle, Ptr block, SizeT size); 00356 00365 Void HeapQueueMgr_getStats(HeapQueueMgr_Handle handle, Ptr stats); 00366 00367 #if defined (__cplusplus) 00368 } 00369 #endif /* defined (__cplusplus) */ 00370 #endif /* ti_ipc_HeapQueueMgr__include */ 00371 00372 /* 00373 */ 00374 00375 /* 00376 * @(#) ti.ipc; 1, 0, 0, 0,83; 4-9-2010 18:37:32; /db/vtree/library/trees/ipc/ipc-d23x/src/ 00377 */ 00378