rk: ion: resolve build err
[firefly-linux-kernel-4.4.55.git] / drivers / gpu / arm / t6xx / kbase / malisw / arm_cstd / arm_cstd_types_gcc.h
1 /*
2  *
3  * (C) COPYRIGHT ARM Limited. All rights reserved.
4  *
5  * This program is free software and is provided to you under the terms of the
6  * GNU General Public License version 2 as published by the Free Software
7  * Foundation, and any use by you of this program is subject to the terms
8  * of such GNU licence.
9  *
10  * A copy of the licence is included with the program, and can also be obtained
11  * from Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
12  * Boston, MA  02110-1301, USA.
13  *
14  */
15
16
17
18
19
20 #ifndef _ARM_CSTD_TYPES_GCC_H_
21 #define _ARM_CSTD_TYPES_GCC_H_
22
23 /* ============================================================================
24         Type definitions
25 ============================================================================ */
26 /* All modern versions of GCC support stdint outside of C99 Mode. */
27 /* However, Linux kernel limits what headers are available! */
28 #if 1 == CSTD_OS_LINUX_KERNEL
29         #include <linux/kernel.h>
30         #include <linux/types.h>
31         #include <linux/stddef.h>
32         #include <linux/version.h>
33
34         /* Fix up any types which CSTD provdes but which Linux is missing. */
35         /* Note Linux assumes pointers are "long", so this is safe. */
36         #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
37                 typedef unsigned long   uintptr_t;
38         #endif
39         typedef long                intptr_t;
40
41 #else
42         #include <stdint.h>
43         #include <stddef.h>
44         #include <limits.h>
45 #endif
46
47 typedef uint32_t                bool_t;
48
49 #if !defined(TRUE)
50         #define TRUE                ((bool_t)1)
51 #endif
52
53 #if !defined(FALSE)
54         #define FALSE               ((bool_t)0)
55 #endif
56
57 /* ============================================================================
58         Keywords
59 ============================================================================ */
60 /* Doxygen documentation for these is in the RVCT header. */
61 #define ASM                     __asm__
62
63 #define INLINE                  __inline__
64
65 #define FORCE_INLINE            __attribute__((__always_inline__)) __inline__
66
67 #define NEVER_INLINE            __attribute__((__noinline__))
68
69 #define PURE                    __attribute__((__pure__))
70
71 #define PACKED                  __attribute__((__packed__))
72
73 /* GCC does not support pointers to UNALIGNED data, so we do not define it to
74  * force a compile error if this macro is used. */
75
76 #define RESTRICT                __restrict__
77
78 /* RVCT in GCC mode does not support the CHECK_RESULT attribute. */
79 #if 0 == CSTD_TOOLCHAIN_RVCT_GCC_MODE
80         #define CHECK_RESULT        __attribute__((__warn_unused_result__))
81 #else
82         #define CHECK_RESULT
83 #endif
84
85 /* RVCT in GCC mode does not support the __func__ name outside of C99. */
86 #if (0 == CSTD_TOOLCHAIN_RVCT_GCC_MODE)
87         #define CSTD_FUNC           __func__
88 #else
89         #define CSTD_FUNC           __FUNCTION__
90 #endif
91
92 #endif /* End (_ARM_CSTD_TYPES_GCC_H_) */