SysLink API Reference  2.21.03.11
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
HeapBufMP.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012, 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  * */
71 #ifndef ti_ipc_HeapBufMP__include
72 #define ti_ipc_HeapBufMP__include
73 
74 #if defined (__cplusplus)
75 extern "C" {
76 #endif
77 
78 #include <ti/ipc/GateMP.h>
79 
80 /* =============================================================================
81  * All success and failure codes for the module
82  * =============================================================================
83  */
84 
89 #define HeapBufMP_S_BUSY 2
90 
95 #define HeapBufMP_S_ALREADYSETUP 1
96 
101 #define HeapBufMP_S_SUCCESS 0
102 
107 #define HeapBufMP_E_FAIL -1
108 
113 #define HeapBufMP_E_INVALIDARG -2
114 
119 #define HeapBufMP_E_MEMORY -3
120 
125 #define HeapBufMP_E_ALREADYEXISTS -4
126 
131 #define HeapBufMP_E_NOTFOUND -5
132 
137 #define HeapBufMP_E_TIMEOUT -6
138 
143 #define HeapBufMP_E_INVALIDSTATE -7
144 
148 #define HeapBufMP_E_OSFAILURE -8
149 
153 #define HeapBufMP_E_RESOURCE -9
154 
158 #define HeapBufMP_E_RESTART -10
159 
160 /* =============================================================================
161  * Structures & Enums
162  * =============================================================================
163  */
164 
168 typedef struct HeapBufMP_Object *HeapBufMP_Handle;
169 
173 typedef struct HeapBufMP_Params {
174  String name;
193  Ptr sharedAddr;
216  UInt numBlocks;
222  SizeT align;
233  Bool exact;
249 
253 typedef struct HeapBufMP_ExtendedStats {
264 
265 /* =============================================================================
266  * HeapBufMP Module-wide Functions
267  * =============================================================================
268  */
269 
285 Int HeapBufMP_close(HeapBufMP_Handle *handlePtr);
286 
294 HeapBufMP_Handle HeapBufMP_create(const HeapBufMP_Params *params);
295 
304 Int HeapBufMP_delete(HeapBufMP_Handle *handlePtr);
305 
330 Int HeapBufMP_open(String name, HeapBufMP_Handle *handlePtr);
331 
333 Int HeapBufMP_openByAddr(Ptr sharedAddr, HeapBufMP_Handle *handlePtr);
334 
344 
354 SizeT HeapBufMP_sharedMemReq(const HeapBufMP_Params *params);
355 
358 /* =============================================================================
359  * HeapBufMP Per-instance Functions
360  * =============================================================================
361  */
362 
388 Void *HeapBufMP_alloc(HeapBufMP_Handle handle, SizeT size, SizeT align);
389 
407 Void HeapBufMP_free(HeapBufMP_Handle handle, Ptr block, SizeT size);
408 
425 Void HeapBufMP_getExtendedStats(HeapBufMP_Handle handle,
426  HeapBufMP_ExtendedStats *stats);
427 
436 Void HeapBufMP_getStats(HeapBufMP_Handle handle, Ptr stats);
437 
438 #if defined (__cplusplus)
439 }
440 #endif /* defined (__cplusplus) */
441 #endif /* ti_ipc_HeapBufMP__include */
442 
443 /*
444  */
445 
446 /*
447  * @(#) ti.ipc; 1, 0, 0, 0,; 11-7-2012 13:07:52; /db/vtree/library/trees/ipc/ipc-i09/src/ xlibrary
448 
449  */
450 
Copyright 2014, Texas Instruments Incorporated