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