1 /**********************************************************************
2 Copyright (c) Imagination Technologies Ltd.
4 Permission is hereby granted, free of charge, to any person obtaining a copy
5 of this software and associated documentation files (the "Software"), to deal
6 in the Software without restriction, including without limitation the rights
7 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 copies of the Software, and to permit persons to whom the Software is
9 furnished to do so, subject to the following conditions:
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 ******************************************************************************/
23 #ifndef __IMG_TYPES_H__
24 #define __IMG_TYPES_H__
26 #if !defined(IMG_ADDRSPACE_CPUVADDR_BITS)
27 #define IMG_ADDRSPACE_CPUVADDR_BITS 32
30 #if !defined(IMG_ADDRSPACE_PHYSADDR_BITS)
31 #define IMG_ADDRSPACE_PHYSADDR_BITS 32
34 typedef unsigned int IMG_UINT, *IMG_PUINT;
35 typedef signed int IMG_INT, *IMG_PINT;
37 typedef unsigned char IMG_UINT8, *IMG_PUINT8;
38 typedef unsigned char IMG_BYTE, *IMG_PBYTE;
39 typedef signed char IMG_INT8, *IMG_PINT8;
40 typedef char IMG_CHAR, *IMG_PCHAR;
42 typedef unsigned short IMG_UINT16, *IMG_PUINT16;
43 typedef signed short IMG_INT16, *IMG_PINT16;
44 typedef unsigned long IMG_UINT32, *IMG_PUINT32;
45 typedef signed long IMG_INT32, *IMG_PINT32;
47 #if !defined(IMG_UINT32_MAX)
48 #define IMG_UINT32_MAX 0xFFFFFFFFUL
51 #if (defined(LINUX) || defined(__METAG))
52 #if !defined(USE_CODE)
53 typedef unsigned long long IMG_UINT64, *IMG_PUINT64;
54 typedef long long IMG_INT64, *IMG_PINT64;
58 #error("define an OS")
62 #if !(defined(LINUX) && defined (__KERNEL__))
63 typedef float IMG_FLOAT, *IMG_PFLOAT;
64 typedef double IMG_DOUBLE, *IMG_PDOUBLE;
67 typedef enum tag_img_bool
71 IMG_FORCE_ALIGN = 0x7FFFFFFF
72 } IMG_BOOL, *IMG_PBOOL;
74 typedef void IMG_VOID, *IMG_PVOID;
76 typedef IMG_INT32 IMG_RESULT;
78 typedef IMG_UINT32 IMG_UINTPTR_T;
80 typedef IMG_PVOID IMG_HANDLE;
82 typedef void** IMG_HVOID, * IMG_PHVOID;
84 typedef IMG_UINT32 IMG_SIZE_T;
89 typedef IMG_PVOID IMG_CPU_VIRTADDR;
95 #define IMG_CAST_TO_DEVVADDR_UINT(var) (IMG_UINT32)(var)
99 typedef struct _IMG_CPU_PHYADDR
102 IMG_UINTPTR_T uiAddr;
105 typedef struct _IMG_DEV_PHYADDR
107 #if IMG_ADDRSPACE_PHYSADDR_BITS == 32
109 IMG_UINTPTR_T uiAddr;
112 IMG_UINT32 uiHighAddr;
116 typedef struct _IMG_SYS_PHYADDR
119 IMG_UINTPTR_T uiAddr;
122 #include "img_defs.h"