2 * Copyright (c) 2003-2012 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@
29 #ifndef __I386_MCONTEXT_H_
30 #define __I386_MCONTEXT_H_
32 #include <sys/cdefs.h> /* __DARWIN_UNIX03 */
33 #include <sys/appleapiopts.h>
34 #include <mach/machine/_structs.h>
36 #ifndef _STRUCT_MCONTEXT32
38 #define _STRUCT_MCONTEXT32 struct __darwin_mcontext32
41 _STRUCT_X86_EXCEPTION_STATE32 __es
;
42 _STRUCT_X86_THREAD_STATE32 __ss
;
43 _STRUCT_X86_FLOAT_STATE32 __fs
;
46 #define _STRUCT_MCONTEXT_AVX32 struct __darwin_mcontext_avx32
47 _STRUCT_MCONTEXT_AVX32
49 _STRUCT_X86_EXCEPTION_STATE32 __es
;
50 _STRUCT_X86_THREAD_STATE32 __ss
;
51 _STRUCT_X86_AVX_STATE32 __fs
;
54 #if !defined(RC_HIDE_XNU_J137)
55 #if defined(_STRUCT_X86_AVX512_STATE32)
56 #define _STRUCT_MCONTEXT_AVX512_32 struct __darwin_mcontext_avx512_32
57 _STRUCT_MCONTEXT_AVX512_32
59 _STRUCT_X86_EXCEPTION_STATE32 __es
;
60 _STRUCT_X86_THREAD_STATE32 __ss
;
61 _STRUCT_X86_AVX512_STATE32 __fs
;
63 #endif /* _STRUCT_X86_AVX512_STATE32 */
64 #endif /* RC_HIDE_XNU_J137 */
66 #else /* !__DARWIN_UNIX03 */
67 #define _STRUCT_MCONTEXT32 struct mcontext32
70 _STRUCT_X86_EXCEPTION_STATE32 es
;
71 _STRUCT_X86_THREAD_STATE32 ss
;
72 _STRUCT_X86_FLOAT_STATE32 fs
;
75 #define _STRUCT_MCONTEXT_AVX32 struct mcontext_avx32
76 _STRUCT_MCONTEXT_AVX32
78 _STRUCT_X86_EXCEPTION_STATE32 es
;
79 _STRUCT_X86_THREAD_STATE32 ss
;
80 _STRUCT_X86_AVX_STATE32 fs
;
83 #if !defined(RC_HIDE_XNU_J137)
84 #if defined(_STRUCT_X86_AVX512_STATE32)
85 #define _STRUCT_MCONTEXT_AVX512_32 struct mcontext_avx512_32
86 _STRUCT_MCONTEXT_AVX512_32
88 _STRUCT_X86_EXCEPTION_STATE32 es
;
89 _STRUCT_X86_THREAD_STATE32 ss
;
90 _STRUCT_X86_AVX512_STATE32 fs
;
92 #endif /* _STRUCT_X86_AVX512_STATE32 */
93 #endif /* RC_HIDE_XNU_J137 */
95 #endif /* __DARWIN_UNIX03 */
96 #endif /* _STRUCT_MCONTEXT32 */
98 #ifndef _STRUCT_MCONTEXT64
100 #define _STRUCT_MCONTEXT64 struct __darwin_mcontext64
103 _STRUCT_X86_EXCEPTION_STATE64 __es
;
104 _STRUCT_X86_THREAD_STATE64 __ss
;
105 _STRUCT_X86_FLOAT_STATE64 __fs
;
108 #define _STRUCT_MCONTEXT_AVX64 struct __darwin_mcontext_avx64
109 _STRUCT_MCONTEXT_AVX64
111 _STRUCT_X86_EXCEPTION_STATE64 __es
;
112 _STRUCT_X86_THREAD_STATE64 __ss
;
113 _STRUCT_X86_AVX_STATE64 __fs
;
116 #if !defined(RC_HIDE_XNU_J137)
117 #if defined(_STRUCT_X86_AVX512_STATE64)
118 #define _STRUCT_MCONTEXT_AVX512_64 struct __darwin_mcontext_avx512_64
119 _STRUCT_MCONTEXT_AVX512_64
121 _STRUCT_X86_EXCEPTION_STATE64 __es
;
122 _STRUCT_X86_THREAD_STATE64 __ss
;
123 _STRUCT_X86_AVX512_STATE64 __fs
;
125 #endif /* _STRUCT_X86_AVX512_STATE64 */
126 #endif /* RC_HIDE_XNU_J137 */
128 #else /* !__DARWIN_UNIX03 */
129 #define _STRUCT_MCONTEXT64 struct mcontext64
132 _STRUCT_X86_EXCEPTION_STATE64 es
;
133 _STRUCT_X86_THREAD_STATE64 ss
;
134 _STRUCT_X86_FLOAT_STATE64 fs
;
137 #define _STRUCT_MCONTEXT_AVX64 struct mcontext_avx64
138 _STRUCT_MCONTEXT_AVX64
140 _STRUCT_X86_EXCEPTION_STATE64 es
;
141 _STRUCT_X86_THREAD_STATE64 ss
;
142 _STRUCT_X86_AVX_STATE64 fs
;
145 #if !defined(RC_HIDE_XNU_J137)
146 #if defined(_STRUCT_X86_AVX512_STATE64)
147 #define _STRUCT_MCONTEXT_AVX512_64 struct mcontext_avx512_64
148 _STRUCT_MCONTEXT_AVX512_64
150 _STRUCT_X86_EXCEPTION_STATE64 es
;
151 _STRUCT_X86_THREAD_STATE64 ss
;
152 _STRUCT_X86_AVX512_STATE64 fs
;
154 #endif /* _STRUCT_X86_AVX512_STATE64 */
155 #endif /* RC_HIDE_XNU_J137 */
157 #endif /* __DARWIN_UNIX03 */
158 #endif /* _STRUCT_MCONTEXT64 */
163 #if defined(__LP64__)
164 typedef _STRUCT_MCONTEXT64
*mcontext_t
;
165 #define _STRUCT_MCONTEXT _STRUCT_MCONTEXT64
167 typedef _STRUCT_MCONTEXT32
*mcontext_t
;
168 #define _STRUCT_MCONTEXT _STRUCT_MCONTEXT32
170 #endif /* _MCONTEXT_T */
172 #endif /* __I386_MCONTEXT_H_ */