]> git.saurik.com Git - apple/xnu.git/blob - bsd/i386/_mcontext.h
xnu-4570.71.2.tar.gz
[apple/xnu.git] / bsd / i386 / _mcontext.h
1 /*
2 * Copyright (c) 2003-2012 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 #ifndef __I386_MCONTEXT_H_
30 #define __I386_MCONTEXT_H_
31
32 #include <sys/cdefs.h> /* __DARWIN_UNIX03 */
33 #include <sys/appleapiopts.h>
34 #include <mach/machine/_structs.h>
35
36 #ifndef _STRUCT_MCONTEXT32
37 #if __DARWIN_UNIX03
38 #define _STRUCT_MCONTEXT32 struct __darwin_mcontext32
39 _STRUCT_MCONTEXT32
40 {
41 _STRUCT_X86_EXCEPTION_STATE32 __es;
42 _STRUCT_X86_THREAD_STATE32 __ss;
43 _STRUCT_X86_FLOAT_STATE32 __fs;
44 };
45
46 #define _STRUCT_MCONTEXT_AVX32 struct __darwin_mcontext_avx32
47 _STRUCT_MCONTEXT_AVX32
48 {
49 _STRUCT_X86_EXCEPTION_STATE32 __es;
50 _STRUCT_X86_THREAD_STATE32 __ss;
51 _STRUCT_X86_AVX_STATE32 __fs;
52 };
53
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
58 {
59 _STRUCT_X86_EXCEPTION_STATE32 __es;
60 _STRUCT_X86_THREAD_STATE32 __ss;
61 _STRUCT_X86_AVX512_STATE32 __fs;
62 };
63 #endif /* _STRUCT_X86_AVX512_STATE32 */
64 #endif /* RC_HIDE_XNU_J137 */
65
66 #else /* !__DARWIN_UNIX03 */
67 #define _STRUCT_MCONTEXT32 struct mcontext32
68 _STRUCT_MCONTEXT32
69 {
70 _STRUCT_X86_EXCEPTION_STATE32 es;
71 _STRUCT_X86_THREAD_STATE32 ss;
72 _STRUCT_X86_FLOAT_STATE32 fs;
73 };
74
75 #define _STRUCT_MCONTEXT_AVX32 struct mcontext_avx32
76 _STRUCT_MCONTEXT_AVX32
77 {
78 _STRUCT_X86_EXCEPTION_STATE32 es;
79 _STRUCT_X86_THREAD_STATE32 ss;
80 _STRUCT_X86_AVX_STATE32 fs;
81 };
82
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
87 {
88 _STRUCT_X86_EXCEPTION_STATE32 es;
89 _STRUCT_X86_THREAD_STATE32 ss;
90 _STRUCT_X86_AVX512_STATE32 fs;
91 };
92 #endif /* _STRUCT_X86_AVX512_STATE32 */
93 #endif /* RC_HIDE_XNU_J137 */
94
95 #endif /* __DARWIN_UNIX03 */
96 #endif /* _STRUCT_MCONTEXT32 */
97
98 #ifndef _STRUCT_MCONTEXT64
99 #if __DARWIN_UNIX03
100 #define _STRUCT_MCONTEXT64 struct __darwin_mcontext64
101 _STRUCT_MCONTEXT64
102 {
103 _STRUCT_X86_EXCEPTION_STATE64 __es;
104 _STRUCT_X86_THREAD_STATE64 __ss;
105 _STRUCT_X86_FLOAT_STATE64 __fs;
106 };
107
108 #define _STRUCT_MCONTEXT_AVX64 struct __darwin_mcontext_avx64
109 _STRUCT_MCONTEXT_AVX64
110 {
111 _STRUCT_X86_EXCEPTION_STATE64 __es;
112 _STRUCT_X86_THREAD_STATE64 __ss;
113 _STRUCT_X86_AVX_STATE64 __fs;
114 };
115
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
120 {
121 _STRUCT_X86_EXCEPTION_STATE64 __es;
122 _STRUCT_X86_THREAD_STATE64 __ss;
123 _STRUCT_X86_AVX512_STATE64 __fs;
124 };
125 #endif /* _STRUCT_X86_AVX512_STATE64 */
126 #endif /* RC_HIDE_XNU_J137 */
127
128 #else /* !__DARWIN_UNIX03 */
129 #define _STRUCT_MCONTEXT64 struct mcontext64
130 _STRUCT_MCONTEXT64
131 {
132 _STRUCT_X86_EXCEPTION_STATE64 es;
133 _STRUCT_X86_THREAD_STATE64 ss;
134 _STRUCT_X86_FLOAT_STATE64 fs;
135 };
136
137 #define _STRUCT_MCONTEXT_AVX64 struct mcontext_avx64
138 _STRUCT_MCONTEXT_AVX64
139 {
140 _STRUCT_X86_EXCEPTION_STATE64 es;
141 _STRUCT_X86_THREAD_STATE64 ss;
142 _STRUCT_X86_AVX_STATE64 fs;
143 };
144
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
149 {
150 _STRUCT_X86_EXCEPTION_STATE64 es;
151 _STRUCT_X86_THREAD_STATE64 ss;
152 _STRUCT_X86_AVX512_STATE64 fs;
153 };
154 #endif /* _STRUCT_X86_AVX512_STATE64 */
155 #endif /* RC_HIDE_XNU_J137 */
156
157 #endif /* __DARWIN_UNIX03 */
158 #endif /* _STRUCT_MCONTEXT64 */
159
160
161 #ifndef _MCONTEXT_T
162 #define _MCONTEXT_T
163 #if defined(__LP64__)
164 typedef _STRUCT_MCONTEXT64 *mcontext_t;
165 #define _STRUCT_MCONTEXT _STRUCT_MCONTEXT64
166 #else
167 typedef _STRUCT_MCONTEXT32 *mcontext_t;
168 #define _STRUCT_MCONTEXT _STRUCT_MCONTEXT32
169 #endif
170 #endif /* _MCONTEXT_T */
171
172 #endif /* __I386_MCONTEXT_H_ */