SysLink API Reference
2.21.03.11
Main Page
Data Structures
Files
Related Pages
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
ti
syslink
utils
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
{
76
SyslinkMemMgr_AddrType_Virtual
= 0u,
80
SyslinkMemMgr_AddrType_Portable
= 1u,
84
SyslinkMemMgr_AddrType_EndValue
= 2u
86
}
SyslinkMemMgr_AddrType
;
87
91
typedef
enum
SyslinkMemMgr_Type_Type_tag
{
92
SyslinkMemMgr_TYPE_SHAREDMEM
= 0x0,
93
SyslinkMemMgr_TYPE_TILERMEM
= 0x1
94
}
SyslinkMemMgr_Type
;
95
96
102
typedef
struct
SyslinkMemMgr_CreateParams_tag
{
103
UInt32
size
;
105
SyslinkMemMgr_Type
memMgrType
;
107
UInt8
name
[
MEMMGR_MAX_NAME_LENGTH
];
109
}
SyslinkMemMgr_CreateParams
;
110
111
#define SyslinkMemMgr_Params SyslinkMemMgr_CreateParams
112
113
typedef
struct
SyslinkMemMgr_AllocBlock_tag
{
114
UInt16
pixelFormat
;
115
union
{
116
struct
{
117
UInt16
width
;
118
UInt16
height
;
119
}
area
;
120
UInt16
len
;
121
}
dim
;
122
UInt32
stride
;
123
}
SyslinkMemMgr_AllocBlock
;
124
125
129
typedef
struct
SyslinkMemMgr_AllocParams_tag
{
130
UInt32
size
;
131
UInt32
align
;
132
SyslinkMemMgr_AllocBlock
block
[
MEMMGR_MAX_TILER_BLOCKS
];
133
UInt32
tilerBlocks
;
134
}
SyslinkMemMgr_AllocParams
;
135
136
141
typedef
struct
SyslinkMemMgr_Object
SyslinkMemMgr_Object
;
142
146
typedef
SyslinkMemMgr_Object
*
SyslinkMemMgr_Handle
;
147
148
/* =============================================================================
149
* APIs
150
* =============================================================================
151
*/
152
/* Function to setup the SyslinkMemMgr module */
153
Int32
SyslinkMemMgr_setup
(
Void
);
154
155
/* Function to setup the SyslinkMemMgr module */
156
Int32
SyslinkMemMgr_destroy
(
Void
);
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