Root/
Source at commit 1146 created 12 years 11 months ago. By azimutz, Sync with trunk (r1145). Add nVidia dev id's, 0DF4 for "GeForce GT 450M" (issue 99) and 1251 for "GeForce GTX 560M" (thanks to oSxFr33k for testing). | |
---|---|
1 | /*␊ |
2 | * Copyright (c) 2000-2006 Apple Computer, 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 | /* ␊ |
32 | * Mach Operating System␊ |
33 | * Copyright (c) 1991,1990,1989 Carnegie Mellon University␊ |
34 | * All Rights Reserved.␊ |
35 | * ␊ |
36 | * Permission to use, copy, modify and distribute this software and its␊ |
37 | * documentation is hereby granted, provided that both the copyright␊ |
38 | * notice and this permission notice appear in all copies of the␊ |
39 | * software, derivative works or modified versions, and any portions␊ |
40 | * thereof, and that both notices appear in supporting documentation.␊ |
41 | * ␊ |
42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"␊ |
43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR␊ |
44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.␊ |
45 | * ␊ |
46 | * Carnegie Mellon requests users of this software to return to␊ |
47 | * ␊ |
48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU␊ |
49 | * School of Computer Science␊ |
50 | * Carnegie Mellon University␊ |
51 | * Pittsburgh PA 15213-3890␊ |
52 | * ␊ |
53 | * any improvements or extensions that they make and grant Carnegie Mellon␊ |
54 | * the rights to redistribute these changes.␊ |
55 | */␊ |
56 | /*␊ |
57 | */␊ |
58 | /*␊ |
59 | *␉File:␉thread_status.h␊ |
60 | *␉Author:␉Avadis Tevanian, Jr.␊ |
61 | *␉Date:␉1985␊ |
62 | *␊ |
63 | *␉This file contains the structure definitions for the thread␊ |
64 | *␉state as applied to I386 processors.␊ |
65 | */␊ |
66 | ␊ |
67 | #ifndef␉_MACH_I386_THREAD_STATUS_H_␊ |
68 | #define _MACH_I386_THREAD_STATUS_H_␊ |
69 | ␊ |
70 | #include <mach/i386/_structs.h>␊ |
71 | #include <mach/message.h>␊ |
72 | #include <mach/i386/fp_reg.h>␊ |
73 | #include <mach/i386/thread_state.h>␊ |
74 | #include <i386/eflags.h>␊ |
75 | ␊ |
76 | /*␊ |
77 | * the i386_xxxx form is kept for legacy purposes since these types␊ |
78 | * are externally known... eventually they should be deprecated.␊ |
79 | * our internal implementation has moved to the following naming convention␊ |
80 | *␊ |
81 | * x86_xxxx32 names are used to deal with 32 bit states␊ |
82 | * x86_xxxx64 names are used to deal with 64 bit states␊ |
83 | * x86_xxxx names are used to deal with either 32 or 64 bit states␊ |
84 | *␉via a self-describing mechanism␊ |
85 | */␊ |
86 | ␊ |
87 | /*␊ |
88 | * these are the legacy names which should be deprecated in the future␊ |
89 | * they are externally known which is the only reason we don't just get␊ |
90 | * rid of them␊ |
91 | */␊ |
92 | #define i386_THREAD_STATE␉␉1␊ |
93 | #define i386_FLOAT_STATE␉␉2␊ |
94 | #define i386_EXCEPTION_STATE␉␉3␊ |
95 | ␊ |
96 | /*␊ |
97 | * THREAD_STATE_FLAVOR_LIST 0␊ |
98 | * ␉these are the supported flavors␊ |
99 | */␊ |
100 | #define x86_THREAD_STATE32␉␉1␊ |
101 | #define x86_FLOAT_STATE32␉␉2␊ |
102 | #define x86_EXCEPTION_STATE32␉␉3␊ |
103 | #define x86_THREAD_STATE64␉␉4␊ |
104 | #define x86_FLOAT_STATE64␉␉5␊ |
105 | #define x86_EXCEPTION_STATE64␉␉6␊ |
106 | #define x86_THREAD_STATE␉␉7␊ |
107 | #define x86_FLOAT_STATE␉␉␉8␊ |
108 | #define x86_EXCEPTION_STATE␉␉9␊ |
109 | #define x86_DEBUG_STATE32␉␉10␊ |
110 | #define x86_DEBUG_STATE64␉␉11␊ |
111 | #define x86_DEBUG_STATE␉␉␉12␊ |
112 | #define THREAD_STATE_NONE␉␉13␊ |
113 | ␊ |
114 | /*␊ |
115 | * Largest state on this machine:␊ |
116 | * (be sure mach/machine/thread_state.h matches!)␊ |
117 | */␊ |
118 | #define THREAD_MACHINE_STATE_MAX␉THREAD_STATE_MAX␊ |
119 | ␊ |
120 | /*␊ |
121 | * VALID_THREAD_STATE_FLAVOR is a platform specific macro that when passed␊ |
122 | * an exception flavor will return if that is a defined flavor for that␊ |
123 | * platform. The macro must be manually updated to include all of the valid␊ |
124 | * exception flavors as defined above.␊ |
125 | */␊ |
126 | #define VALID_THREAD_STATE_FLAVOR(x) \␊ |
127 | ␉ ((x == x86_THREAD_STATE32)␉|| \␊ |
128 | ␉ (x == x86_FLOAT_STATE32)␉|| \␊ |
129 | ␉ (x == x86_EXCEPTION_STATE32)␉|| \␊ |
130 | ␉ (x == x86_DEBUG_STATE32)␉|| \␊ |
131 | ␉ (x == x86_THREAD_STATE64)␉|| \␊ |
132 | ␉ (x == x86_FLOAT_STATE64)␉|| \␊ |
133 | ␉ (x == x86_EXCEPTION_STATE64)␉|| \␊ |
134 | ␉ (x == x86_DEBUG_STATE64)␉|| \␊ |
135 | ␉ (x == x86_THREAD_STATE)␉|| \␊ |
136 | ␉ (x == x86_FLOAT_STATE)␉|| \␊ |
137 | ␉ (x == x86_EXCEPTION_STATE)␉|| \␊ |
138 | ␉ (x == x86_DEBUG_STATE)␉|| \␊ |
139 | ␉ (x == THREAD_STATE_NONE))␊ |
140 | ␊ |
141 | struct x86_state_hdr {␊ |
142 | ␉int␉flavor;␊ |
143 | ␉int␉count;␊ |
144 | };␊ |
145 | typedef struct x86_state_hdr x86_state_hdr_t;␊ |
146 | ␊ |
147 | /*␊ |
148 | * Default segment register values.␊ |
149 | */␊ |
150 | ␊ |
151 | #define USER_CODE_SELECTOR␉0x0017␊ |
152 | #define USER_DATA_SELECTOR␉0x001f␊ |
153 | #define KERN_CODE_SELECTOR␉0x0008␊ |
154 | #define KERN_DATA_SELECTOR␉0x0010␊ |
155 | ␊ |
156 | /*␊ |
157 | * to be deprecated in the future␊ |
158 | */␊ |
159 | typedef _STRUCT_X86_THREAD_STATE32 i386_thread_state_t;␊ |
160 | #define i386_THREAD_STATE_COUNT␉((mach_msg_type_number_t) \␊ |
161 | ( sizeof (i386_thread_state_t) / sizeof (int) ))␊ |
162 | ␊ |
163 | typedef _STRUCT_X86_THREAD_STATE32 x86_thread_state32_t;␊ |
164 | #define x86_THREAD_STATE32_COUNT␉((mach_msg_type_number_t) \␊ |
165 | ( sizeof (x86_thread_state32_t) / sizeof (int) ))␊ |
166 | ␊ |
167 | /*␊ |
168 | * to be deprecated in the future␊ |
169 | */␊ |
170 | typedef _STRUCT_X86_FLOAT_STATE32 i386_float_state_t;␊ |
171 | #define i386_FLOAT_STATE_COUNT ((mach_msg_type_number_t) \␊ |
172 | ␉␉(sizeof(i386_float_state_t)/sizeof(unsigned int)))␊ |
173 | ␊ |
174 | typedef _STRUCT_X86_FLOAT_STATE32 x86_float_state32_t;␊ |
175 | #define x86_FLOAT_STATE32_COUNT ((mach_msg_type_number_t) \␊ |
176 | ␉␉(sizeof(x86_float_state32_t)/sizeof(unsigned int)))␊ |
177 | ␊ |
178 | /*␊ |
179 | * to be deprecated in the future␊ |
180 | */␊ |
181 | typedef _STRUCT_X86_EXCEPTION_STATE32 i386_exception_state_t;␊ |
182 | #define i386_EXCEPTION_STATE_COUNT␉((mach_msg_type_number_t) \␊ |
183 | ( sizeof (i386_exception_state_t) / sizeof (int) ))␊ |
184 | ␊ |
185 | typedef _STRUCT_X86_EXCEPTION_STATE32 x86_exception_state32_t;␊ |
186 | #define x86_EXCEPTION_STATE32_COUNT␉((mach_msg_type_number_t) \␊ |
187 | ( sizeof (x86_exception_state32_t) / sizeof (int) ))␊ |
188 | ␊ |
189 | #define I386_EXCEPTION_STATE_COUNT i386_EXCEPTION_STATE_COUNT␊ |
190 | ␊ |
191 | typedef _STRUCT_X86_DEBUG_STATE32 x86_debug_state32_t;␊ |
192 | #define x86_DEBUG_STATE32_COUNT ((mach_msg_type_number_t) \␊ |
193 | ␉( sizeof (x86_debug_state32_t) / sizeof (int) ))␊ |
194 | ␊ |
195 | #define X86_DEBUG_STATE32_COUNT x86_DEBUG_STATE32_COUNT␊ |
196 | ␊ |
197 | typedef _STRUCT_X86_THREAD_STATE64 x86_thread_state64_t;␊ |
198 | #define x86_THREAD_STATE64_COUNT␉((mach_msg_type_number_t) \␊ |
199 | ( sizeof (x86_thread_state64_t) / sizeof (int) ))␊ |
200 | ␊ |
201 | typedef _STRUCT_X86_FLOAT_STATE64 x86_float_state64_t;␊ |
202 | #define x86_FLOAT_STATE64_COUNT ((mach_msg_type_number_t) \␊ |
203 | ␉␉(sizeof(x86_float_state64_t)/sizeof(unsigned int)))␊ |
204 | ␉␉␊ |
205 | typedef _STRUCT_X86_EXCEPTION_STATE64 x86_exception_state64_t;␊ |
206 | #define x86_EXCEPTION_STATE64_COUNT␉((mach_msg_type_number_t) \␊ |
207 | ( sizeof (x86_exception_state64_t) / sizeof (int) ))␊ |
208 | ␊ |
209 | #define X86_EXCEPTION_STATE64_COUNT x86_EXCEPTION_STATE64_COUNT␊ |
210 | ␊ |
211 | typedef _STRUCT_X86_DEBUG_STATE64 x86_debug_state64_t;␊ |
212 | #define x86_DEBUG_STATE64_COUNT␉((mach_msg_type_number_t) \␊ |
213 | ( sizeof (x86_debug_state64_t) / sizeof (int) ))␊ |
214 | ␊ |
215 | #define X86_DEBUG_STATE64_COUNT x86_DEBUG_STATE64_COUNT␊ |
216 | ␊ |
217 | /*␊ |
218 | * Combined thread, float and exception states␊ |
219 | */␊ |
220 | struct x86_thread_state {␊ |
221 | ␉x86_state_hdr_t␉␉␉tsh;␊ |
222 | ␉union {␊ |
223 | ␉ x86_thread_state32_t␉ts32;␊ |
224 | ␉ x86_thread_state64_t␉ts64;␊ |
225 | ␉} uts;␊ |
226 | };␊ |
227 | ␊ |
228 | struct x86_float_state {␊ |
229 | ␉x86_state_hdr_t␉␉␉fsh;␊ |
230 | ␉union {␊ |
231 | ␉␉x86_float_state32_t␉fs32;␊ |
232 | ␉␉x86_float_state64_t␉fs64;␊ |
233 | ␉} ufs;␊ |
234 | };␊ |
235 | ␊ |
236 | struct x86_exception_state {␊ |
237 | ␉x86_state_hdr_t␉␉␉esh;␊ |
238 | ␉union {␊ |
239 | ␉␉x86_exception_state32_t␉es32;␊ |
240 | ␉␉x86_exception_state64_t␉es64;␊ |
241 | ␉} ues;␊ |
242 | };␊ |
243 | ␊ |
244 | struct x86_debug_state {␊ |
245 | ␉x86_state_hdr_t␉␉␉dsh;␊ |
246 | ␉union {␊ |
247 | ␉␉x86_debug_state32_t␉ds32;␊ |
248 | ␉␉x86_debug_state64_t␉ds64;␊ |
249 | ␉} uds;␊ |
250 | };␊ |
251 | ␊ |
252 | typedef struct x86_thread_state x86_thread_state_t;␊ |
253 | #define x86_THREAD_STATE_COUNT␉((mach_msg_type_number_t) \␊ |
254 | ␉␉( sizeof (x86_thread_state_t) / sizeof (int) ))␊ |
255 | ␊ |
256 | typedef struct x86_float_state x86_float_state_t;␊ |
257 | #define x86_FLOAT_STATE_COUNT ((mach_msg_type_number_t) \␊ |
258 | ␉␉(sizeof(x86_float_state_t)/sizeof(unsigned int)))␊ |
259 | ␊ |
260 | typedef struct x86_exception_state x86_exception_state_t;␊ |
261 | #define x86_EXCEPTION_STATE_COUNT ((mach_msg_type_number_t) \␊ |
262 | ␉␉(sizeof(x86_exception_state_t)/sizeof(unsigned int)))␊ |
263 | ␊ |
264 | typedef struct x86_debug_state x86_debug_state_t;␊ |
265 | #define x86_DEBUG_STATE_COUNT ((mach_msg_type_number_t) \␊ |
266 | ␉␉(sizeof(x86_debug_state_t)/sizeof(unsigned int)))␊ |
267 | ␊ |
268 | /*␊ |
269 | * Machine-independent way for servers and Mach's exception mechanism to␊ |
270 | * choose the most efficient state flavor for exception RPC's:␊ |
271 | */␊ |
272 | #define MACHINE_THREAD_STATE␉␉x86_THREAD_STATE␊ |
273 | #define MACHINE_THREAD_STATE_COUNT␉x86_THREAD_STATE_COUNT␊ |
274 | ␊ |
275 | /*␊ |
276 | * when reloading the segment registers on␊ |
277 | * a return out of the kernel, we may take␊ |
278 | * a GeneralProtection or SegmentNotPresent␊ |
279 | * fault if one or more of the segment␊ |
280 | * registers in the saved state was improperly␊ |
281 | * specified via an x86_THREAD_STATE32 call␊ |
282 | * the frame we push on top of the existing␊ |
283 | * save area looks like this... we need to␊ |
284 | * carry this as part of the save area␊ |
285 | * in case we get hit so that we have a big␊ |
286 | * enough stack␊ |
287 | */␊ |
288 | struct x86_seg_load_fault32 {␊ |
289 | ␉unsigned int trapno;␊ |
290 | ␉unsigned int err;␊ |
291 | ␉unsigned int eip;␊ |
292 | ␉unsigned int cs;␊ |
293 | ␉unsigned int efl;␊ |
294 | };␊ |
295 | ␊ |
296 | ␊ |
297 | #endif␉/* _MACH_I386_THREAD_STATUS_H_ */␊ |
298 |