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