Added a test for MUIA_Listview_SelectChange.
[AROS.git] / compiler / include / aros / cpu.h
blob09e3f1b4ea039c6452e9b35ddbbc0af7b13c20dc
1 #ifndef AROS_CPU_H
2 #define AROS_CPU_H
3 /*
4 Copyright © 1995-2016, The AROS Development Team. All rights reserved.
5 $Id$
7 CPU independent version of the <aros/cpu.h> header. This is the one
8 that normal programs can include.
9 */
11 #define AROS_CPU_IA32 1
12 #define AROS_CPU_M68K 2
13 #define AROS_CPU_PPC32 3
14 #define AROS_CPU_PPC64 4
15 #define AROS_CPU_AXP 5
16 #define AROS_CPU_SPARC32 6
17 #define AROS_CPU_SPARC64 7
18 #define AROS_CPU_IA64 8
19 #define AROS_CPU_X8664 9
20 #define AROS_CPU_ARM 10
22 /* Fix up __powerpc__ definition if missing */
23 #ifdef __ppc__
24 #ifndef __powerpc__
25 #define __powerpc__
26 #endif
27 #endif
30 Firstly, include the sub-include file for a particular CPU.
32 #if defined __i386__
33 # include <aros/i386/cpu.h>
34 #elif defined __x86_64__
35 # include <aros/x86_64/cpu.h>
36 #elif defined __mc68000__
37 # include <aros/m68k/cpu.h>
38 #elif defined __MORPHOS__
39 # include <aros/morphos/cpu.h>
40 #elif defined __powerpc__
41 # include <aros/ppc/cpu.h>
42 #elif defined __aarch64__
43 # include <aros/aarch64/cpu.h>
44 #elif defined __arm__
45 # if defined __thumb2__
46 # include <aros/arm/cpu-thumb2.h>
47 # else
48 # include <aros/arm/cpu.h>
49 # endif
50 #else
51 # error unsupported CPU type
52 #endif
54 #if !AROS_STACK_GROWS_DOWNWARDS
55 #error Several places in AROS code assume a stack that grows downwards
56 #endif
59 Under 64-bit MS Windows long is still 32 bits
62 #ifdef _WIN64
63 #define AROS_INTPTR_TYPE long long
64 #define AROS_INTPTR_STACKTYPE long long
65 #define AROS_LARGEST_TYPE long long
66 #endif
69 Now, for any optional define that hasn't been provided, we must provide
70 an implementation of it here. This is somewhat tedious...
73 #ifndef AROS_INTPTR_TYPE
74 #define AROS_INTPTR_TYPE long
75 #endif
77 #ifndef AROS_32BIT_TYPE
78 #define AROS_32BIT_TYPE long
79 #endif
81 #ifndef AROS_16BIT_TYPE
82 #define AROS_16BIT_TYPE short
83 #endif
85 #ifndef AROS_8BIT_TYPE
86 #define AROS_8BIT_TYPE char
87 #endif
89 #ifndef AROS_64BIT_TYPE
90 #define AROS_64BIT_TYPE long long
91 #endif
93 #ifndef AROS_INTPTR_STACKTYPE
94 #define AROS_INTPTR_STACKTYPE long
95 #endif
97 #ifndef AROS_64BIT_STACKTYPE
98 #define AROS_64BIT_STACKTYPE long long
99 #endif
101 #ifndef AROS_32BIT_STACKTYPE
102 #define AROS_32BIT_STACKTYPE long
103 #endif
105 #ifndef AROS_16BIT_STACKTYPE
106 #define AROS_16BIT_STACKTYPE long
107 #endif
109 #ifndef AROS_8BIT_STACKTYPE
110 #define AROS_8BIT_STACKTYPE long
111 #endif
113 #ifndef AROS_FLOAT_STACKTYPE
114 #define AROS_FLOAT_STACKTYPE float
115 #endif
117 #ifndef AROS_DOUBLE_STACKTYPE
118 #define AROS_DOUBLE_STACKTYPE double
119 #endif
121 #ifndef AROS_LARGEST_TYPE
122 #define AROS_LARGEST_TYPE long
123 #endif
125 #ifndef AROS_ATOMIC_TYPE
126 #define AROS_ATOMIC_TYPE int
127 #endif
130 * AROS_xBIT_LEAST: A type that holds at least a certain bit width.
132 #ifndef AROS_8BIT_LEASTTYPE
133 # define AROS_8BIT_LEASTTYPE AROS_8BIT_TYPE
134 #endif
135 #ifndef AROS_16BIT_LEASTTYPE
136 # define AROS_16BIT_LEASTTYPE AROS_16BIT_TYPE
137 #endif
138 #ifndef AROS_32BIT_LEASTTYPE
139 # define AROS_32BIT_LEASTTYPE AROS_32BIT_TYPE
140 #endif
141 #ifndef AROS_64BIT_LEASTTYPE
142 # ifdef AROS_64BIT_TYPE
143 # define AROS_64BIT_LEASTTYPE AROS_64BIT_TYPE
144 # endif
145 #endif
147 #ifndef AROS_8BIT_LEASTMIN
148 # define AROS_8BIT_LEASTMIN AROS_8BIT_MIN
149 #endif
150 #ifndef AROS_16BIT_LEASTMIN
151 # define AROS_16BIT_LEASTMIN AROS_16BIT_MIN
152 #endif
153 #ifndef AROS_32BIT_LEASTMIN
154 # define AROS_32BIT_LEASTMIN AROS_32BIT_MIN
155 #endif
156 #ifndef AROS_64BIT_LEASTMIN
157 # ifdef AROS_64BIT_MIN
158 # define AROS_64BIT_LEASTMIN AROS_64BIT_MIN
159 # endif
160 #endif
162 #ifndef AROS_8BIT_LEASTMAX
163 # define AROS_8BIT_LEASTMAX AROS_8BIT_MAX
164 #endif
165 #ifndef AROS_16BIT_LEASTMAX
166 # define AROS_16BIT_LEASTMAX AROS_16BIT_MAX
167 #endif
168 #ifndef AROS_32BIT_LEASTMAX
169 # define AROS_32BIT_LEASTMAX AROS_32BIT_MAX
170 #endif
171 #ifndef AROS_64BIT_LEASTMAX
172 # ifdef AROS_64BIT_MAX
173 # define AROS_64BIT_LEASTMAX AROS_64BIT_MAX
174 # endif
175 #endif
179 * AROS_xBIT_FAST: A type that is fast for operating quickly
181 #ifndef AROS_8BIT_FASTTYPE
182 # define AROS_8BIT_FASTTYPE AROS_8BIT_TYPE
183 #endif
184 #ifndef AROS_16BIT_FASTTYPE
185 # define AROS_16BIT_FASTTYPE AROS_16BIT_TYPE
186 #endif
187 #ifndef AROS_32BIT_FASTTYPE
188 # define AROS_32BIT_FASTTYPE AROS_32BIT_TYPE
189 #endif
190 #ifndef AROS_64BIT_FASTTYPE
191 # ifdef AROS_64BIT_TYPE
192 # define AROS_64BIT_FASTTYPE AROS_64BIT_TYPE
193 # endif
194 #endif
196 #ifndef AROS_8BIT_FASTMIN
197 # define AROS_8BIT_FASTMIN AROS_8BIT_MIN
198 #endif
199 #ifndef AROS_16BIT_FASTMIN
200 # define AROS_16BIT_FASTMIN AROS_16BIT_MIN
201 #endif
202 #ifndef AROS_32BIT_FASTMIN
203 # define AROS_32BIT_FASTMIN AROS_32BIT_MIN
204 #endif
205 #ifndef AROS_64BIT_FASTMIN
206 # ifdef AROS_64BIT_MIN
207 # define AROS_64BIT_FASTMIN AROS_64BIT_MIN
208 # endif
209 #endif
211 #ifndef AROS_8BIT_FASTMAX
212 # define AROS_8BIT_FASTMAX AROS_8BIT_MAX
213 #endif
214 #ifndef AROS_16BIT_FASTMAX
215 # define AROS_16BIT_FASTMAX AROS_16BIT_MAX
216 #endif
217 #ifndef AROS_32BIT_FASTMAX
218 # define AROS_32BIT_FASTMAX AROS_32BIT_MAX
219 #endif
220 #ifndef AROS_64BIT_FASTMAX
221 # ifdef AROS_64BIT_MAX
222 # define AROS_64BIT_FASTMAX AROS_64BIT_MAX
223 # endif
224 #endif
227 The SP_OFFSET should be defined *ONLY* when not defined before.
228 Otherwise it would redefine defaults from cpu-arch.h or machine.h file
230 #ifndef SP_OFFSET
231 #define SP_OFFSET 0
232 #endif /* SP_OFFSET */
234 #ifndef AROS_COMPAT_SETD0
235 #define AROS_COMPAT_SETD0(x) (void)x
236 #endif /* AROS_COMPAT_SETD0 */
238 /* These macros will produce a value that can be stored in a AROS_64BIT_TYPE */
239 #ifndef AROS_MAKE_INT64
240 #define AROS_MAKE_INT64(i) i ## LL
241 #endif
242 #ifndef AROS_MAKE_UINT64
243 #define AROS_MAKE_UINT64(i) i ## ULL
244 #endif
246 #ifndef __WORDSIZE
247 #define __WORDSIZE 32
248 #endif
250 #ifndef STACKED
251 #define STACKED __attribute__((aligned(4)))
252 #endif
254 #ifndef AROS_HOST_BARRIER
255 #define AROS_HOST_BARRIER
256 #endif
258 #endif /* AROS_CPU_H */