4 Copyright © 1995-2011, 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>
43 # include <aros/arm/cpu.h>
45 # error unsupported CPU type
48 #if !AROS_STACK_GROWS_DOWNWARDS
49 #error Several places in AROS code assume a stack that grows downwards
53 Under 64-bit MS Windows long is still 32 bits
57 #define AROS_INTPTR_TYPE long long
58 #define AROS_INTPTR_STACKTYPE long long
59 #define AROS_LARGEST_TYPE long long
63 Now, for any optional define that hasn't been provided, we must provide
64 an implementation of it here. This is somewhat tedious...
67 #ifndef AROS_INTPTR_TYPE
68 #define AROS_INTPTR_TYPE long
71 #ifndef AROS_32BIT_TYPE
72 #define AROS_32BIT_TYPE long
75 #ifndef AROS_16BIT_TYPE
76 #define AROS_16BIT_TYPE short
79 #ifndef AROS_8BIT_TYPE
80 #define AROS_8BIT_TYPE char
83 #ifndef AROS_64BIT_TYPE
84 #define AROS_64BIT_TYPE long long
87 #ifndef AROS_INTPTR_STACKTYPE
88 #define AROS_INTPTR_STACKTYPE long
91 #ifndef AROS_64BIT_STACKTYPE
92 #define AROS_64BIT_STACKTYPE long long
95 #ifndef AROS_32BIT_STACKTYPE
96 #define AROS_32BIT_STACKTYPE long
99 #ifndef AROS_16BIT_STACKTYPE
100 #define AROS_16BIT_STACKTYPE long
103 #ifndef AROS_8BIT_STACKTYPE
104 #define AROS_8BIT_STACKTYPE long
107 #ifndef AROS_FLOAT_STACKTYPE
108 #define AROS_FLOAT_STACKTYPE float
111 #ifndef AROS_DOUBLE_STACKTYPE
112 #define AROS_DOUBLE_STACKTYPE double
115 #ifndef AROS_LARGEST_TYPE
116 #define AROS_LARGEST_TYPE long
119 #ifndef AROS_ATOMIC_TYPE
120 #define AROS_ATOMIC_TYPE int
124 * AROS_xBIT_LEAST: A type that holds at least a certain bit width.
126 #ifndef AROS_8BIT_LEASTTYPE
127 # define AROS_8BIT_LEASTTYPE AROS_8BIT_TYPE
129 #ifndef AROS_16BIT_LEASTTYPE
130 # define AROS_16BIT_LEASTTYPE AROS_16BIT_TYPE
132 #ifndef AROS_32BIT_LEASTTYPE
133 # define AROS_32BIT_LEASTTYPE AROS_32BIT_TYPE
135 #ifndef AROS_64BIT_LEASTTYPE
136 # ifdef AROS_64BIT_TYPE
137 # define AROS_64BIT_LEASTTYPE AROS_64BIT_TYPE
141 #ifndef AROS_8BIT_LEASTMIN
142 # define AROS_8BIT_LEASTMIN AROS_8BIT_MIN
144 #ifndef AROS_16BIT_LEASTMIN
145 # define AROS_16BIT_LEASTMIN AROS_16BIT_MIN
147 #ifndef AROS_32BIT_LEASTMIN
148 # define AROS_32BIT_LEASTMIN AROS_32BIT_MIN
150 #ifndef AROS_64BIT_LEASTMIN
151 # ifdef AROS_64BIT_MIN
152 # define AROS_64BIT_LEASTMIN AROS_64BIT_MIN
156 #ifndef AROS_8BIT_LEASTMAX
157 # define AROS_8BIT_LEASTMAX AROS_8BIT_MAX
159 #ifndef AROS_16BIT_LEASTMAX
160 # define AROS_16BIT_LEASTMAX AROS_16BIT_MAX
162 #ifndef AROS_32BIT_LEASTMAX
163 # define AROS_32BIT_LEASTMAX AROS_32BIT_MAX
165 #ifndef AROS_64BIT_LEASTMAX
166 # ifdef AROS_64BIT_MAX
167 # define AROS_64BIT_LEASTMAX AROS_64BIT_MAX
173 * AROS_xBIT_FAST: A type that is fast for operating quickly
175 #ifndef AROS_8BIT_FASTTYPE
176 # define AROS_8BIT_FASTTYPE AROS_8BIT_TYPE
178 #ifndef AROS_16BIT_FASTTYPE
179 # define AROS_16BIT_FASTTYPE AROS_16BIT_TYPE
181 #ifndef AROS_32BIT_FASTTYPE
182 # define AROS_32BIT_FASTTYPE AROS_32BIT_TYPE
184 #ifndef AROS_64BIT_FASTTYPE
185 # ifdef AROS_64BIT_TYPE
186 # define AROS_64BIT_FASTTYPE AROS_64BIT_TYPE
190 #ifndef AROS_8BIT_FASTMIN
191 # define AROS_8BIT_FASTMIN AROS_8BIT_MIN
193 #ifndef AROS_16BIT_FASTMIN
194 # define AROS_16BIT_FASTMIN AROS_16BIT_MIN
196 #ifndef AROS_32BIT_FASTMIN
197 # define AROS_32BIT_FASTMIN AROS_32BIT_MIN
199 #ifndef AROS_64BIT_FASTMIN
200 # ifdef AROS_64BIT_MIN
201 # define AROS_64BIT_FASTMIN AROS_64BIT_MIN
205 #ifndef AROS_8BIT_FASTMAX
206 # define AROS_8BIT_FASTMAX AROS_8BIT_MAX
208 #ifndef AROS_16BIT_FASTMAX
209 # define AROS_16BIT_FASTMAX AROS_16BIT_MAX
211 #ifndef AROS_32BIT_FASTMAX
212 # define AROS_32BIT_FASTMAX AROS_32BIT_MAX
214 #ifndef AROS_64BIT_FASTMAX
215 # ifdef AROS_64BIT_MAX
216 # define AROS_64BIT_FASTMAX AROS_64BIT_MAX
221 The SP_OFFSET should be defined *ONLY* when not defined before.
222 Otherwise it would redefine defaults from cpu-arch.h or machine.h file
226 #endif /* SP_OFFSET */
228 #ifndef AROS_COMPAT_SETD0
229 #define AROS_COMPAT_SETD0(x) (void)x
230 #endif /* AROS_COMPAT_SETD0 */
232 /* These macros will produce a value that can be stored in a AROS_64BIT_TYPE */
233 #ifndef AROS_MAKE_INT64
234 #define AROS_MAKE_INT64(i) i ## LL
236 #ifndef AROS_MAKE_UINT64
237 #define AROS_MAKE_UINT64(i) i ## ULL
241 #define __WORDSIZE 32
245 #define STACKED __attribute__((aligned(4)))
248 #ifndef AROS_HOST_BARRIER
249 #define AROS_HOST_BARRIER
252 #endif /* AROS_CPU_H */