4 Copyright © 1995-2016, The AROS Development Team. All rights reserved.
7 CPU independent version of the <aros/cpu.h> header. This is the one
8 that normal programs can include.
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 */
30 Firstly, include the sub-include file for a particular CPU.
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>
45 # if defined __thumb2__
46 # include <aros/arm/cpu-thumb2.h>
48 # include <aros/arm/cpu.h>
51 # error unsupported CPU type
54 #if !AROS_STACK_GROWS_DOWNWARDS
55 #error Several places in AROS code assume a stack that grows downwards
59 Under 64-bit MS Windows long is still 32 bits
63 #define AROS_INTPTR_TYPE long long
64 #define AROS_INTPTR_STACKTYPE long long
65 #define AROS_LARGEST_TYPE long long
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
77 #ifndef AROS_32BIT_TYPE
78 #define AROS_32BIT_TYPE long
81 #ifndef AROS_16BIT_TYPE
82 #define AROS_16BIT_TYPE short
85 #ifndef AROS_8BIT_TYPE
86 #define AROS_8BIT_TYPE char
89 #ifndef AROS_64BIT_TYPE
90 #define AROS_64BIT_TYPE long long
93 #ifndef AROS_INTPTR_STACKTYPE
94 #define AROS_INTPTR_STACKTYPE long
97 #ifndef AROS_64BIT_STACKTYPE
98 #define AROS_64BIT_STACKTYPE long long
101 #ifndef AROS_32BIT_STACKTYPE
102 #define AROS_32BIT_STACKTYPE long
105 #ifndef AROS_16BIT_STACKTYPE
106 #define AROS_16BIT_STACKTYPE long
109 #ifndef AROS_8BIT_STACKTYPE
110 #define AROS_8BIT_STACKTYPE long
113 #ifndef AROS_FLOAT_STACKTYPE
114 #define AROS_FLOAT_STACKTYPE float
117 #ifndef AROS_DOUBLE_STACKTYPE
118 #define AROS_DOUBLE_STACKTYPE double
121 #ifndef AROS_LARGEST_TYPE
122 #define AROS_LARGEST_TYPE long
125 #ifndef AROS_ATOMIC_TYPE
126 #define AROS_ATOMIC_TYPE int
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
135 #ifndef AROS_16BIT_LEASTTYPE
136 # define AROS_16BIT_LEASTTYPE AROS_16BIT_TYPE
138 #ifndef AROS_32BIT_LEASTTYPE
139 # define AROS_32BIT_LEASTTYPE AROS_32BIT_TYPE
141 #ifndef AROS_64BIT_LEASTTYPE
142 # ifdef AROS_64BIT_TYPE
143 # define AROS_64BIT_LEASTTYPE AROS_64BIT_TYPE
147 #ifndef AROS_8BIT_LEASTMIN
148 # define AROS_8BIT_LEASTMIN AROS_8BIT_MIN
150 #ifndef AROS_16BIT_LEASTMIN
151 # define AROS_16BIT_LEASTMIN AROS_16BIT_MIN
153 #ifndef AROS_32BIT_LEASTMIN
154 # define AROS_32BIT_LEASTMIN AROS_32BIT_MIN
156 #ifndef AROS_64BIT_LEASTMIN
157 # ifdef AROS_64BIT_MIN
158 # define AROS_64BIT_LEASTMIN AROS_64BIT_MIN
162 #ifndef AROS_8BIT_LEASTMAX
163 # define AROS_8BIT_LEASTMAX AROS_8BIT_MAX
165 #ifndef AROS_16BIT_LEASTMAX
166 # define AROS_16BIT_LEASTMAX AROS_16BIT_MAX
168 #ifndef AROS_32BIT_LEASTMAX
169 # define AROS_32BIT_LEASTMAX AROS_32BIT_MAX
171 #ifndef AROS_64BIT_LEASTMAX
172 # ifdef AROS_64BIT_MAX
173 # define AROS_64BIT_LEASTMAX AROS_64BIT_MAX
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
184 #ifndef AROS_16BIT_FASTTYPE
185 # define AROS_16BIT_FASTTYPE AROS_16BIT_TYPE
187 #ifndef AROS_32BIT_FASTTYPE
188 # define AROS_32BIT_FASTTYPE AROS_32BIT_TYPE
190 #ifndef AROS_64BIT_FASTTYPE
191 # ifdef AROS_64BIT_TYPE
192 # define AROS_64BIT_FASTTYPE AROS_64BIT_TYPE
196 #ifndef AROS_8BIT_FASTMIN
197 # define AROS_8BIT_FASTMIN AROS_8BIT_MIN
199 #ifndef AROS_16BIT_FASTMIN
200 # define AROS_16BIT_FASTMIN AROS_16BIT_MIN
202 #ifndef AROS_32BIT_FASTMIN
203 # define AROS_32BIT_FASTMIN AROS_32BIT_MIN
205 #ifndef AROS_64BIT_FASTMIN
206 # ifdef AROS_64BIT_MIN
207 # define AROS_64BIT_FASTMIN AROS_64BIT_MIN
211 #ifndef AROS_8BIT_FASTMAX
212 # define AROS_8BIT_FASTMAX AROS_8BIT_MAX
214 #ifndef AROS_16BIT_FASTMAX
215 # define AROS_16BIT_FASTMAX AROS_16BIT_MAX
217 #ifndef AROS_32BIT_FASTMAX
218 # define AROS_32BIT_FASTMAX AROS_32BIT_MAX
220 #ifndef AROS_64BIT_FASTMAX
221 # ifdef AROS_64BIT_MAX
222 # define AROS_64BIT_FASTMAX AROS_64BIT_MAX
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
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
242 #ifndef AROS_MAKE_UINT64
243 #define AROS_MAKE_UINT64(i) i ## ULL
247 #define __WORDSIZE 32
251 #define STACKED __attribute__((aligned(4)))
254 #ifndef AROS_HOST_BARRIER
255 #define AROS_HOST_BARRIER
258 #endif /* AROS_CPU_H */