Chameleon

Chameleon Svn Source Tree

Root/branches/slice/trunkM/i386/include/mach/i386/_structs.h

1/*
2 * Copyright (c) 2004-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#ifndef_MACH_I386__STRUCTS_H_
33#define_MACH_I386__STRUCTS_H_
34
35/*
36 * i386 is the structure that is exported to user threads for
37 * use in status/mutate calls. This structure should never change.
38 *
39 */
40
41#if __DARWIN_UNIX03
42#define_STRUCT_X86_THREAD_STATE32struct __darwin_i386_thread_state
43_STRUCT_X86_THREAD_STATE32
44{
45 unsigned int__eax;
46 unsigned int__ebx;
47 unsigned int__ecx;
48 unsigned int__edx;
49 unsigned int__edi;
50 unsigned int__esi;
51 unsigned int__ebp;
52 unsigned int__esp;
53 unsigned int__ss;
54 unsigned int__eflags;
55 unsigned int__eip;
56 unsigned int__cs;
57 unsigned int__ds;
58 unsigned int__es;
59 unsigned int__fs;
60 unsigned int__gs;
61};
62#else /* !__DARWIN_UNIX03 */
63#define_STRUCT_X86_THREAD_STATE32struct i386_thread_state
64_STRUCT_X86_THREAD_STATE32
65{
66 unsigned inteax;
67 unsigned intebx;
68 unsigned intecx;
69 unsigned intedx;
70 unsigned intedi;
71 unsigned intesi;
72 unsigned intebp;
73 unsigned intesp;
74 unsigned intss;
75 unsigned inteflags;
76 unsigned inteip;
77 unsigned intcs;
78 unsigned intds;
79 unsigned intes;
80 unsigned intfs;
81 unsigned intgs;
82};
83#endif /* !__DARWIN_UNIX03 */
84
85/* This structure should be double-word aligned for performance */
86
87#if __DARWIN_UNIX03
88#define _STRUCT_FP_CONTROLstruct __darwin_fp_control
89_STRUCT_FP_CONTROL
90{
91 unsigned short__invalid:1,
92 __denorm:1,
93__zdiv:1,
94__ovrfl:1,
95__undfl:1,
96__precis:1,
97:2,
98__pc:2,
99#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
100#define FP_PREC_24B0
101#defineFP_PREC_53B2
102#define FP_PREC_64B3
103#endif /* !_POSIX_C_SOURCE || _DARWIN_C_SOURCE */
104__rc:2,
105#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
106#define FP_RND_NEAR0
107#define FP_RND_DOWN1
108#define FP_RND_UP2
109#define FP_CHOP3
110#endif /* !_POSIX_C_SOURCE || _DARWIN_C_SOURCE */
111/*inf*/:1,
112:3;
113};
114typedef _STRUCT_FP_CONTROL__darwin_fp_control_t;
115#else /* !__DARWIN_UNIX03 */
116#define _STRUCT_FP_CONTROLstruct fp_control
117_STRUCT_FP_CONTROL
118{
119 unsigned shortinvalid:1,
120 denorm:1,
121zdiv:1,
122ovrfl:1,
123undfl:1,
124precis:1,
125:2,
126pc:2,
127#define FP_PREC_24B0
128#defineFP_PREC_53B2
129#define FP_PREC_64B3
130rc:2,
131#define FP_RND_NEAR0
132#define FP_RND_DOWN1
133#define FP_RND_UP2
134#define FP_CHOP3
135/*inf*/:1,
136:3;
137};
138typedef _STRUCT_FP_CONTROLfp_control_t;
139#endif /* !__DARWIN_UNIX03 */
140
141/*
142 * Status word.
143 */
144
145#if __DARWIN_UNIX03
146#define _STRUCT_FP_STATUSstruct __darwin_fp_status
147_STRUCT_FP_STATUS
148{
149 unsigned short__invalid:1,
150 __denorm:1,
151__zdiv:1,
152__ovrfl:1,
153__undfl:1,
154__precis:1,
155__stkflt:1,
156__errsumm:1,
157__c0:1,
158__c1:1,
159__c2:1,
160__tos:3,
161__c3:1,
162__busy:1;
163};
164typedef _STRUCT_FP_STATUS__darwin_fp_status_t;
165#else /* !__DARWIN_UNIX03 */
166#define _STRUCT_FP_STATUSstruct fp_status
167_STRUCT_FP_STATUS
168{
169 unsigned shortinvalid:1,
170 denorm:1,
171zdiv:1,
172ovrfl:1,
173undfl:1,
174precis:1,
175stkflt:1,
176errsumm:1,
177c0:1,
178c1:1,
179c2:1,
180tos:3,
181c3:1,
182busy:1;
183};
184typedef _STRUCT_FP_STATUSfp_status_t;
185#endif /* !__DARWIN_UNIX03 */
186
187/* defn of 80bit x87 FPU or MMX register */
188
189#if __DARWIN_UNIX03
190#define _STRUCT_MMST_REGstruct __darwin_mmst_reg
191_STRUCT_MMST_REG
192{
193char__mmst_reg[10];
194char__mmst_rsrv[6];
195};
196#else /* !__DARWIN_UNIX03 */
197#define _STRUCT_MMST_REGstruct mmst_reg
198_STRUCT_MMST_REG
199{
200charmmst_reg[10];
201charmmst_rsrv[6];
202};
203#endif /* !__DARWIN_UNIX03 */
204
205
206/* defn of 128 bit XMM regs */
207
208#if __DARWIN_UNIX03
209#define _STRUCT_XMM_REGstruct __darwin_xmm_reg
210_STRUCT_XMM_REG
211{
212char__xmm_reg[16];
213};
214#else /* !__DARWIN_UNIX03 */
215#define _STRUCT_XMM_REGstruct xmm_reg
216_STRUCT_XMM_REG
217{
218charxmm_reg[16];
219};
220#endif /* !__DARWIN_UNIX03 */
221
222/*
223 * Floating point state.
224 */
225
226#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
227#define FP_STATE_BYTES512/* number of chars worth of data from fpu_fcw */
228#endif /* !_POSIX_C_SOURCE || _DARWIN_C_SOURCE */
229
230#if __DARWIN_UNIX03
231#define_STRUCT_X86_FLOAT_STATE32struct __darwin_i386_float_state
232_STRUCT_X86_FLOAT_STATE32
233{
234int __fpu_reserved[2];
235_STRUCT_FP_CONTROL__fpu_fcw;/* x87 FPU control word */
236_STRUCT_FP_STATUS__fpu_fsw;/* x87 FPU status word */
237__uint8_t__fpu_ftw;/* x87 FPU tag word */
238__uint8_t__fpu_rsrv1;/* reserved */
239__uint16_t__fpu_fop;/* x87 FPU Opcode */
240__uint32_t__fpu_ip;/* x87 FPU Instruction Pointer offset */
241__uint16_t__fpu_cs;/* x87 FPU Instruction Pointer Selector */
242__uint16_t__fpu_rsrv2;/* reserved */
243__uint32_t__fpu_dp;/* x87 FPU Instruction Operand(Data) Pointer offset */
244__uint16_t__fpu_ds;/* x87 FPU Instruction Operand(Data) Pointer Selector */
245__uint16_t__fpu_rsrv3;/* reserved */
246__uint32_t__fpu_mxcsr;/* MXCSR Register state */
247__uint32_t__fpu_mxcsrmask;/* MXCSR mask */
248_STRUCT_MMST_REG__fpu_stmm0;/* ST0/MM0 */
249_STRUCT_MMST_REG__fpu_stmm1;/* ST1/MM1 */
250_STRUCT_MMST_REG__fpu_stmm2;/* ST2/MM2 */
251_STRUCT_MMST_REG__fpu_stmm3;/* ST3/MM3 */
252_STRUCT_MMST_REG__fpu_stmm4;/* ST4/MM4 */
253_STRUCT_MMST_REG__fpu_stmm5;/* ST5/MM5 */
254_STRUCT_MMST_REG__fpu_stmm6;/* ST6/MM6 */
255_STRUCT_MMST_REG__fpu_stmm7;/* ST7/MM7 */
256_STRUCT_XMM_REG__fpu_xmm0;/* XMM 0 */
257_STRUCT_XMM_REG__fpu_xmm1;/* XMM 1 */
258_STRUCT_XMM_REG__fpu_xmm2;/* XMM 2 */
259_STRUCT_XMM_REG__fpu_xmm3;/* XMM 3 */
260_STRUCT_XMM_REG__fpu_xmm4;/* XMM 4 */
261_STRUCT_XMM_REG__fpu_xmm5;/* XMM 5 */
262_STRUCT_XMM_REG__fpu_xmm6;/* XMM 6 */
263_STRUCT_XMM_REG__fpu_xmm7;/* XMM 7 */
264char__fpu_rsrv4[14*16];/* reserved */
265int __fpu_reserved1;
266};
267#else /* !__DARWIN_UNIX03 */
268#define_STRUCT_X86_FLOAT_STATE32struct i386_float_state
269_STRUCT_X86_FLOAT_STATE32
270{
271int fpu_reserved[2];
272_STRUCT_FP_CONTROLfpu_fcw;/* x87 FPU control word */
273_STRUCT_FP_STATUSfpu_fsw;/* x87 FPU status word */
274__uint8_tfpu_ftw;/* x87 FPU tag word */
275__uint8_tfpu_rsrv1;/* reserved */
276__uint16_tfpu_fop;/* x87 FPU Opcode */
277__uint32_tfpu_ip;/* x87 FPU Instruction Pointer offset */
278__uint16_tfpu_cs;/* x87 FPU Instruction Pointer Selector */
279__uint16_tfpu_rsrv2;/* reserved */
280__uint32_tfpu_dp;/* x87 FPU Instruction Operand(Data) Pointer offset */
281__uint16_tfpu_ds;/* x87 FPU Instruction Operand(Data) Pointer Selector */
282__uint16_tfpu_rsrv3;/* reserved */
283__uint32_tfpu_mxcsr;/* MXCSR Register state */
284__uint32_tfpu_mxcsrmask;/* MXCSR mask */
285_STRUCT_MMST_REGfpu_stmm0;/* ST0/MM0 */
286_STRUCT_MMST_REGfpu_stmm1;/* ST1/MM1 */
287_STRUCT_MMST_REGfpu_stmm2;/* ST2/MM2 */
288_STRUCT_MMST_REGfpu_stmm3;/* ST3/MM3 */
289_STRUCT_MMST_REGfpu_stmm4;/* ST4/MM4 */
290_STRUCT_MMST_REGfpu_stmm5;/* ST5/MM5 */
291_STRUCT_MMST_REGfpu_stmm6;/* ST6/MM6 */
292_STRUCT_MMST_REGfpu_stmm7;/* ST7/MM7 */
293_STRUCT_XMM_REGfpu_xmm0;/* XMM 0 */
294_STRUCT_XMM_REGfpu_xmm1;/* XMM 1 */
295_STRUCT_XMM_REGfpu_xmm2;/* XMM 2 */
296_STRUCT_XMM_REGfpu_xmm3;/* XMM 3 */
297_STRUCT_XMM_REGfpu_xmm4;/* XMM 4 */
298_STRUCT_XMM_REGfpu_xmm5;/* XMM 5 */
299_STRUCT_XMM_REGfpu_xmm6;/* XMM 6 */
300_STRUCT_XMM_REGfpu_xmm7;/* XMM 7 */
301charfpu_rsrv4[14*16];/* reserved */
302int fpu_reserved1;
303};
304#endif /* !__DARWIN_UNIX03 */
305
306#if __DARWIN_UNIX03
307#define _STRUCT_X86_EXCEPTION_STATE32struct __darwin_i386_exception_state
308_STRUCT_X86_EXCEPTION_STATE32
309{
310 unsigned int__trapno;
311 unsigned int__err;
312 unsigned int__faultvaddr;
313};
314#else /* !__DARWIN_UNIX03 */
315#define _STRUCT_X86_EXCEPTION_STATE32struct i386_exception_state
316_STRUCT_X86_EXCEPTION_STATE32
317{
318 unsigned inttrapno;
319 unsigned interr;
320 unsigned intfaultvaddr;
321};
322#endif /* !__DARWIN_UNIX03 */
323
324#if __DARWIN_UNIX03
325#define _STRUCT_X86_DEBUG_STATE32struct __darwin_x86_debug_state32
326_STRUCT_X86_DEBUG_STATE32
327{
328unsigned int__dr0;
329unsigned int__dr1;
330unsigned int__dr2;
331unsigned int__dr3;
332unsigned int__dr4;
333unsigned int__dr5;
334unsigned int__dr6;
335unsigned int__dr7;
336};
337#else /* !__DARWIN_UNIX03 */
338#define _STRUCT_X86_DEBUG_STATE32struct x86_debug_state32
339_STRUCT_X86_DEBUG_STATE32
340{
341unsigned intdr0;
342unsigned intdr1;
343unsigned intdr2;
344unsigned intdr3;
345unsigned intdr4;
346unsigned intdr5;
347unsigned intdr6;
348unsigned intdr7;
349};
350#endif /* !__DARWIN_UNIX03 */
351
352/*
353 * 64 bit versions of the above
354 */
355
356#if __DARWIN_UNIX03
357#define_STRUCT_X86_THREAD_STATE64struct __darwin_x86_thread_state64
358_STRUCT_X86_THREAD_STATE64
359{
360__uint64_t__rax;
361__uint64_t__rbx;
362__uint64_t__rcx;
363__uint64_t__rdx;
364__uint64_t__rdi;
365__uint64_t__rsi;
366__uint64_t__rbp;
367__uint64_t__rsp;
368__uint64_t__r8;
369__uint64_t__r9;
370__uint64_t__r10;
371__uint64_t__r11;
372__uint64_t__r12;
373__uint64_t__r13;
374__uint64_t__r14;
375__uint64_t__r15;
376__uint64_t__rip;
377__uint64_t__rflags;
378__uint64_t__cs;
379__uint64_t__fs;
380__uint64_t__gs;
381};
382#else /* !__DARWIN_UNIX03 */
383#define_STRUCT_X86_THREAD_STATE64struct x86_thread_state64
384_STRUCT_X86_THREAD_STATE64
385{
386__uint64_trax;
387__uint64_trbx;
388__uint64_trcx;
389__uint64_trdx;
390__uint64_trdi;
391__uint64_trsi;
392__uint64_trbp;
393__uint64_trsp;
394__uint64_tr8;
395__uint64_tr9;
396__uint64_tr10;
397__uint64_tr11;
398__uint64_tr12;
399__uint64_tr13;
400__uint64_tr14;
401__uint64_tr15;
402__uint64_trip;
403__uint64_trflags;
404__uint64_tcs;
405__uint64_tfs;
406__uint64_tgs;
407};
408#endif /* !__DARWIN_UNIX03 */
409
410
411#if __DARWIN_UNIX03
412#define_STRUCT_X86_FLOAT_STATE64struct __darwin_x86_float_state64
413_STRUCT_X86_FLOAT_STATE64
414{
415int __fpu_reserved[2];
416_STRUCT_FP_CONTROL__fpu_fcw;/* x87 FPU control word */
417_STRUCT_FP_STATUS__fpu_fsw;/* x87 FPU status word */
418__uint8_t__fpu_ftw;/* x87 FPU tag word */
419__uint8_t__fpu_rsrv1;/* reserved */
420__uint16_t__fpu_fop;/* x87 FPU Opcode */
421
422/* x87 FPU Instruction Pointer */
423__uint32_t__fpu_ip;/* offset */
424__uint16_t__fpu_cs;/* Selector */
425
426__uint16_t__fpu_rsrv2;/* reserved */
427
428/* x87 FPU Instruction Operand(Data) Pointer */
429__uint32_t__fpu_dp;/* offset */
430__uint16_t__fpu_ds;/* Selector */
431
432__uint16_t__fpu_rsrv3;/* reserved */
433__uint32_t__fpu_mxcsr;/* MXCSR Register state */
434__uint32_t__fpu_mxcsrmask;/* MXCSR mask */
435_STRUCT_MMST_REG__fpu_stmm0;/* ST0/MM0 */
436_STRUCT_MMST_REG__fpu_stmm1;/* ST1/MM1 */
437_STRUCT_MMST_REG__fpu_stmm2;/* ST2/MM2 */
438_STRUCT_MMST_REG__fpu_stmm3;/* ST3/MM3 */
439_STRUCT_MMST_REG__fpu_stmm4;/* ST4/MM4 */
440_STRUCT_MMST_REG__fpu_stmm5;/* ST5/MM5 */
441_STRUCT_MMST_REG__fpu_stmm6;/* ST6/MM6 */
442_STRUCT_MMST_REG__fpu_stmm7;/* ST7/MM7 */
443_STRUCT_XMM_REG__fpu_xmm0;/* XMM 0 */
444_STRUCT_XMM_REG__fpu_xmm1;/* XMM 1 */
445_STRUCT_XMM_REG__fpu_xmm2;/* XMM 2 */
446_STRUCT_XMM_REG__fpu_xmm3;/* XMM 3 */
447_STRUCT_XMM_REG__fpu_xmm4;/* XMM 4 */
448_STRUCT_XMM_REG__fpu_xmm5;/* XMM 5 */
449_STRUCT_XMM_REG__fpu_xmm6;/* XMM 6 */
450_STRUCT_XMM_REG__fpu_xmm7;/* XMM 7 */
451_STRUCT_XMM_REG__fpu_xmm8;/* XMM 8 */
452_STRUCT_XMM_REG__fpu_xmm9;/* XMM 9 */
453_STRUCT_XMM_REG__fpu_xmm10;/* XMM 10 */
454_STRUCT_XMM_REG__fpu_xmm11;/* XMM 11 */
455_STRUCT_XMM_REG__fpu_xmm12;/* XMM 12 */
456_STRUCT_XMM_REG__fpu_xmm13;/* XMM 13 */
457_STRUCT_XMM_REG__fpu_xmm14;/* XMM 14 */
458_STRUCT_XMM_REG__fpu_xmm15;/* XMM 15 */
459char__fpu_rsrv4[6*16];/* reserved */
460int __fpu_reserved1;
461};
462#else /* !__DARWIN_UNIX03 */
463#define_STRUCT_X86_FLOAT_STATE64struct x86_float_state64
464_STRUCT_X86_FLOAT_STATE64
465{
466int fpu_reserved[2];
467_STRUCT_FP_CONTROLfpu_fcw;/* x87 FPU control word */
468_STRUCT_FP_STATUSfpu_fsw;/* x87 FPU status word */
469__uint8_tfpu_ftw;/* x87 FPU tag word */
470__uint8_tfpu_rsrv1;/* reserved */
471__uint16_tfpu_fop;/* x87 FPU Opcode */
472
473/* x87 FPU Instruction Pointer */
474__uint32_tfpu_ip;/* offset */
475__uint16_tfpu_cs;/* Selector */
476
477__uint16_tfpu_rsrv2;/* reserved */
478
479/* x87 FPU Instruction Operand(Data) Pointer */
480__uint32_tfpu_dp;/* offset */
481__uint16_tfpu_ds;/* Selector */
482
483__uint16_tfpu_rsrv3;/* reserved */
484__uint32_tfpu_mxcsr;/* MXCSR Register state */
485__uint32_tfpu_mxcsrmask;/* MXCSR mask */
486_STRUCT_MMST_REGfpu_stmm0;/* ST0/MM0 */
487_STRUCT_MMST_REGfpu_stmm1;/* ST1/MM1 */
488_STRUCT_MMST_REGfpu_stmm2;/* ST2/MM2 */
489_STRUCT_MMST_REGfpu_stmm3;/* ST3/MM3 */
490_STRUCT_MMST_REGfpu_stmm4;/* ST4/MM4 */
491_STRUCT_MMST_REGfpu_stmm5;/* ST5/MM5 */
492_STRUCT_MMST_REGfpu_stmm6;/* ST6/MM6 */
493_STRUCT_MMST_REGfpu_stmm7;/* ST7/MM7 */
494_STRUCT_XMM_REGfpu_xmm0;/* XMM 0 */
495_STRUCT_XMM_REGfpu_xmm1;/* XMM 1 */
496_STRUCT_XMM_REGfpu_xmm2;/* XMM 2 */
497_STRUCT_XMM_REGfpu_xmm3;/* XMM 3 */
498_STRUCT_XMM_REGfpu_xmm4;/* XMM 4 */
499_STRUCT_XMM_REGfpu_xmm5;/* XMM 5 */
500_STRUCT_XMM_REGfpu_xmm6;/* XMM 6 */
501_STRUCT_XMM_REGfpu_xmm7;/* XMM 7 */
502_STRUCT_XMM_REGfpu_xmm8;/* XMM 8 */
503_STRUCT_XMM_REGfpu_xmm9;/* XMM 9 */
504_STRUCT_XMM_REGfpu_xmm10;/* XMM 10 */
505_STRUCT_XMM_REGfpu_xmm11;/* XMM 11 */
506_STRUCT_XMM_REGfpu_xmm12;/* XMM 12 */
507_STRUCT_XMM_REGfpu_xmm13;/* XMM 13 */
508_STRUCT_XMM_REGfpu_xmm14;/* XMM 14 */
509_STRUCT_XMM_REGfpu_xmm15;/* XMM 15 */
510charfpu_rsrv4[6*16];/* reserved */
511int fpu_reserved1;
512};
513#endif /* !__DARWIN_UNIX03 */
514
515#if __DARWIN_UNIX03
516#define _STRUCT_X86_EXCEPTION_STATE64struct __darwin_x86_exception_state64
517_STRUCT_X86_EXCEPTION_STATE64
518{
519 unsigned int__trapno;
520 unsigned int__err;
521 __uint64_t__faultvaddr;
522};
523#else /* !__DARWIN_UNIX03 */
524#define _STRUCT_X86_EXCEPTION_STATE64struct x86_exception_state64
525_STRUCT_X86_EXCEPTION_STATE64
526{
527 unsigned inttrapno;
528 unsigned interr;
529 __uint64_tfaultvaddr;
530};
531#endif /* !__DARWIN_UNIX03 */
532
533#if __DARWIN_UNIX03
534#define _STRUCT_X86_DEBUG_STATE64struct __darwin_x86_debug_state64
535_STRUCT_X86_DEBUG_STATE64
536{
537__uint64_t__dr0;
538__uint64_t__dr1;
539__uint64_t__dr2;
540__uint64_t__dr3;
541__uint64_t__dr4;
542__uint64_t__dr5;
543__uint64_t__dr6;
544__uint64_t__dr7;
545};
546#else /* !__DARWIN_UNIX03 */
547#define _STRUCT_X86_DEBUG_STATE64struct x86_debug_state64
548_STRUCT_X86_DEBUG_STATE64
549{
550__uint64_tdr0;
551__uint64_tdr1;
552__uint64_tdr2;
553__uint64_tdr3;
554__uint64_tdr4;
555__uint64_tdr5;
556__uint64_tdr6;
557__uint64_tdr7;
558};
559#endif /* !__DARWIN_UNIX03 */
560
561#endif /* _MACH_I386__STRUCTS_H_ */
562

Archive Download this file

Revision: 1171