Project  1.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
HeapMultiBufMP.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  * */
105 #ifndef ti_ipc_HeapMultiBufMP__include
106 #define ti_ipc_HeapMultiBufMP__include
107 
108 #if defined (__cplusplus)
109 extern "C" {
110 #endif
111 
112 #include <ti/ipc/GateMP.h>
113 
114 /* =============================================================================
115  * All success and failure codes for the module
116  * =============================================================================
117  */
118 
122 #define HeapMultiBufMP_S_BUSY 2
123 
127 #define HeapMultiBufMP_S_ALREADYSETUP 1
128 
132 #define HeapMultiBufMP_S_SUCCESS 0
133 
137 #define HeapMultiBufMP_E_FAIL -1
138 
142 #define HeapMultiBufMP_E_INVALIDARG -2
143 
147 #define HeapMultiBufMP_E_MEMORY -3
148 
152 #define HeapMultiBufMP_E_ALREADYEXISTS -4
153 
157 #define HeapMultiBufMP_E_NOTFOUND -5
158 
162 #define HeapMultiBufMP_E_TIMEOUT -6
163 
167 #define HeapMultiBufMP_E_INVALIDSTATE -7
168 
171 #define HeapMultiBufMP_E_OSFAILURE -8
172 
175 #define HeapMultiBufMP_E_RESOURCE -9
176 
179 #define HeapMultiBufMP_E_RESTART -10
180 
181 /* =============================================================================
182  * Macros
183  * =============================================================================
184  */
185 
189 #define HeapMultiBufMP_MAXBUCKETS ((UInt)8)
190 
191 /* =============================================================================
192  * Structures & Enums
193  * =============================================================================
194  */
195 
199 typedef struct HeapMultiBufMP_Object *HeapMultiBufMP_Handle;
200 
210 typedef struct HeapMultiBufMP_Bucket {
211  SizeT blockSize;
212  UInt numBlocks;
213  SizeT align;
215 
219 typedef struct HeapMultiBufMP_Params {
227  Bool exact;
234  String name;
245  Int numBuckets;
269  UInt16 regionId;
277  Ptr sharedAddr;
289 
294  UInt numBuckets;
317 
318 /* =============================================================================
319  * HeapMultiBufMP Module-wide Functions
320  * =============================================================================
321  */
322 
335 Int HeapMultiBufMP_close(HeapMultiBufMP_Handle *handlePtr);
336 
344 HeapMultiBufMP_Handle HeapMultiBufMP_create(const HeapMultiBufMP_Params *params);
345 
354 Int HeapMultiBufMP_delete(HeapMultiBufMP_Handle *handlePtr);
355 
380 Int HeapMultiBufMP_open(String name, HeapMultiBufMP_Handle *handlePtr);
381 
383 Int HeapMultiBufMP_openByAddr(Ptr sharedAddr, HeapMultiBufMP_Handle *handlePtr);
384 
394 
404 SizeT HeapMultiBufMP_sharedMemReq(const HeapMultiBufMP_Params *params);
405 
408 /* =============================================================================
409  * HeapMultiBufMP Per-instance Functions
410  * =============================================================================
411  */
412 
424 Void *HeapMultiBufMP_alloc(HeapMultiBufMP_Handle handle, SizeT size,
425  SizeT align);
426 
436 Void HeapMultiBufMP_free(HeapMultiBufMP_Handle handle, Ptr block, SizeT size);
437 
454 Void HeapMultiBufMP_getExtendedStats(HeapMultiBufMP_Handle handle,
456 
465 Void HeapMultiBufMP_getStats(HeapMultiBufMP_Handle handle, Ptr stats);
466 
467 #if defined (__cplusplus)
468 }
469 #endif /* defined (__cplusplus) */
470 #endif /* ti_ipc_HeapMultiBufMP__include */
471 
472 /*
473  */
474 
475 /*
476  * @(#) ti.ipc; 1, 0, 0, 0,; 1-23-2013 13:22:42; /db/vtree/library/trees/ipc/ipc-i12/src/ xlibrary
477 
478  */
479 
Copyright 2013, Texas Instruments Incorporated