SysLink API Reference  2.21.03.11
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
SyslinkMemMgr.h
Go to the documentation of this file.
1 
11 /*
12  * ============================================================================
13  *
14  * Copyright (c) 2008-2012, Texas Instruments Incorporated
15  *
16  * Redistribution and use in source and binary forms, with or without
17  * modification, are permitted provided that the following conditions
18  * are met:
19  *
20  * * Redistributions of source code must retain the above copyright
21  * notice, this list of conditions and the following disclaimer.
22  *
23  * * Redistributions in binary form must reproduce the above copyright
24  * notice, this list of conditions and the following disclaimer in the
25  * documentation and/or other materials provided with the distribution.
26  *
27  * * Neither the name of Texas Instruments Incorporated nor the names of
28  * its contributors may be used to endorse or promote products derived
29  * from this software without specific prior written permission.
30  *
31  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
32  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
33  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
34  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
35  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
36  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
37  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
38  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
39  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
40  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
41  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42  * Contact information for paper mail:
43  * Texas Instruments
44  * Post Office Box 655303
45  * Dallas, Texas 75265
46  * Contact information:
47  * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
48  * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
49  * ============================================================================
50  *
51  */
52 
53 
54 
55 #ifndef MEMMGR_H
56 #define MEMMGR_H
57 
58 
59 #if defined (__cplusplus)
60 extern "C" {
61 #endif
62 
63 #define MEMMGR_MAX_NAME_LENGTH 32u
64 
65 #define MEMMGR_MAX_TILER_BLOCKS 10u
66 
67 /* =============================================================================
68  * Structures & Enums
69  * =============================================================================
70  */
71 
75 typedef enum {
87 
95 
96 
103  UInt32 size;
110 
111 #define SyslinkMemMgr_Params SyslinkMemMgr_CreateParams
112 
115  union {
116  struct {
119  } area;
121  } dim;
124 
125 
135 
136 
142 
147 
148 /* =============================================================================
149  * APIs
150  * =============================================================================
151  */
152 /* Function to setup the SyslinkMemMgr module */
154 
155 /* Function to setup the SyslinkMemMgr module */
157 
158 /* Function to create a SyslinkMemMgr instance */
159 SyslinkMemMgr_Handle SyslinkMemMgr_create(Ptr params);
160 
161 /* Function to delete the created Memory Manager instance*/
162 Int32 SyslinkMemMgr_delete(SyslinkMemMgr_Handle * pHandle);
163 
164 
165 /* Function to allocate memory from the SyslinkMemMgr */
166 Ptr SyslinkMemMgr_alloc(SyslinkMemMgr_Handle handle,
167  SyslinkMemMgr_AllocParams *params);
168 
169 /* Function to free memory from the SyslinkMemMgr */
170 Int32 SyslinkMemMgr_free(SyslinkMemMgr_Handle handle, Ptr ptr, UInt32 size);
171 
172 /* Function to map. not used for shared memory*/
173 Ptr SyslinkMemMgr_map(SyslinkMemMgr_Handle handle, Ptr arg);
174 
175 /* Function to do unmap */
176 Int32 SyslinkMemMgr_unmap(SyslinkMemMgr_Handle handle, Ptr arg);
177 
178 /* Function to translate source address to destination address type */
179 Ptr SyslinkMemMgr_translate(SyslinkMemMgr_Handle handle, Ptr srcAddr,
180  SyslinkMemMgr_AddrType srcAddrType,
181  SyslinkMemMgr_AddrType desAddrType);
182 
183 /* Function to return the kernel space instance handle pointer when user space
184  * instance handle is passed
185  */
186 Ptr SyslinkMemMgr_getKnlHandle(SyslinkMemMgr_Handle handle);
187 
188 
189 #if defined (__cplusplus)
190 }
191 #endif
192 
193 #endif
Copyright 2014, Texas Instruments Incorporated