aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/omap2/omaplfb/img_types.h')
-rw-r--r--drivers/video/omap2/omaplfb/img_types.h215
1 files changed, 215 insertions, 0 deletions
diff --git a/drivers/video/omap2/omaplfb/img_types.h b/drivers/video/omap2/omaplfb/img_types.h
new file mode 100644
index 00000000000..922aa282196
--- /dev/null
+++ b/drivers/video/omap2/omaplfb/img_types.h
@@ -0,0 +1,215 @@
1/*************************************************************************/ /*!
2@Title Global types for use by IMG APIs
3@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
4@Description Defines type aliases for use by IMG APIs.
5@License Dual MIT/GPLv2
6
7The contents of this file are subject to the MIT license as set out below.
8
9Permission is hereby granted, free of charge, to any person obtaining a copy
10of this software and associated documentation files (the "Software"), to deal
11in the Software without restriction, including without limitation the rights
12to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13copies of the Software, and to permit persons to whom the Software is
14furnished to do so, subject to the following conditions:
15
16The above copyright notice and this permission notice shall be included in
17all copies or substantial portions of the Software.
18
19Alternatively, the contents of this file may be used under the terms of
20the GNU General Public License Version 2 ("GPL") in which case the provisions
21of GPL are applicable instead of those above.
22
23If you wish to allow use of your version of this file only under the terms of
24GPL, and not to allow others to use your version of this file under the terms
25of the MIT license, indicate your decision by deleting the provisions above
26and replace them with the notice and other provisions required by GPL as set
27out in the file called "GPL-COPYING" included in this distribution. If you do
28not delete the provisions above, a recipient may use your version of this file
29under the terms of either the MIT license or GPL.
30
31This License is also included in this distribution in the file called
32"MIT-COPYING".
33
34EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
35PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
36BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
37PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
38COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
39IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
40CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
41
42*/ /**************************************************************************/
43#ifndef __IMG_TYPES_H__
44#define __IMG_TYPES_H__
45
46/* define all address space bit depths: */
47/* CPU virtual address space defaults to 32bits */
48#if !defined(IMG_ADDRSPACE_CPUVADDR_BITS)
49#define IMG_ADDRSPACE_CPUVADDR_BITS 32
50#endif
51
52/* Physical address space defaults to 32bits */
53#if !defined(IMG_ADDRSPACE_PHYSADDR_BITS)
54#define IMG_ADDRSPACE_PHYSADDR_BITS 32
55#endif
56
57typedef unsigned int IMG_UINT, *IMG_PUINT;
58typedef signed int IMG_INT, *IMG_PINT;
59
60typedef unsigned char IMG_UINT8, *IMG_PUINT8;
61typedef unsigned char IMG_BYTE, *IMG_PBYTE;
62typedef signed char IMG_INT8, *IMG_PINT8;
63typedef char IMG_CHAR, *IMG_PCHAR;
64
65typedef unsigned short IMG_UINT16, *IMG_PUINT16;
66typedef signed short IMG_INT16, *IMG_PINT16;
67#if !defined(IMG_UINT32_IS_ULONG)
68typedef unsigned int IMG_UINT32, *IMG_PUINT32;
69typedef signed int IMG_INT32, *IMG_PINT32;
70#else
71typedef unsigned long IMG_UINT32, *IMG_PUINT32;
72typedef signed long IMG_INT32, *IMG_PINT32;
73#endif
74#if !defined(IMG_UINT32_MAX)
75 #define IMG_UINT32_MAX 0xFFFFFFFFUL
76#endif
77
78#if defined(USE_CODE)
79
80typedef unsigned __int64 IMG_UINT64, *IMG_PUINT64;
81typedef __int64 IMG_INT64, *IMG_PINT64;
82
83#else
84 #if ((defined(LINUX) || defined(__METAG)) || defined(__QNXNTO__))
85 typedef unsigned long long IMG_UINT64, *IMG_PUINT64;
86 typedef long long IMG_INT64, *IMG_PINT64;
87 #else
88 #error("define an OS")
89 #endif
90#endif
91
92#if !(defined(LINUX) && defined (__KERNEL__))
93/* Linux kernel mode does not use floating point */
94typedef float IMG_FLOAT, *IMG_PFLOAT;
95typedef double IMG_DOUBLE, *IMG_PDOUBLE;
96#endif
97
98typedef enum tag_img_bool
99{
100 IMG_FALSE = 0,
101 IMG_TRUE = 1,
102 IMG_FORCE_ALIGN = 0x7FFFFFFF
103} IMG_BOOL, *IMG_PBOOL;
104
105typedef void IMG_VOID, *IMG_PVOID;
106
107typedef IMG_INT32 IMG_RESULT;
108
109#if defined(_WIN64)
110 typedef unsigned __int64 IMG_UINTPTR_T;
111 typedef signed __int64 IMG_PTRDIFF_T;
112 typedef IMG_UINT64 IMG_SIZE_T;
113#else
114 typedef unsigned int IMG_UINTPTR_T;
115 typedef IMG_UINT32 IMG_SIZE_T;
116#endif
117
118typedef IMG_PVOID IMG_HANDLE;
119
120typedef void** IMG_HVOID, * IMG_PHVOID;
121
122#define IMG_NULL 0
123
124/* services/stream ID */
125typedef IMG_UINT32 IMG_SID;
126
127typedef IMG_UINT32 IMG_EVENTSID;
128
129/*
130 * Address types.
131 * All types used to refer to a block of memory are wrapped in structures
132 * to enforce some degree of type safety, i.e. a IMG_DEV_VIRTADDR cannot
133 * be assigned to a variable of type IMG_DEV_PHYADDR because they are not the
134 * same thing.
135 *
136 * There is an assumption that the system contains at most one non-cpu mmu,
137 * and a memory block is only mapped by the MMU once.
138 *
139 * Different devices could have offset views of the physical address space.
140 *
141 */
142
143
144/*
145 *
146 * +------------+ +------------+ +------------+ +------------+
147 * | CPU | | DEV | | DEV | | DEV |
148 * +------------+ +------------+ +------------+ +------------+
149 * | | | |
150 * | PVOID |IMG_DEV_VIRTADDR |IMG_DEV_VIRTADDR |
151 * | \-------------------/ |
152 * | | |
153 * +------------+ +------------+ |
154 * | MMU | | MMU | |
155 * +------------+ +------------+ |
156 * | | |
157 * | | |
158 * | | |
159 * +--------+ +---------+ +--------+
160 * | Offset | | (Offset)| | Offset |
161 * +--------+ +---------+ +--------+
162 * | | IMG_DEV_PHYADDR |
163 * | | |
164 * | | IMG_DEV_PHYADDR |
165 * +---------------------------------------------------------------------+
166 * | System Address bus |
167 * +---------------------------------------------------------------------+
168 *
169 */
170
171typedef IMG_PVOID IMG_CPU_VIRTADDR;
172
173/* device virtual address */
174typedef struct _IMG_DEV_VIRTADDR
175{
176 /* device virtual addresses are 32bit for now */
177 IMG_UINT32 uiAddr;
178#define IMG_CAST_TO_DEVVADDR_UINT(var) (IMG_UINT32)(var)
179
180} IMG_DEV_VIRTADDR;
181
182typedef IMG_UINT32 IMG_DEVMEM_SIZE_T;
183
184/* cpu physical address */
185typedef struct _IMG_CPU_PHYADDR
186{
187 /* variable sized type (32,64) */
188 IMG_UINTPTR_T uiAddr;
189} IMG_CPU_PHYADDR;
190
191/* device physical address */
192typedef struct _IMG_DEV_PHYADDR
193{
194#if IMG_ADDRSPACE_PHYSADDR_BITS == 32
195 /* variable sized type (32,64) */
196 IMG_UINTPTR_T uiAddr;
197#else
198 IMG_UINT32 uiAddr;
199 IMG_UINT32 uiHighAddr;
200#endif
201} IMG_DEV_PHYADDR;
202
203/* system physical address */
204typedef struct _IMG_SYS_PHYADDR
205{
206 /* variable sized type (32,64) */
207 IMG_UINTPTR_T uiAddr;
208} IMG_SYS_PHYADDR;
209
210#include "img_defs.h"
211
212#endif /* __IMG_TYPES_H__ */
213/******************************************************************************
214 End of file (img_types.h)
215******************************************************************************/