Use TARGET_STRIP instead of STRIP. Needed on OS X.
[AROS.git] / compiler / include / aros / cpu.h
blob658f3b2e7e7fbcf10899e847e81e2b0ac56d245a
1 #ifndef AROS_CPU_H
2 #define AROS_CPU_H
3 /*
4 Copyright © 1995-2011, 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 __arm__
43 # include <aros/arm/cpu.h>
44 #else
45 # error unsupported CPU type
46 #endif
48 #if !AROS_STACK_GROWS_DOWNWARDS
49 #error Several places in AROS code assume a stack that grows downwards
50 #endif
53 Under 64-bit MS Windows long is still 32 bits
56 #ifdef _WIN64
57 #define AROS_INTPTR_TYPE long long
58 #define AROS_INTPTR_STACKTYPE long long
59 #define AROS_LARGEST_TYPE long long
60 #endif
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
69 #endif
71 #ifndef AROS_32BIT_TYPE
72 #define AROS_32BIT_TYPE long
73 #endif
75 #ifndef AROS_16BIT_TYPE
76 #define AROS_16BIT_TYPE short
77 #endif
79 #ifndef AROS_8BIT_TYPE
80 #define AROS_8BIT_TYPE char
81 #endif
83 #ifndef AROS_64BIT_TYPE
84 #define AROS_64BIT_TYPE long long
85 #endif
87 #ifndef AROS_INTPTR_STACKTYPE
88 #define AROS_INTPTR_STACKTYPE long
89 #endif
91 #ifndef AROS_64BIT_STACKTYPE
92 #define AROS_64BIT_STACKTYPE long long
93 #endif
95 #ifndef AROS_32BIT_STACKTYPE
96 #define AROS_32BIT_STACKTYPE long
97 #endif
99 #ifndef AROS_16BIT_STACKTYPE
100 #define AROS_16BIT_STACKTYPE long
101 #endif
103 #ifndef AROS_8BIT_STACKTYPE
104 #define AROS_8BIT_STACKTYPE long
105 #endif
107 #ifndef AROS_FLOAT_STACKTYPE
108 #define AROS_FLOAT_STACKTYPE float
109 #endif
111 #ifndef AROS_DOUBLE_STACKTYPE
112 #define AROS_DOUBLE_STACKTYPE double
113 #endif
115 #ifndef AROS_LARGEST_TYPE
116 #define AROS_LARGEST_TYPE long
117 #endif
119 #ifndef AROS_ATOMIC_TYPE
120 #define AROS_ATOMIC_TYPE int
121 #endif
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
128 #endif
129 #ifndef AROS_16BIT_LEASTTYPE
130 # define AROS_16BIT_LEASTTYPE AROS_16BIT_TYPE
131 #endif
132 #ifndef AROS_32BIT_LEASTTYPE
133 # define AROS_32BIT_LEASTTYPE AROS_32BIT_TYPE
134 #endif
135 #ifndef AROS_64BIT_LEASTTYPE
136 # ifdef AROS_64BIT_TYPE
137 # define AROS_64BIT_LEASTTYPE AROS_64BIT_TYPE
138 # endif
139 #endif
141 #ifndef AROS_8BIT_LEASTMIN
142 # define AROS_8BIT_LEASTMIN AROS_8BIT_MIN
143 #endif
144 #ifndef AROS_16BIT_LEASTMIN
145 # define AROS_16BIT_LEASTMIN AROS_16BIT_MIN
146 #endif
147 #ifndef AROS_32BIT_LEASTMIN
148 # define AROS_32BIT_LEASTMIN AROS_32BIT_MIN
149 #endif
150 #ifndef AROS_64BIT_LEASTMIN
151 # ifdef AROS_64BIT_MIN
152 # define AROS_64BIT_LEASTMIN AROS_64BIT_MIN
153 # endif
154 #endif
156 #ifndef AROS_8BIT_LEASTMAX
157 # define AROS_8BIT_LEASTMAX AROS_8BIT_MAX
158 #endif
159 #ifndef AROS_16BIT_LEASTMAX
160 # define AROS_16BIT_LEASTMAX AROS_16BIT_MAX
161 #endif
162 #ifndef AROS_32BIT_LEASTMAX
163 # define AROS_32BIT_LEASTMAX AROS_32BIT_MAX
164 #endif
165 #ifndef AROS_64BIT_LEASTMAX
166 # ifdef AROS_64BIT_MAX
167 # define AROS_64BIT_LEASTMAX AROS_64BIT_MAX
168 # endif
169 #endif
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
177 #endif
178 #ifndef AROS_16BIT_FASTTYPE
179 # define AROS_16BIT_FASTTYPE AROS_16BIT_TYPE
180 #endif
181 #ifndef AROS_32BIT_FASTTYPE
182 # define AROS_32BIT_FASTTYPE AROS_32BIT_TYPE
183 #endif
184 #ifndef AROS_64BIT_FASTTYPE
185 # ifdef AROS_64BIT_TYPE
186 # define AROS_64BIT_FASTTYPE AROS_64BIT_TYPE
187 # endif
188 #endif
190 #ifndef AROS_8BIT_FASTMIN
191 # define AROS_8BIT_FASTMIN AROS_8BIT_MIN
192 #endif
193 #ifndef AROS_16BIT_FASTMIN
194 # define AROS_16BIT_FASTMIN AROS_16BIT_MIN
195 #endif
196 #ifndef AROS_32BIT_FASTMIN
197 # define AROS_32BIT_FASTMIN AROS_32BIT_MIN
198 #endif
199 #ifndef AROS_64BIT_FASTMIN
200 # ifdef AROS_64BIT_MIN
201 # define AROS_64BIT_FASTMIN AROS_64BIT_MIN
202 # endif
203 #endif
205 #ifndef AROS_8BIT_FASTMAX
206 # define AROS_8BIT_FASTMAX AROS_8BIT_MAX
207 #endif
208 #ifndef AROS_16BIT_FASTMAX
209 # define AROS_16BIT_FASTMAX AROS_16BIT_MAX
210 #endif
211 #ifndef AROS_32BIT_FASTMAX
212 # define AROS_32BIT_FASTMAX AROS_32BIT_MAX
213 #endif
214 #ifndef AROS_64BIT_FASTMAX
215 # ifdef AROS_64BIT_MAX
216 # define AROS_64BIT_FASTMAX AROS_64BIT_MAX
217 # endif
218 #endif
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
224 #ifndef SP_OFFSET
225 #define SP_OFFSET 0
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
235 #endif
236 #ifndef AROS_MAKE_UINT64
237 #define AROS_MAKE_UINT64(i) i ## ULL
238 #endif
240 #ifndef __WORDSIZE
241 #define __WORDSIZE 32
242 #endif
244 #ifndef STACKED
245 #define STACKED __attribute__((aligned(4)))
246 #endif
248 #ifndef AROS_HOST_BARRIER
249 #define AROS_HOST_BARRIER
250 #endif
252 #endif /* AROS_CPU_H */