3 * (C) COPYRIGHT ARM Limited. All rights reserved.
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
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.
20 #ifndef _ARM_CSTD_TYPES_GCC_H_
21 #define _ARM_CSTD_TYPES_GCC_H_
23 /* ============================================================================
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>
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;
39 typedef long intptr_t;
47 typedef uint32_t bool_t;
50 #define TRUE ((bool_t)1)
54 #define FALSE ((bool_t)0)
57 /* ============================================================================
59 ============================================================================ */
60 /* Doxygen documentation for these is in the RVCT header. */
63 #define INLINE __inline__
65 #define FORCE_INLINE __attribute__((__always_inline__)) __inline__
67 #define NEVER_INLINE __attribute__((__noinline__))
69 #define PURE __attribute__((__pure__))
71 #define PACKED __attribute__((__packed__))
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. */
76 #define RESTRICT __restrict__
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__))
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__
89 #define CSTD_FUNC __FUNCTION__
92 #endif /* End (_ARM_CSTD_TYPES_GCC_H_) */