4 Copyright © 1995-2007, 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
22 Firstly, include the sub-include file for a particular CPU.
25 # include <aros/i386/cpu.h>
26 #elif defined __x86_64__
27 # include <aros/x86_64/cpu.h>
28 #elif defined __mc68000__
29 # include <aros/m68k/cpu.h>
30 #elif defined __powerpc__
31 # include <aros/ppc/cpu.h>
33 # error unsupported CPU type
37 Now, for any optional define that hasn't been provided, we must provide
38 an implementation of it here. This is somewhat tedious...
41 #ifndef AROS_INTPTR_TYPE
42 #define AROS_INTPTR_TYPE long
45 #ifndef AROS_32BIT_TYPE
46 #define AROS_32BIT_TYPE long
49 #ifndef AROS_16BIT_TYPE
50 #define AROS_16BIT_TYPE short
53 #ifndef AROS_8BIT_TYPE
54 #define AROS_8BIT_TYPE char
57 #ifndef AROS_64BIT_TYPE
58 #define AROS_64BIT_TYPE long long
61 #ifndef AROS_INTPTR_STACKTYPE
62 #define AROS_INTPTR_STACKTYPE long
65 #ifndef AROS_64BIT_STACKTYPE
66 #define AROS_64BIT_STACKTYPE long long
69 #ifndef AROS_32BIT_STACKTYPE
70 #define AROS_32BIT_STACKTYPE long
73 #ifndef AROS_16BIT_STACKTYPE
74 #define AROS_16BIT_STACKTYPE long
77 #ifndef AROS_8BIT_STACKTYPE
78 #define AROS_8BIT_STACKTYPE long
81 #ifndef AROS_FLOAT_STACKTYPE
82 #define AROS_FLOAT_STACKTYPE float
85 #ifndef AROS_DOUBLE_STACKTYPE
86 #define AROS_DOUBLE_STACKTYPE double
89 #ifndef AROS_LARGEST_TYPE
90 #define AROS_LARGEST_TYPE long
93 #ifndef AROS_ATOMIC_TYPE
94 #define AROS_ATOMIC_TYPE int
98 * AROS_xBIT_LEAST: A type that holds at least a certain bit width.
100 #ifndef AROS_8BIT_LEASTTYPE
101 # define AROS_8BIT_LEASTTYPE AROS_8BIT_TYPE
103 #ifndef AROS_16BIT_LEASTTYPE
104 # define AROS_16BIT_LEASTTYPE AROS_16BIT_TYPE
106 #ifndef AROS_32BIT_LEASTTYPE
107 # define AROS_32BIT_LEASTTYPE AROS_32BIT_TYPE
109 #ifndef AROS_64BIT_LEASTTYPE
110 # ifdef AROS_64BIT_TYPE
111 # define AROS_64BIT_LEASTTYPE AROS_64BIT_TYPE
115 #ifndef AROS_8BIT_LEASTMIN
116 # define AROS_8BIT_LEASTMIN AROS_8BIT_MIN
118 #ifndef AROS_16BIT_LEASTMIN
119 # define AROS_16BIT_LEASTMIN AROS_16BIT_MIN
121 #ifndef AROS_32BIT_LEASTMIN
122 # define AROS_32BIT_LEASTMIN AROS_32BIT_MIN
124 #ifndef AROS_64BIT_LEASTMIN
125 # ifdef AROS_64BIT_MIN
126 # define AROS_64BIT_LEASTMIN AROS_64BIT_MIN
130 #ifndef AROS_8BIT_LEASTMAX
131 # define AROS_8BIT_LEASTMAX AROS_8BIT_MAX
133 #ifndef AROS_16BIT_LEASTMAX
134 # define AROS_16BIT_LEASTMAX AROS_16BIT_MAX
136 #ifndef AROS_32BIT_LEASTMAX
137 # define AROS_32BIT_LEASTMAX AROS_32BIT_MAX
139 #ifndef AROS_64BIT_LEASTMAX
140 # ifdef AROS_64BIT_MAX
141 # define AROS_64BIT_LEASTMAX AROS_64BIT_MAX
147 * AROS_xBIT_FAST: A type that is fast for operating quickly
149 #ifndef AROS_8BIT_FASTTYPE
150 # define AROS_8BIT_FASTTYPE AROS_8BIT_TYPE
152 #ifndef AROS_16BIT_FASTTYPE
153 # define AROS_16BIT_FASTTYPE AROS_16BIT_TYPE
155 #ifndef AROS_32BIT_FASTTYPE
156 # define AROS_32BIT_FASTTYPE AROS_32BIT_TYPE
158 #ifndef AROS_64BIT_FASTTYPE
159 # ifdef AROS_64BIT_TYPE
160 # define AROS_64BIT_FASTTYPE AROS_64BIT_TYPE
164 #ifndef AROS_8BIT_FASTMIN
165 # define AROS_8BIT_FASTMIN AROS_8BIT_MIN
167 #ifndef AROS_16BIT_FASTMIN
168 # define AROS_16BIT_FASTMIN AROS_16BIT_MIN
170 #ifndef AROS_32BIT_FASTMIN
171 # define AROS_32BIT_FASTMIN AROS_32BIT_MIN
173 #ifndef AROS_64BIT_FASTMIN
174 # ifdef AROS_64BIT_MIN
175 # define AROS_64BIT_FASTMIN AROS_64BIT_MIN
179 #ifndef AROS_8BIT_FASTMAX
180 # define AROS_8BIT_FASTMAX AROS_8BIT_MAX
182 #ifndef AROS_16BIT_FASTMAX
183 # define AROS_16BIT_FASTMAX AROS_16BIT_MAX
185 #ifndef AROS_32BIT_FASTMAX
186 # define AROS_32BIT_FASTMAX AROS_32BIT_MAX
188 #ifndef AROS_64BIT_FASTMAX
189 # ifdef AROS_64BIT_MAX
190 # define AROS_64BIT_FASTMAX AROS_64BIT_MAX
195 The SP_OFFSET should be defined *ONLY* when not defined before.
196 Otherwise it would redefine defaults from cpu-arch.h or machine.h file
200 #endif /* SP_OFFSET */
202 #ifndef AROS_COMPAT_SETD0
203 #define AROS_COMPAT_SETD0(x) (void)x
204 #endif /* AROS_COMPAT_SETD0 */
206 /* These macros will produce a value that can be stored in a AROS_64BIT_TYPE */
207 #ifndef AROS_MAKE_INT64
208 #define AROS_MAKE_INT64(i) i ## LL
210 #ifndef AROS_MAKE_UINT64
211 #define AROS_MAKE_UINT64(i) i ## ULL
215 #define __WORDSIZE 32
219 #define STACKED __attribute__((aligned(4)))
222 #endif /* AROS_CPU_H */