]>
Commit | Line | Data |
---|---|---|
5ba3f43e A |
1 | /* |
2 | * Copyright (c) 2004-2007 Apple Inc. All rights reserved. | |
3 | * | |
4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | |
5 | * | |
6 | * This file contains Original Code and/or Modifications of Original Code | |
7 | * as defined in and that are subject to the Apple Public Source License | |
8 | * Version 2.0 (the 'License'). You may not use this file except in | |
9 | * compliance with the License. The rights granted to you under the License | |
10 | * may not be used to create, or enable the creation or redistribution of, | |
11 | * unlawful or unlicensed copies of an Apple operating system, or to | |
12 | * circumvent, violate, or enable the circumvention or violation of, any | |
13 | * terms of an Apple operating system software license agreement. | |
14 | * | |
15 | * Please obtain a copy of the License at | |
16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | |
17 | * | |
18 | * The Original Code and all software distributed under the License are | |
19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | |
21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | |
23 | * Please see the License for the specific language governing rights and | |
24 | * limitations under the License. | |
25 | * | |
26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | |
27 | */ | |
28 | /* | |
29 | * @OSF_COPYRIGHT@ | |
30 | */ | |
31 | #ifndef _MACH_ARM__STRUCTS_H_ | |
32 | #define _MACH_ARM__STRUCTS_H_ | |
33 | ||
34 | #include <sys/cdefs.h> /* __DARWIN_UNIX03 */ | |
35 | #include <machine/types.h> /* __uint32_t */ | |
36 | ||
37 | #if __DARWIN_UNIX03 | |
38 | #define _STRUCT_ARM_EXCEPTION_STATE struct __darwin_arm_exception_state | |
39 | _STRUCT_ARM_EXCEPTION_STATE | |
40 | { | |
41 | __uint32_t __exception; /* number of arm exception taken */ | |
42 | __uint32_t __fsr; /* Fault status */ | |
43 | __uint32_t __far; /* Virtual Fault Address */ | |
44 | }; | |
45 | #else /* !__DARWIN_UNIX03 */ | |
46 | #define _STRUCT_ARM_EXCEPTION_STATE struct arm_exception_state | |
47 | _STRUCT_ARM_EXCEPTION_STATE | |
48 | { | |
49 | __uint32_t exception; /* number of arm exception taken */ | |
50 | __uint32_t fsr; /* Fault status */ | |
51 | __uint32_t far; /* Virtual Fault Address */ | |
52 | }; | |
53 | #endif /* __DARWIN_UNIX03 */ | |
54 | ||
55 | #if __DARWIN_UNIX03 | |
56 | #define _STRUCT_ARM_EXCEPTION_STATE64 struct __darwin_arm_exception_state64 | |
57 | _STRUCT_ARM_EXCEPTION_STATE64 | |
58 | { | |
59 | __uint64_t __far; /* Virtual Fault Address */ | |
60 | __uint32_t __esr; /* Exception syndrome */ | |
61 | __uint32_t __exception; /* number of arm exception taken */ | |
62 | }; | |
63 | #else /* !__DARWIN_UNIX03 */ | |
64 | #define _STRUCT_ARM_EXCEPTION_STATE64 struct arm_exception_state64 | |
65 | _STRUCT_ARM_EXCEPTION_STATE64 | |
66 | { | |
67 | __uint64_t far; /* Virtual Fault Address */ | |
68 | __uint32_t esr; /* Exception syndrome */ | |
69 | __uint32_t exception; /* number of arm exception taken */ | |
70 | }; | |
71 | #endif /* __DARWIN_UNIX03 */ | |
72 | ||
73 | #if __DARWIN_UNIX03 | |
74 | #define _STRUCT_ARM_THREAD_STATE struct __darwin_arm_thread_state | |
75 | _STRUCT_ARM_THREAD_STATE | |
76 | { | |
77 | __uint32_t __r[13]; /* General purpose register r0-r12 */ | |
78 | __uint32_t __sp; /* Stack pointer r13 */ | |
79 | __uint32_t __lr; /* Link register r14 */ | |
80 | __uint32_t __pc; /* Program counter r15 */ | |
81 | __uint32_t __cpsr; /* Current program status register */ | |
82 | }; | |
83 | #else /* !__DARWIN_UNIX03 */ | |
84 | #define _STRUCT_ARM_THREAD_STATE struct arm_thread_state | |
85 | _STRUCT_ARM_THREAD_STATE | |
86 | { | |
87 | __uint32_t r[13]; /* General purpose register r0-r12 */ | |
88 | __uint32_t sp; /* Stack pointer r13 */ | |
89 | __uint32_t lr; /* Link register r14 */ | |
90 | __uint32_t pc; /* Program counter r15 */ | |
91 | __uint32_t cpsr; /* Current program status register */ | |
92 | }; | |
93 | #endif /* __DARWIN_UNIX03 */ | |
94 | ||
95 | #if __DARWIN_UNIX03 | |
96 | #define _STRUCT_ARM_THREAD_STATE64 struct __darwin_arm_thread_state64 | |
97 | _STRUCT_ARM_THREAD_STATE64 | |
98 | { | |
99 | __uint64_t __x[29]; /* General purpose registers x0-x28 */ | |
100 | __uint64_t __fp; /* Frame pointer x29 */ | |
101 | __uint64_t __lr; /* Link register x30 */ | |
102 | __uint64_t __sp; /* Stack pointer x31 */ | |
103 | __uint64_t __pc; /* Program counter */ | |
104 | __uint32_t __cpsr; /* Current program status register */ | |
105 | __uint32_t __pad; /* Same size for 32-bit or 64-bit clients */ | |
106 | }; | |
107 | #else /* !__DARWIN_UNIX03 */ | |
108 | #define _STRUCT_ARM_THREAD_STATE64 struct arm_thread_state64 | |
109 | _STRUCT_ARM_THREAD_STATE64 | |
110 | { | |
111 | __uint64_t x[29]; /* General purpose registers x0-x28 */ | |
112 | __uint64_t fp; /* Frame pointer x29 */ | |
113 | __uint64_t lr; /* Link register x30 */ | |
114 | __uint64_t sp; /* Stack pointer x31 */ | |
115 | __uint64_t pc; /* Program counter */ | |
116 | __uint32_t cpsr; /* Current program status register */ | |
117 | __uint32_t __pad; /* Same size for 32-bit or 64-bit clients */ | |
118 | }; | |
119 | #endif /* __DARWIN_UNIX03 */ | |
120 | ||
121 | #if __DARWIN_UNIX03 | |
122 | #define _STRUCT_ARM_VFP_STATE struct __darwin_arm_vfp_state | |
123 | _STRUCT_ARM_VFP_STATE | |
124 | { | |
125 | __uint32_t __r[64]; | |
126 | __uint32_t __fpscr; | |
127 | ||
128 | }; | |
129 | #else /* !__DARWIN_UNIX03 */ | |
130 | #define _STRUCT_ARM_VFP_STATE struct arm_vfp_state | |
131 | _STRUCT_ARM_VFP_STATE | |
132 | { | |
133 | __uint32_t r[64]; | |
134 | __uint32_t fpscr; | |
135 | }; | |
136 | #endif /* __DARWIN_UNIX03 */ | |
137 | ||
138 | #if __DARWIN_UNIX03 | |
139 | #define _STRUCT_ARM_NEON_STATE64 struct __darwin_arm_neon_state64 | |
140 | #define _STRUCT_ARM_NEON_STATE struct __darwin_arm_neon_state | |
141 | ||
142 | #if defined(__arm64__) | |
143 | _STRUCT_ARM_NEON_STATE64 | |
144 | { | |
145 | __uint128_t __v[32]; | |
146 | __uint32_t __fpsr; | |
147 | __uint32_t __fpcr; | |
148 | }; | |
149 | ||
150 | _STRUCT_ARM_NEON_STATE | |
151 | { | |
152 | __uint128_t __v[16]; | |
153 | __uint32_t __fpsr; | |
154 | __uint32_t __fpcr; | |
155 | }; | |
156 | ||
157 | #elif defined(__arm__) | |
158 | /* | |
159 | * No 128-bit intrinsic for ARM; leave it opaque for now. | |
160 | */ | |
161 | _STRUCT_ARM_NEON_STATE64 | |
162 | { | |
163 | char opaque[(32 * 16) + (2 * sizeof(__uint32_t))]; | |
164 | } __attribute__((aligned(16))); | |
165 | ||
166 | _STRUCT_ARM_NEON_STATE | |
167 | { | |
168 | char opaque[(16 * 16) + (2 * sizeof(__uint32_t))]; | |
169 | } __attribute__((aligned(16))); | |
170 | ||
171 | #else | |
172 | #error Unknown architecture. | |
173 | #endif | |
174 | ||
175 | #else /* !__DARWIN_UNIX03 */ | |
176 | #define _STRUCT_ARM_NEON_STATE64 struct arm_neon_state64 | |
177 | #define _STRUCT_ARM_NEON_STATE struct arm_neon_state | |
178 | ||
179 | #if defined(__arm64__) | |
180 | _STRUCT_ARM_NEON_STATE64 | |
181 | { | |
182 | __uint128_t q[32]; | |
183 | uint32_t fpsr; | |
184 | uint32_t fpcr; | |
185 | ||
186 | }; | |
187 | _STRUCT_ARM_NEON_STATE | |
188 | { | |
189 | __uint128_t q[16]; | |
190 | uint32_t fpsr; | |
191 | uint32_t fpcr; | |
192 | ||
193 | }; | |
194 | #elif defined(__arm__) | |
195 | /* | |
196 | * No 128-bit intrinsic for ARM; leave it opaque for now. | |
197 | */ | |
198 | _STRUCT_ARM_NEON_STATE64 | |
199 | { | |
200 | char opaque[(32 * 16) + (2 * sizeof(__uint32_t))]; | |
201 | } __attribute__((aligned(16))); | |
202 | ||
203 | _STRUCT_ARM_NEON_STATE | |
204 | { | |
205 | char opaque[(16 * 16) + (2 * sizeof(__uint32_t))]; | |
206 | } __attribute__((aligned(16))); | |
207 | ||
208 | #else | |
209 | #error Unknown architecture. | |
210 | #endif | |
211 | ||
212 | #endif /* __DARWIN_UNIX03 */ | |
213 | ||
214 | /* | |
215 | * Debug State | |
216 | */ | |
217 | #if defined(__arm__) | |
218 | /* Old-fashioned debug state is only for ARM */ | |
219 | ||
220 | #if __DARWIN_UNIX03 | |
221 | #define _STRUCT_ARM_DEBUG_STATE struct __darwin_arm_debug_state | |
222 | _STRUCT_ARM_DEBUG_STATE | |
223 | { | |
224 | __uint32_t __bvr[16]; | |
225 | __uint32_t __bcr[16]; | |
226 | __uint32_t __wvr[16]; | |
227 | __uint32_t __wcr[16]; | |
228 | }; | |
229 | #else /* !__DARWIN_UNIX03 */ | |
230 | #define _STRUCT_ARM_DEBUG_STATE struct arm_debug_state | |
231 | _STRUCT_ARM_DEBUG_STATE | |
232 | { | |
233 | __uint32_t bvr[16]; | |
234 | __uint32_t bcr[16]; | |
235 | __uint32_t wvr[16]; | |
236 | __uint32_t wcr[16]; | |
237 | }; | |
238 | #endif /* __DARWIN_UNIX03 */ | |
239 | ||
240 | #elif defined(__arm64__) | |
241 | ||
242 | /* ARM's arm_debug_state is ARM64's arm_legacy_debug_state */ | |
243 | ||
244 | #if __DARWIN_UNIX03 | |
245 | #define _STRUCT_ARM_LEGACY_DEBUG_STATE struct arm_legacy_debug_state | |
246 | _STRUCT_ARM_LEGACY_DEBUG_STATE | |
247 | { | |
248 | __uint32_t __bvr[16]; | |
249 | __uint32_t __bcr[16]; | |
250 | __uint32_t __wvr[16]; | |
251 | __uint32_t __wcr[16]; | |
252 | }; | |
253 | #else /* __DARWIN_UNIX03 */ | |
254 | #define _STRUCT_ARM_LEGACY_DEBUG_STATE struct arm_legacy_debug_state | |
255 | _STRUCT_ARM_LEGACY_DEBUG_STATE | |
256 | { | |
257 | __uint32_t bvr[16]; | |
258 | __uint32_t bcr[16]; | |
259 | __uint32_t wvr[16]; | |
260 | __uint32_t wcr[16]; | |
261 | }; | |
262 | #endif /* __DARWIN_UNIX03 */ | |
263 | #else | |
264 | #error unknown architecture | |
265 | #endif | |
266 | ||
267 | #if __DARWIN_UNIX03 | |
268 | #define _STRUCT_ARM_DEBUG_STATE32 struct __darwin_arm_debug_state32 | |
269 | _STRUCT_ARM_DEBUG_STATE32 | |
270 | { | |
271 | __uint32_t __bvr[16]; | |
272 | __uint32_t __bcr[16]; | |
273 | __uint32_t __wvr[16]; | |
274 | __uint32_t __wcr[16]; | |
275 | __uint64_t __mdscr_el1; /* Bit 0 is SS (Hardware Single Step) */ | |
276 | }; | |
277 | ||
278 | #define _STRUCT_ARM_DEBUG_STATE64 struct __darwin_arm_debug_state64 | |
279 | _STRUCT_ARM_DEBUG_STATE64 | |
280 | { | |
281 | __uint64_t __bvr[16]; | |
282 | __uint64_t __bcr[16]; | |
283 | __uint64_t __wvr[16]; | |
284 | __uint64_t __wcr[16]; | |
285 | __uint64_t __mdscr_el1; /* Bit 0 is SS (Hardware Single Step) */ | |
286 | }; | |
287 | #else /* !__DARWIN_UNIX03 */ | |
288 | #define _STRUCT_ARM_DEBUG_STATE32 struct arm_debug_state32 | |
289 | _STRUCT_ARM_DEBUG_STATE32 | |
290 | { | |
291 | __uint32_t bvr[16]; | |
292 | __uint32_t bcr[16]; | |
293 | __uint32_t wvr[16]; | |
294 | __uint32_t wcr[16]; | |
295 | __uint64_t mdscr_el1; /* Bit 0 is SS (Hardware Single Step) */ | |
296 | }; | |
297 | ||
298 | #define _STRUCT_ARM_DEBUG_STATE64 struct arm_debug_state64 | |
299 | _STRUCT_ARM_DEBUG_STATE64 | |
300 | { | |
301 | __uint64_t bvr[16]; | |
302 | __uint64_t bcr[16]; | |
303 | __uint64_t wvr[16]; | |
304 | __uint64_t wcr[16]; | |
305 | __uint64_t mdscr_el1; /* Bit 0 is SS (Hardware Single Step) */ | |
306 | }; | |
307 | #endif /* __DARWIN_UNIX03 */ | |
308 | ||
309 | #if __DARWIN_UNIX03 | |
310 | #define _STRUCT_ARM_CPMU_STATE64 struct __darwin_arm_cpmu_state64 | |
311 | _STRUCT_ARM_CPMU_STATE64 | |
312 | { | |
313 | __uint64_t __ctrs[16]; | |
314 | }; | |
315 | #else /* __DARWIN_UNIX03 */ | |
316 | #define _STRUCT_ARM_CPMU_STATE64 struct arm_cpmu_state64 | |
317 | _STRUCT_ARM_CPMU_STATE64 | |
318 | { | |
319 | __uint64_t ctrs[16]; | |
320 | }; | |
321 | #endif /* !__DARWIN_UNIX03 */ | |
322 | ||
323 | #endif /* _MACH_ARM__STRUCTS_H_ */ |