]> git.saurik.com Git - apple/xnu.git/blob - EXTERNAL_HEADERS/architecture/i386/tss.h
xnu-344.21.74.tar.gz
[apple/xnu.git] / EXTERNAL_HEADERS / architecture / i386 / tss.h
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
7 *
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * file.
14 *
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
22 *
23 * @APPLE_LICENSE_HEADER_END@
24 */
25 /*
26 * Copyright (c) 1992 NeXT Computer, Inc.
27 *
28 * Intel386 Family: Task State Segment.
29 *
30 * HISTORY
31 *
32 * 29 March 1992 ? at NeXT
33 * Created.
34 */
35
36 #include <architecture/i386/sel.h>
37
38 /*
39 * Task State segment.
40 */
41
42 typedef struct tss {
43 sel_t oldtss;
44 unsigned int :0;
45 unsigned int esp0;
46 sel_t ss0;
47 unsigned int :0;
48 unsigned int esp1;
49 sel_t ss1;
50 unsigned int :0;
51 unsigned int esp2;
52 sel_t ss2;
53 unsigned int :0;
54 unsigned int cr3;
55 unsigned int eip;
56 unsigned int eflags;
57 unsigned int eax;
58 unsigned int ecx;
59 unsigned int edx;
60 unsigned int ebx;
61 unsigned int esp;
62 unsigned int ebp;
63 unsigned int esi;
64 unsigned int edi;
65 sel_t es;
66 unsigned int :0;
67 sel_t cs;
68 unsigned int :0;
69 sel_t ss;
70 unsigned int :0;
71 sel_t ds;
72 unsigned int :0;
73 sel_t fs;
74 unsigned int :0;
75 sel_t gs;
76 unsigned int :0;
77 sel_t ldt;
78 unsigned int :0;
79 unsigned int t :1,
80 :15,
81 io_bmap :16;
82 } tss_t;
83
84 #define TSS_SIZE(n) (sizeof (struct tss) + (n))
85
86 /*
87 * Task State segment descriptor.
88 */
89
90 typedef struct tss_desc {
91 unsigned short limit00;
92 unsigned short base00;
93 unsigned char base16;
94 unsigned char type :5,
95 #define DESC_TSS 0x09
96 dpl :2,
97 present :1;
98 unsigned char limit16 :4,
99 :3,
100 granular:1;
101 unsigned char base24;
102 } tss_desc_t;
103
104 /*
105 * Task gate descriptor.
106 */
107
108 typedef struct task_gate {
109 unsigned short :16;
110 sel_t tss;
111 unsigned int :8,
112 type :5,
113 #define DESC_TASK_GATE 0x05
114 dpl :2,
115 present :1,
116 :0;
117 } task_gate_t;