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(_STRUCT_X86_AVX512_STATE32)
55 #define _STRUCT_MCONTEXT_AVX512_32 struct __darwin_mcontext_avx512_32
56 _STRUCT_MCONTEXT_AVX512_32
58 _STRUCT_X86_EXCEPTION_STATE32 __es
;
59 _STRUCT_X86_THREAD_STATE32 __ss
;
60 _STRUCT_X86_AVX512_STATE32 __fs
;
62 #endif /* _STRUCT_X86_AVX512_STATE32 */
64 #else /* !__DARWIN_UNIX03 */
65 #define _STRUCT_MCONTEXT32 struct mcontext32
68 _STRUCT_X86_EXCEPTION_STATE32 es
;
69 _STRUCT_X86_THREAD_STATE32 ss
;
70 _STRUCT_X86_FLOAT_STATE32 fs
;
73 #define _STRUCT_MCONTEXT_AVX32 struct mcontext_avx32
74 _STRUCT_MCONTEXT_AVX32
76 _STRUCT_X86_EXCEPTION_STATE32 es
;
77 _STRUCT_X86_THREAD_STATE32 ss
;
78 _STRUCT_X86_AVX_STATE32 fs
;
81 #if defined(_STRUCT_X86_AVX512_STATE32)
82 #define _STRUCT_MCONTEXT_AVX512_32 struct mcontext_avx512_32
83 _STRUCT_MCONTEXT_AVX512_32
85 _STRUCT_X86_EXCEPTION_STATE32 es
;
86 _STRUCT_X86_THREAD_STATE32 ss
;
87 _STRUCT_X86_AVX512_STATE32 fs
;
89 #endif /* _STRUCT_X86_AVX512_STATE32 */
91 #endif /* __DARWIN_UNIX03 */
92 #endif /* _STRUCT_MCONTEXT32 */
94 #ifndef _STRUCT_MCONTEXT64
96 #define _STRUCT_MCONTEXT64 struct __darwin_mcontext64
99 _STRUCT_X86_EXCEPTION_STATE64 __es
;
100 _STRUCT_X86_THREAD_STATE64 __ss
;
101 _STRUCT_X86_FLOAT_STATE64 __fs
;
104 #define _STRUCT_MCONTEXT64_FULL struct __darwin_mcontext64_full
105 _STRUCT_MCONTEXT64_FULL
107 _STRUCT_X86_EXCEPTION_STATE64 __es
;
108 _STRUCT_X86_THREAD_FULL_STATE64 __ss
;
109 _STRUCT_X86_FLOAT_STATE64 __fs
;
112 #define _STRUCT_MCONTEXT_AVX64 struct __darwin_mcontext_avx64
113 _STRUCT_MCONTEXT_AVX64
115 _STRUCT_X86_EXCEPTION_STATE64 __es
;
116 _STRUCT_X86_THREAD_STATE64 __ss
;
117 _STRUCT_X86_AVX_STATE64 __fs
;
120 #define _STRUCT_MCONTEXT_AVX64_FULL struct __darwin_mcontext_avx64_full
121 _STRUCT_MCONTEXT_AVX64_FULL
123 _STRUCT_X86_EXCEPTION_STATE64 __es
;
124 _STRUCT_X86_THREAD_FULL_STATE64 __ss
;
125 _STRUCT_X86_AVX_STATE64 __fs
;
128 #if defined(_STRUCT_X86_AVX512_STATE64)
129 #define _STRUCT_MCONTEXT_AVX512_64 struct __darwin_mcontext_avx512_64
130 _STRUCT_MCONTEXT_AVX512_64
132 _STRUCT_X86_EXCEPTION_STATE64 __es
;
133 _STRUCT_X86_THREAD_STATE64 __ss
;
134 _STRUCT_X86_AVX512_STATE64 __fs
;
137 #define _STRUCT_MCONTEXT_AVX512_64_FULL struct __darwin_mcontext_avx512_64_full
138 _STRUCT_MCONTEXT_AVX512_64_FULL
140 _STRUCT_X86_EXCEPTION_STATE64 __es
;
141 _STRUCT_X86_THREAD_FULL_STATE64 __ss
;
142 _STRUCT_X86_AVX512_STATE64 __fs
;
144 #endif /* _STRUCT_X86_AVX512_STATE64 */
146 #else /* !__DARWIN_UNIX03 */
147 #define _STRUCT_MCONTEXT64 struct mcontext64
150 _STRUCT_X86_EXCEPTION_STATE64 es
;
151 _STRUCT_X86_THREAD_STATE64 ss
;
152 _STRUCT_X86_FLOAT_STATE64 fs
;
155 #define _STRUCT_MCONTEXT64_FULL struct mcontext64_full
156 _STRUCT_MCONTEXT64_FULL
158 _STRUCT_X86_EXCEPTION_STATE64 es
;
159 _STRUCT_X86_THREAD_FULL_STATE64 ss
;
160 _STRUCT_X86_FLOAT_STATE64 fs
;
163 #define _STRUCT_MCONTEXT_AVX64 struct mcontext_avx64
164 _STRUCT_MCONTEXT_AVX64
166 _STRUCT_X86_EXCEPTION_STATE64 es
;
167 _STRUCT_X86_THREAD_STATE64 ss
;
168 _STRUCT_X86_AVX_STATE64 fs
;
171 #define _STRUCT_MCONTEXT_AVX64_FULL struct mcontext_avx64_full
172 _STRUCT_MCONTEXT_AVX64_FULL
174 _STRUCT_X86_EXCEPTION_STATE64 es
;
175 _STRUCT_X86_THREAD_FULL_STATE64 ss
;
176 _STRUCT_X86_AVX_STATE64 fs
;
179 #if defined(_STRUCT_X86_AVX512_STATE64)
180 #define _STRUCT_MCONTEXT_AVX512_64 struct mcontext_avx512_64
181 _STRUCT_MCONTEXT_AVX512_64
183 _STRUCT_X86_EXCEPTION_STATE64 es
;
184 _STRUCT_X86_THREAD_STATE64 ss
;
185 _STRUCT_X86_AVX512_STATE64 fs
;
188 #define _STRUCT_MCONTEXT_AVX512_64_FULL struct mcontext_avx512_64_full
189 _STRUCT_MCONTEXT_AVX512_64_FULL
191 _STRUCT_X86_EXCEPTION_STATE64 es
;
192 _STRUCT_X86_THREAD_FULL_STATE64 ss
;
193 _STRUCT_X86_AVX512_STATE64 fs
;
195 #endif /* _STRUCT_X86_AVX512_STATE64 */
197 #endif /* __DARWIN_UNIX03 */
198 #endif /* _STRUCT_MCONTEXT64 */
203 #if defined(__LP64__)
204 typedef _STRUCT_MCONTEXT64
*mcontext_t
;
205 #define _STRUCT_MCONTEXT _STRUCT_MCONTEXT64
207 typedef _STRUCT_MCONTEXT32
*mcontext_t
;
208 #define _STRUCT_MCONTEXT _STRUCT_MCONTEXT32
210 #endif /* _MCONTEXT_T */
212 #endif /* __I386_MCONTEXT_H_ */