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 * */ 00072 #ifndef ti_ipc_HeapQueueMgr__include 00073 #define ti_ipc_HeapQueueMgr__include 00074 00075 #if defined (__cplusplus) 00076 extern "C" { 00077 #endif 00078 00079 #include <ti/ipc/GateMP.h> 00080 00081 /* ============================================================================= 00082 * All success and failure codes for the module 00083 * ============================================================================= 00084 */ 00085 00090 #define HeapQueueMgr_S_BUSY 2 00091 00096 #define HeapQueueMgr_S_ALREADYSETUP 1 00097 00102 #define HeapQueueMgr_S_SUCCESS 0 00103 00108 #define HeapQueueMgr_E_FAIL -1 00109 00114 #define HeapQueueMgr_E_INVALIDARG -2 00115 00120 #define HeapQueueMgr_E_MEMORY -3 00121 00126 #define HeapQueueMgr_E_ALREADYEXISTS -4 00127 00132 #define HeapQueueMgr_E_NOTFOUND -5 00133 00138 #define HeapQueueMgr_E_TIMEOUT -6 00139 00144 #define HeapQueueMgr_E_INVALIDSTATE -7 00145 00149 #define HeapQueueMgr_E_OSFAILURE -8 00150 00154 #define HeapQueueMgr_E_RESOURCE -9 00155 00159 #define HeapQueueMgr_E_RESTART -10 00160 00161 /* ============================================================================= 00162 * Structures & Enums 00163 * ============================================================================= 00164 */ 00165 00169 typedef struct HeapQueueMgr_Object *HeapQueueMgr_Handle; 00170 00174 typedef struct HeapQueueMgr_Params { 00175 String name; 00186 UInt16 regionId; 00194 Ptr sharedAddr; 00205 SizeT blockSize; 00218 UInt numBlocks; 00224 } HeapQueueMgr_Params; 00225 00226 00227 /* ============================================================================= 00228 * HeapQueueMgr Module-wide Functions 00229 * ============================================================================= 00230 */ 00231 00243 Int HeapQueueMgr_close(HeapQueueMgr_Handle *handlePtr); 00244 00252 HeapQueueMgr_Handle HeapQueueMgr_create(const HeapQueueMgr_Params *params); 00253 00259 Int HeapQueueMgr_delete(HeapQueueMgr_Handle *handlePtr); 00260 00285 Int HeapQueueMgr_open(String name, HeapQueueMgr_Handle *handlePtr); 00286 00288 Int HeapQueueMgr_openByAddr(Ptr sharedAddr, HeapQueueMgr_Handle *handlePtr); 00289 00298 Void HeapQueueMgr_Params_init(HeapQueueMgr_Params *params); 00299 00309 SizeT HeapQueueMgr_sharedMemReq(const HeapQueueMgr_Params *params); 00310 00313 /* ============================================================================= 00314 * HeapQueueMgr Per-instance Functions 00315 * ============================================================================= 00316 */ 00317 00343 Void *HeapQueueMgr_alloc(HeapQueueMgr_Handle handle, SizeT size, 00344 SizeT align); 00345 00363 Void HeapQueueMgr_free(HeapQueueMgr_Handle handle, Ptr block, SizeT size); 00364 00373 Void HeapQueueMgr_getStats(HeapQueueMgr_Handle handle, Ptr stats); 00374 00375 #if defined (__cplusplus) 00376 } 00377 #endif /* defined (__cplusplus) */ 00378 #endif /* ti_ipc_HeapQueueMgr__include */ 00379 00380 /* 00381 */ 00382 00383 /* 00384 * @(#) ti.ipc; 1, 0, 0, 0,123; 5-16-2011 16:46:34; /db/vtree/library/trees/ipc/ipc.git/src/ ipc-f29 00385 */ 00386