aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/arm/t6xx/kbase/malisw/arm_cstd/arm_cstd_types_gcc.h
blob: 1a3190af8f7560a334525603f824b0d17f3fbc4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/*
 *
 * (C) COPYRIGHT 2009-2012 ARM Limited. All rights reserved.
 *
 * This program is free software and is provided to you under the terms of the
 * GNU General Public License version 2 as published by the Free Software
 * Foundation, and any use by you of this program is subject to the terms
 * of such GNU licence.
 *
 * A copy of the licence is included with the program, and can also be obtained
 * from Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA  02110-1301, USA.
 *
 */



#ifndef _ARM_CSTD_TYPES_GCC_H_
#define _ARM_CSTD_TYPES_GCC_H_

/* ============================================================================
	Type definitions
============================================================================ */
/* All modern versions of GCC support stdint outside of C99 Mode. */
/* However, Linux kernel limits what headers are available! */
#if 1 == CSTD_OS_LINUX_KERNEL
	#include <linux/kernel.h>
	#include <linux/types.h>
	#include <linux/stddef.h>
	#include <linux/version.h>

	/* Fix up any types which CSTD provdes but which Linux is missing. */
	/* Note Linux assumes pointers are "long", so this is safe. */
	#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
		typedef unsigned long   uintptr_t;
	#endif
	typedef long                intptr_t;

#else
	#include <stdint.h>
	#include <stddef.h>
	#include <limits.h>
#endif

typedef uint32_t                bool_t;

#if !defined(TRUE)
	#define TRUE                ((bool_t)1)
#endif

#if !defined(FALSE)
	#define FALSE               ((bool_t)0)
#endif

/* ============================================================================
	Keywords
============================================================================ */
/* Doxygen documentation for these is in the RVCT header. */
#define ASM                     __asm__

#define INLINE                  __inline__

#define FORCE_INLINE            __attribute__((__always_inline__)) __inline__

#define NEVER_INLINE            __attribute__((__noinline__))

#define PURE                    __attribute__((__pure__))

#define PACKED                  __attribute__((__packed__))

/* GCC does not support pointers to UNALIGNED data, so we do not define it to
 * force a compile error if this macro is used. */

#define RESTRICT                __restrict__

/* RVCT in GCC mode does not support the CHECK_RESULT attribute. */
#if 0 == CSTD_TOOLCHAIN_RVCT_GCC_MODE
	#define CHECK_RESULT        __attribute__((__warn_unused_result__))
#else
	#define CHECK_RESULT
#endif

/* RVCT in GCC mode does not support the __func__ name outside of C99. */
#if (0 == CSTD_TOOLCHAIN_RVCT_GCC_MODE)
	#define CSTD_FUNC           __func__
#else
	#define CSTD_FUNC           __FUNCTION__
#endif

#endif /* End (_ARM_CSTD_TYPES_GCC_H_) */