2 * Copyright (c) 2004-2007 Apple Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
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.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
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.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
31 #ifndef _MACH_ARM__STRUCTS_H_
32 #define _MACH_ARM__STRUCTS_H_
34 #include <sys/cdefs.h> /* __DARWIN_UNIX03 */
35 #include <machine/types.h> /* __uint32_t */
38 #define _STRUCT_ARM_EXCEPTION_STATE struct __darwin_arm_exception_state
39 _STRUCT_ARM_EXCEPTION_STATE
41 __uint32_t __exception
; /* number of arm exception taken */
42 __uint32_t __fsr
; /* Fault status */
43 __uint32_t __far
; /* Virtual Fault Address */
45 #else /* !__DARWIN_UNIX03 */
46 #define _STRUCT_ARM_EXCEPTION_STATE struct arm_exception_state
47 _STRUCT_ARM_EXCEPTION_STATE
49 __uint32_t exception
; /* number of arm exception taken */
50 __uint32_t fsr
; /* Fault status */
51 __uint32_t far
; /* Virtual Fault Address */
53 #endif /* __DARWIN_UNIX03 */
56 #define _STRUCT_ARM_EXCEPTION_STATE64 struct __darwin_arm_exception_state64
57 _STRUCT_ARM_EXCEPTION_STATE64
59 __uint64_t __far
; /* Virtual Fault Address */
60 __uint32_t __esr
; /* Exception syndrome */
61 __uint32_t __exception
; /* number of arm exception taken */
63 #else /* !__DARWIN_UNIX03 */
64 #define _STRUCT_ARM_EXCEPTION_STATE64 struct arm_exception_state64
65 _STRUCT_ARM_EXCEPTION_STATE64
67 __uint64_t far
; /* Virtual Fault Address */
68 __uint32_t esr
; /* Exception syndrome */
69 __uint32_t exception
; /* number of arm exception taken */
71 #endif /* __DARWIN_UNIX03 */
74 #define _STRUCT_ARM_THREAD_STATE struct __darwin_arm_thread_state
75 _STRUCT_ARM_THREAD_STATE
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 */
83 #else /* !__DARWIN_UNIX03 */
84 #define _STRUCT_ARM_THREAD_STATE struct arm_thread_state
85 _STRUCT_ARM_THREAD_STATE
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 */
93 #endif /* __DARWIN_UNIX03 */
97 #define __DARWIN_OPAQUE_ARM_THREAD_STATE64 0
98 #define __DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH 0x1
99 #define __DARWIN_ARM_THREAD_STATE64_FLAGS_IB_SIGNED_LR 0x2
101 #define _STRUCT_ARM_THREAD_STATE64 struct arm_thread_state64
102 _STRUCT_ARM_THREAD_STATE64
104 __uint64_t x
[29]; /* General purpose registers x0-x28 */
105 __uint64_t fp
; /* Frame pointer x29 */
106 __uint64_t lr
; /* Link register x30 */
107 __uint64_t sp
; /* Stack pointer x31 */
108 __uint64_t pc
; /* Program counter */
109 __uint32_t cpsr
; /* Current program status register */
110 __uint32_t flags
; /* Flags describing structure format */
113 #else /* defined(KERNEL) */
116 * By default, the pointer fields in the arm_thread_state64_t structure are
117 * opaque on the arm64e architecture and require the use of accessor macros.
118 * This mode can also be enabled on the arm64 architecture by building with
119 * -D__DARWIN_OPAQUE_ARM_THREAD_STATE64=1.
121 #if defined(__arm64__) && defined(__LP64__)
123 #if __has_feature(ptrauth_calls)
124 #define __DARWIN_OPAQUE_ARM_THREAD_STATE64 1
125 #define __DARWIN_PTRAUTH_ARM_THREAD_STATE64 1
126 #endif /* __has_feature(ptrauth_calls) */
128 #ifndef __DARWIN_OPAQUE_ARM_THREAD_STATE64
129 #define __DARWIN_OPAQUE_ARM_THREAD_STATE64 0
132 #else /* defined(__arm64__) && defined(__LP64__) */
134 #undef __DARWIN_OPAQUE_ARM_THREAD_STATE64
135 #define __DARWIN_OPAQUE_ARM_THREAD_STATE64 0
137 #endif /* defined(__arm64__) && defined(__LP64__) */
140 #define _STRUCT_ARM_THREAD_STATE64 struct __darwin_arm_thread_state64
141 #if __DARWIN_OPAQUE_ARM_THREAD_STATE64
142 _STRUCT_ARM_THREAD_STATE64
144 __uint64_t __x
[29]; /* General purpose registers x0-x28 */
145 void* __opaque_fp
; /* Frame pointer x29 */
146 void* __opaque_lr
; /* Link register x30 */
147 void* __opaque_sp
; /* Stack pointer x31 */
148 void* __opaque_pc
; /* Program counter */
149 __uint32_t __cpsr
; /* Current program status register */
150 __uint32_t __opaque_flags
; /* Flags describing structure format */
152 #else /* __DARWIN_OPAQUE_ARM_THREAD_STATE64 */
153 _STRUCT_ARM_THREAD_STATE64
155 __uint64_t __x
[29]; /* General purpose registers x0-x28 */
156 __uint64_t __fp
; /* Frame pointer x29 */
157 __uint64_t __lr
; /* Link register x30 */
158 __uint64_t __sp
; /* Stack pointer x31 */
159 __uint64_t __pc
; /* Program counter */
160 __uint32_t __cpsr
; /* Current program status register */
161 __uint32_t __pad
; /* Same size for 32-bit or 64-bit clients */
163 #endif /* __DARWIN_OPAQUE_ARM_THREAD_STATE64 */
164 #else /* !__DARWIN_UNIX03 */
165 #define _STRUCT_ARM_THREAD_STATE64 struct arm_thread_state64
166 #if __DARWIN_OPAQUE_ARM_THREAD_STATE64
167 _STRUCT_ARM_THREAD_STATE64
169 __uint64_t x
[29]; /* General purpose registers x0-x28 */
170 void* __opaque_fp
; /* Frame pointer x29 */
171 void* __opaque_lr
; /* Link register x30 */
172 void* __opaque_sp
; /* Stack pointer x31 */
173 void* __opaque_pc
; /* Program counter */
174 __uint32_t cpsr
; /* Current program status register */
175 __uint32_t __opaque_flags
; /* Flags describing structure format */
177 #else /* __DARWIN_OPAQUE_ARM_THREAD_STATE64 */
178 _STRUCT_ARM_THREAD_STATE64
180 __uint64_t x
[29]; /* General purpose registers x0-x28 */
181 __uint64_t fp
; /* Frame pointer x29 */
182 __uint64_t lr
; /* Link register x30 */
183 __uint64_t sp
; /* Stack pointer x31 */
184 __uint64_t pc
; /* Program counter */
185 __uint32_t cpsr
; /* Current program status register */
186 __uint32_t __pad
; /* Same size for 32-bit or 64-bit clients */
188 #endif /* __DARWIN_OPAQUE_ARM_THREAD_STATE64 */
189 #endif /* __DARWIN_UNIX03 */
191 #if __DARWIN_C_LEVEL >= __DARWIN_C_FULL && defined(__arm64__)
193 /* Accessor macros for arm_thread_state64_t pointer fields */
195 #if __has_feature(ptrauth_calls) && defined(__LP64__)
198 #if !__DARWIN_OPAQUE_ARM_THREAD_STATE64 || !__DARWIN_PTRAUTH_ARM_THREAD_STATE64
199 #error "Invalid configuration"
202 #define __DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH 0x1
203 #define __DARWIN_ARM_THREAD_STATE64_FLAGS_IB_SIGNED_LR 0x2
205 /* Return pc field of arm_thread_state64_t as a data pointer value */
206 #define __darwin_arm_thread_state64_get_pc(ts) \
207 __extension__ ({ const _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
208 (uintptr_t)(__tsp->__opaque_pc && !(__tsp->__opaque_flags & \
209 __DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH) ? \
210 ptrauth_auth_data(__tsp->__opaque_pc, \
211 ptrauth_key_process_independent_code, \
212 ptrauth_string_discriminator("pc")) : __tsp->__opaque_pc); })
213 /* Return pc field of arm_thread_state64_t as a function pointer. May return
214 * NULL if a valid function pointer cannot be constructed, the caller should
215 * fall back to the __darwin_arm_thread_state64_get_pc() macro in that case. */
216 #define __darwin_arm_thread_state64_get_pc_fptr(ts) \
217 __extension__ ({ const _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
218 (__tsp->__opaque_pc && !(__tsp->__opaque_flags & \
219 __DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH) ? \
220 ptrauth_auth_function(__tsp->__opaque_pc, \
221 ptrauth_key_process_independent_code, \
222 ptrauth_string_discriminator("pc")) : NULL); })
223 /* Set pc field of arm_thread_state64_t to a function pointer */
224 #define __darwin_arm_thread_state64_set_pc_fptr(ts, fptr) \
225 __extension__ ({ _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
226 __typeof__(fptr) __f = (fptr); __tsp->__opaque_pc = \
227 (__f ? (!(__tsp->__opaque_flags & \
228 __DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH) ? \
229 ptrauth_auth_and_resign(__f, ptrauth_key_function_pointer, 0, \
230 ptrauth_key_process_independent_code, \
231 ptrauth_string_discriminator("pc")) : ptrauth_auth_data(__f, \
232 ptrauth_key_function_pointer, 0)) : __f); })
233 /* Return lr field of arm_thread_state64_t as a data pointer value */
234 #define __darwin_arm_thread_state64_get_lr(ts) \
235 __extension__ ({ const _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
236 (uintptr_t)(__tsp->__opaque_lr && !(__tsp->__opaque_flags & ( \
237 __DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH | \
238 __DARWIN_ARM_THREAD_STATE64_FLAGS_IB_SIGNED_LR)) ? \
239 ptrauth_auth_data(__tsp->__opaque_lr, \
240 ptrauth_key_process_independent_code, \
241 ptrauth_string_discriminator("lr")) : __tsp->__opaque_lr); })
242 /* Return lr field of arm_thread_state64_t as a function pointer. May return
243 * NULL if a valid function pointer cannot be constructed, the caller should
244 * fall back to the __darwin_arm_thread_state64_get_lr() macro in that case. */
245 #define __darwin_arm_thread_state64_get_lr_fptr(ts) \
246 __extension__ ({ const _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
247 (__tsp->__opaque_lr && !(__tsp->__opaque_flags & ( \
248 __DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH | \
249 __DARWIN_ARM_THREAD_STATE64_FLAGS_IB_SIGNED_LR)) ? \
250 ptrauth_auth_function(__tsp->__opaque_lr, \
251 ptrauth_key_process_independent_code, \
252 ptrauth_string_discriminator("lr")) : NULL); })
253 /* Set lr field of arm_thread_state64_t to a function pointer */
254 #define __darwin_arm_thread_state64_set_lr_fptr(ts, fptr) \
255 __extension__ ({ _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
256 __typeof__(fptr) __f = (fptr); __tsp->__opaque_lr = \
257 (__f ? (!(__tsp->__opaque_flags & \
258 __DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH) ? (__tsp->__opaque_flags \
259 &= ~__DARWIN_ARM_THREAD_STATE64_FLAGS_IB_SIGNED_LR , \
260 ptrauth_auth_and_resign(__f, ptrauth_key_function_pointer, 0, \
261 ptrauth_key_process_independent_code, \
262 ptrauth_string_discriminator("lr"))) : ptrauth_auth_data(__f, \
263 ptrauth_key_function_pointer, 0)) : __f); })
264 /* Return sp field of arm_thread_state64_t as a data pointer value */
265 #define __darwin_arm_thread_state64_get_sp(ts) \
266 __extension__ ({ const _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
267 (uintptr_t)(__tsp->__opaque_sp && !(__tsp->__opaque_flags & \
268 __DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH) ? \
269 ptrauth_auth_data(__tsp->__opaque_sp, \
270 ptrauth_key_process_independent_data, \
271 ptrauth_string_discriminator("sp")) : __tsp->__opaque_sp); })
272 /* Set sp field of arm_thread_state64_t to a data pointer value */
273 #define __darwin_arm_thread_state64_set_sp(ts, ptr) \
274 __extension__ ({ _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
275 void *__p = (void*)(uintptr_t)(ptr); __tsp->__opaque_sp = \
276 (__p && !(__tsp->__opaque_flags & \
277 __DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH) ? \
278 ptrauth_sign_unauthenticated(__p, \
279 ptrauth_key_process_independent_data, \
280 ptrauth_string_discriminator("sp")) : __p); })
281 /* Return fp field of arm_thread_state64_t as a data pointer value */
282 #define __darwin_arm_thread_state64_get_fp(ts) \
283 __extension__ ({ const _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
284 (uintptr_t)(__tsp->__opaque_fp && !(__tsp->__opaque_flags & \
285 __DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH) ? \
286 ptrauth_auth_data(__tsp->__opaque_fp, \
287 ptrauth_key_process_independent_data, \
288 ptrauth_string_discriminator("fp")) : __tsp->__opaque_fp); })
289 /* Set fp field of arm_thread_state64_t to a data pointer value */
290 #define __darwin_arm_thread_state64_set_fp(ts, ptr) \
291 __extension__ ({ _STRUCT_ARM_THREAD_STATE64 *__tsp = &(ts); \
292 void *__p = (void*)(uintptr_t)(ptr); __tsp->__opaque_fp = \
293 (__p && !(__tsp->__opaque_flags & \
294 __DARWIN_ARM_THREAD_STATE64_FLAGS_NO_PTRAUTH) ? \
295 ptrauth_sign_unauthenticated(__p, \
296 ptrauth_key_process_independent_data, \
297 ptrauth_string_discriminator("fp")) : __p); })
299 #else /* __has_feature(ptrauth_calls) && defined(__LP64__) */
301 #if __DARWIN_OPAQUE_ARM_THREAD_STATE64
304 #error "Invalid configuration"
307 /* Return pc field of arm_thread_state64_t as a data pointer value */
308 #define __darwin_arm_thread_state64_get_pc(ts) \
309 ((uintptr_t)((ts).__opaque_pc))
310 /* Return pc field of arm_thread_state64_t as a function pointer */
311 #define __darwin_arm_thread_state64_get_pc_fptr(ts) \
313 /* Set pc field of arm_thread_state64_t to a function pointer */
314 #define __darwin_arm_thread_state64_set_pc_fptr(ts, fptr) \
315 ((ts).__opaque_pc = (fptr))
316 /* Return lr field of arm_thread_state64_t as a data pointer value */
317 #define __darwin_arm_thread_state64_get_lr(ts) \
318 ((uintptr_t)((ts).__opaque_lr))
319 /* Return lr field of arm_thread_state64_t as a function pointer */
320 #define __darwin_arm_thread_state64_get_lr_fptr(ts) \
322 /* Set lr field of arm_thread_state64_t to a function pointer */
323 #define __darwin_arm_thread_state64_set_lr_fptr(ts, fptr) \
324 ((ts).__opaque_lr = (fptr))
325 /* Return sp field of arm_thread_state64_t as a data pointer value */
326 #define __darwin_arm_thread_state64_get_sp(ts) \
327 ((uintptr_t)((ts).__opaque_sp))
328 /* Set sp field of arm_thread_state64_t to a data pointer value */
329 #define __darwin_arm_thread_state64_set_sp(ts, ptr) \
330 ((ts).__opaque_sp = (void*)(uintptr_t)(ptr))
331 /* Return fp field of arm_thread_state64_t as a data pointer value */
332 #define __darwin_arm_thread_state64_get_fp(ts) \
333 ((uintptr_t)((ts).__opaque_fp))
334 /* Set fp field of arm_thread_state64_t to a data pointer value */
335 #define __darwin_arm_thread_state64_set_fp(ts, ptr) \
336 ((ts).__opaque_fp = (void*)(uintptr_t)(ptr))
338 #else /* __DARWIN_OPAQUE_ARM_THREAD_STATE64 */
341 /* Return pc field of arm_thread_state64_t as a data pointer value */
342 #define __darwin_arm_thread_state64_get_pc(ts) \
344 /* Return pc field of arm_thread_state64_t as a function pointer */
345 #define __darwin_arm_thread_state64_get_pc_fptr(ts) \
346 ((void*)(uintptr_t)((ts).__pc))
347 /* Set pc field of arm_thread_state64_t to a function pointer */
348 #define __darwin_arm_thread_state64_set_pc_fptr(ts, fptr) \
349 ((ts).__pc = (uintptr_t)(fptr))
350 /* Return lr field of arm_thread_state64_t as a data pointer value */
351 #define __darwin_arm_thread_state64_get_lr(ts) \
353 /* Return lr field of arm_thread_state64_t as a function pointer */
354 #define __darwin_arm_thread_state64_get_lr_fptr(ts) \
355 ((void*)(uintptr_t)((ts).__lr))
356 /* Set lr field of arm_thread_state64_t to a function pointer */
357 #define __darwin_arm_thread_state64_set_lr_fptr(ts, fptr) \
358 ((ts).__lr = (uintptr_t)(fptr))
359 /* Return sp field of arm_thread_state64_t as a data pointer value */
360 #define __darwin_arm_thread_state64_get_sp(ts) \
362 /* Set sp field of arm_thread_state64_t to a data pointer value */
363 #define __darwin_arm_thread_state64_set_sp(ts, ptr) \
364 ((ts).__sp = (uintptr_t)(ptr))
365 /* Return fp field of arm_thread_state64_t as a data pointer value */
366 #define __darwin_arm_thread_state64_get_fp(ts) \
368 /* Set fp field of arm_thread_state64_t to a data pointer value */
369 #define __darwin_arm_thread_state64_set_fp(ts, ptr) \
370 ((ts).__fp = (uintptr_t)(ptr))
372 #else /* __DARWIN_UNIX03 */
374 /* Return pc field of arm_thread_state64_t as a data pointer value */
375 #define __darwin_arm_thread_state64_get_pc(ts) \
377 /* Return pc field of arm_thread_state64_t as a function pointer */
378 #define __darwin_arm_thread_state64_get_pc_fptr(ts) \
379 ((void*)(uintptr_t)((ts).pc))
380 /* Set pc field of arm_thread_state64_t to a function pointer */
381 #define __darwin_arm_thread_state64_set_pc_fptr(ts, fptr) \
382 ((ts).pc = (uintptr_t)(fptr))
383 /* Return lr field of arm_thread_state64_t as a data pointer value */
384 #define __darwin_arm_thread_state64_get_lr(ts) \
386 /* Return lr field of arm_thread_state64_t as a function pointer */
387 #define __darwin_arm_thread_state64_get_lr_fptr(ts) \
388 ((void*)(uintptr_t)((ts).lr))
389 /* Set lr field of arm_thread_state64_t to a function pointer */
390 #define __darwin_arm_thread_state64_set_lr_fptr(ts, fptr) \
391 ((ts).lr = (uintptr_t)(fptr))
392 /* Return sp field of arm_thread_state64_t as a data pointer value */
393 #define __darwin_arm_thread_state64_get_sp(ts) \
395 /* Set sp field of arm_thread_state64_t to a data pointer value */
396 #define __darwin_arm_thread_state64_set_sp(ts, ptr) \
397 ((ts).sp = (uintptr_t)(ptr))
398 /* Return fp field of arm_thread_state64_t as a data pointer value */
399 #define __darwin_arm_thread_state64_get_fp(ts) \
401 /* Set fp field of arm_thread_state64_t to a data pointer value */
402 #define __darwin_arm_thread_state64_set_fp(ts, ptr) \
403 ((ts).fp = (uintptr_t)(ptr))
405 #endif /* __DARWIN_UNIX03 */
406 #endif /* __DARWIN_OPAQUE_ARM_THREAD_STATE64 */
408 #endif /* __has_feature(ptrauth_calls) && defined(__LP64__) */
409 #endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL && defined(__arm64__) */
410 #endif /* !defined(KERNEL) */
413 #define _STRUCT_ARM_VFP_STATE struct __darwin_arm_vfp_state
414 _STRUCT_ARM_VFP_STATE
419 #else /* !__DARWIN_UNIX03 */
420 #define _STRUCT_ARM_VFP_STATE struct arm_vfp_state
421 _STRUCT_ARM_VFP_STATE
426 #endif /* __DARWIN_UNIX03 */
429 #define _STRUCT_ARM_NEON_STATE64 struct __darwin_arm_neon_state64
430 #define _STRUCT_ARM_NEON_STATE struct __darwin_arm_neon_state
432 #if defined(__arm64__)
433 _STRUCT_ARM_NEON_STATE64
440 _STRUCT_ARM_NEON_STATE
446 #elif defined(__arm__)
448 * No 128-bit intrinsic for ARM; leave it opaque for now.
450 _STRUCT_ARM_NEON_STATE64
452 char opaque
[(32 * 16) + (2 * sizeof(__uint32_t
))];
453 } __attribute__((aligned(16)));
455 _STRUCT_ARM_NEON_STATE
457 char opaque
[(16 * 16) + (2 * sizeof(__uint32_t
))];
458 } __attribute__((aligned(16)));
461 #error Unknown architecture.
464 #else /* !__DARWIN_UNIX03 */
465 #define _STRUCT_ARM_NEON_STATE64 struct arm_neon_state64
466 #define _STRUCT_ARM_NEON_STATE struct arm_neon_state
468 #if defined(__arm64__)
469 _STRUCT_ARM_NEON_STATE64
476 _STRUCT_ARM_NEON_STATE
482 #elif defined(__arm__)
484 * No 128-bit intrinsic for ARM; leave it opaque for now.
486 _STRUCT_ARM_NEON_STATE64
488 char opaque
[(32 * 16) + (2 * sizeof(__uint32_t
))];
489 } __attribute__((aligned(16)));
491 _STRUCT_ARM_NEON_STATE
493 char opaque
[(16 * 16) + (2 * sizeof(__uint32_t
))];
494 } __attribute__((aligned(16)));
497 #error Unknown architecture.
500 #endif /* __DARWIN_UNIX03 */
503 #define _STRUCT_ARM_PAGEIN_STATE struct __arm_pagein_state
504 _STRUCT_ARM_PAGEIN_STATE
513 /* Old-fashioned debug state is only for ARM */
516 #define _STRUCT_ARM_DEBUG_STATE struct __darwin_arm_debug_state
517 _STRUCT_ARM_DEBUG_STATE
519 __uint32_t __bvr
[16];
520 __uint32_t __bcr
[16];
521 __uint32_t __wvr
[16];
522 __uint32_t __wcr
[16];
524 #else /* !__DARWIN_UNIX03 */
525 #define _STRUCT_ARM_DEBUG_STATE struct arm_debug_state
526 _STRUCT_ARM_DEBUG_STATE
533 #endif /* __DARWIN_UNIX03 */
535 #elif defined(__arm64__)
537 /* ARM's arm_debug_state is ARM64's arm_legacy_debug_state */
540 #define _STRUCT_ARM_LEGACY_DEBUG_STATE struct arm_legacy_debug_state
541 _STRUCT_ARM_LEGACY_DEBUG_STATE
543 __uint32_t __bvr
[16];
544 __uint32_t __bcr
[16];
545 __uint32_t __wvr
[16];
546 __uint32_t __wcr
[16];
548 #else /* __DARWIN_UNIX03 */
549 #define _STRUCT_ARM_LEGACY_DEBUG_STATE struct arm_legacy_debug_state
550 _STRUCT_ARM_LEGACY_DEBUG_STATE
557 #endif /* __DARWIN_UNIX03 */
559 #error unknown architecture
563 #define _STRUCT_ARM_DEBUG_STATE32 struct __darwin_arm_debug_state32
564 _STRUCT_ARM_DEBUG_STATE32
566 __uint32_t __bvr
[16];
567 __uint32_t __bcr
[16];
568 __uint32_t __wvr
[16];
569 __uint32_t __wcr
[16];
570 __uint64_t __mdscr_el1
; /* Bit 0 is SS (Hardware Single Step) */
573 #define _STRUCT_ARM_DEBUG_STATE64 struct __darwin_arm_debug_state64
574 _STRUCT_ARM_DEBUG_STATE64
576 __uint64_t __bvr
[16];
577 __uint64_t __bcr
[16];
578 __uint64_t __wvr
[16];
579 __uint64_t __wcr
[16];
580 __uint64_t __mdscr_el1
; /* Bit 0 is SS (Hardware Single Step) */
582 #else /* !__DARWIN_UNIX03 */
583 #define _STRUCT_ARM_DEBUG_STATE32 struct arm_debug_state32
584 _STRUCT_ARM_DEBUG_STATE32
590 __uint64_t mdscr_el1
; /* Bit 0 is SS (Hardware Single Step) */
593 #define _STRUCT_ARM_DEBUG_STATE64 struct arm_debug_state64
594 _STRUCT_ARM_DEBUG_STATE64
600 __uint64_t mdscr_el1
; /* Bit 0 is SS (Hardware Single Step) */
602 #endif /* __DARWIN_UNIX03 */
605 #define _STRUCT_ARM_CPMU_STATE64 struct __darwin_arm_cpmu_state64
606 _STRUCT_ARM_CPMU_STATE64
608 __uint64_t __ctrs
[16];
610 #else /* __DARWIN_UNIX03 */
611 #define _STRUCT_ARM_CPMU_STATE64 struct arm_cpmu_state64
612 _STRUCT_ARM_CPMU_STATE64
616 #endif /* !__DARWIN_UNIX03 */
618 #endif /* _MACH_ARM__STRUCTS_H_ */