RK3368 GPU: Rogue N Init.
[firefly-linux-kernel-4.4.55.git] / drivers / staging / imgtec / rogue / kernel_types.h
1 /*************************************************************************/ /*!
2 @Title          C99-compatible types and definitions for Linux kernel code
3 @Copyright      Copyright (c) Imagination Technologies Ltd. All Rights Reserved
4 @License        Dual MIT/GPLv2
5
6 The contents of this file are subject to the MIT license as set out below.
7
8 Permission is hereby granted, free of charge, to any person obtaining a copy
9 of this software and associated documentation files (the "Software"), to deal
10 in the Software without restriction, including without limitation the rights
11 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 copies of the Software, and to permit persons to whom the Software is
13 furnished to do so, subject to the following conditions:
14
15 The above copyright notice and this permission notice shall be included in
16 all copies or substantial portions of the Software.
17
18 Alternatively, the contents of this file may be used under the terms of
19 the GNU General Public License Version 2 ("GPL") in which case the provisions
20 of GPL are applicable instead of those above.
21
22 If you wish to allow use of your version of this file only under the terms of
23 GPL, and not to allow others to use your version of this file under the terms
24 of the MIT license, indicate your decision by deleting the provisions above
25 and replace them with the notice and other provisions required by GPL as set
26 out in the file called "GPL-COPYING" included in this distribution. If you do
27 not delete the provisions above, a recipient may use your version of this file
28 under the terms of either the MIT license or GPL.
29
30 This License is also included in this distribution in the file called
31 "MIT-COPYING".
32
33 EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
34 PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
35 BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
36 PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
37 COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
38 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
39 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
40 */ /**************************************************************************/
41
42 #include <linux/kernel.h>
43
44 /* Limits of specified-width integer types */
45
46 /* S8_MIN, etc were added in kernel version 3.14. The other versions are for
47  * earlier kernels. They can be removed once older kernels don't need to be
48  * supported.
49  */
50 #ifdef S8_MIN
51         #define INT8_MIN        S8_MIN
52 #else
53         #define INT8_MIN        (-128)
54 #endif
55
56 #ifdef S8_MAX
57         #define INT8_MAX        S8_MAX
58 #else
59         #define INT8_MAX        127
60 #endif
61
62 #ifdef U8_MAX
63         #define UINT8_MAX       U8_MAX
64 #else
65         #define UINT8_MAX       0xFF
66 #endif
67
68 #ifdef S16_MIN
69         #define INT16_MIN       S16_MIN
70 #else
71         #define INT16_MIN       (-32768)
72 #endif
73
74 #ifdef S16_MAX
75         #define INT16_MAX       S16_MAX
76 #else
77         #define INT16_MAX       32767
78 #endif
79
80 #ifdef U16_MAX
81         #define UINT16_MAX      U16_MAX
82 #else
83         #define UINT16_MAX      0xFFFF
84 #endif
85
86 #ifdef S32_MIN
87         #define INT32_MIN       S32_MIN
88 #else
89         #define INT32_MIN       (-2147483647 - 1)
90 #endif
91
92 #ifdef S32_MAX
93         #define INT32_MAX       S32_MAX
94 #else
95         #define INT32_MAX       2147483647
96 #endif
97
98 #ifdef U32_MAX
99         #define UINT32_MAX      U32_MAX
100 #else
101         #define UINT32_MAX      0xFFFFFFFF
102 #endif
103
104 #ifdef S64_MIN
105         #define INT64_MIN       S64_MIN
106 #else
107         #define INT64_MIN       (-9223372036854775807LL)
108 #endif
109
110 #ifdef S64_MAX
111         #define INT64_MAX       S64_MAX
112 #else
113         #define INT64_MAX       9223372036854775807LL
114 #endif
115
116 #ifdef U64_MAX
117         #define UINT64_MAX      U64_MAX
118 #else
119         #define UINT64_MAX      0xFFFFFFFFFFFFFFFFULL
120 #endif
121
122 /* Macros for integer constants */
123 #define INT8_C                  S8_C
124 #define UINT8_C                 U8_C
125 #define INT16_C                 S16_C
126 #define UINT16_C                U16_C
127 #define INT32_C                 S32_C
128 #define UINT32_C                U32_C
129 #define INT64_C                 S64_C
130 #define UINT64_C                U64_C
131
132 /* Format conversion of integer types <inttypes.h> */
133 /* Only define PRIX64 for the moment, as this is the only format macro that
134  * img_types.h needs.
135  */
136 #define PRIX64          "llX"