|
|
1.1 root 1: /*
2: * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
3: *
4: * @APPLE_LICENSE_HEADER_START@
5: *
6: * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
7: * Reserved. This file contains Original Code and/or Modifications of
8: * Original Code as defined in and that are subject to the Apple Public
9: * Source License Version 1.1 (the "License"). You may not use this file
10: * except in compliance with the License. Please obtain a copy of the
11: * License at http://www.apple.com/publicsource and read it before using
12: * this file.
13: *
14: * The Original Code and all software distributed under the License are
15: * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16: * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17: * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18: * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
19: * License for the specific language governing rights and limitations
20: * under the License.
21: *
22: * @APPLE_LICENSE_HEADER_END@
23: */
24:
25: /*
26: * Copyright (c) 1992 NeXT Computer, Inc.
27: *
28: * Intel386 Family: Segments.
29: *
30: * HISTORY
31: *
32: * 11 May 1992 ? at NeXT
33: * Created.
34: */
35:
36: #import <architecture/i386/sel.h>
37: #import <architecture/i386/desc.h>
38: #import <architecture/i386/tss.h>
39:
40: /*
41: * Segment selector values *used*
42: * by the system.
43: */
44:
45: /*
46: * Global descriptor table
47: */
48:
49: #define KCS_SEL ((sel_t) /* CS of kernel */ \
50: { \
51: KERN_PRIV, \
52: SEL_GDT, \
53: 0x0001 \
54: } \
55: )
56: #define KDS_SEL ((sel_t) /* DS of kernel */ \
57: { \
58: KERN_PRIV, \
59: SEL_GDT, \
60: 0x0002 \
61: } \
62: )
63: #define TSS_SEL ((sel_t) /* TSS of cur thread */ \
64: { \
65: KERN_PRIV, \
66: SEL_GDT, \
67: 0x0003 \
68: } \
69: )
70: #define LDT_SEL ((sel_t) /* LDT of cur task */ \
71: { \
72: KERN_PRIV, \
73: SEL_GDT, \
74: 0x0004 \
75: } \
76: )
77: #define SCALL_SEL ((sel_t) /* U**X system calls */ \
78: { \
79: USER_PRIV, \
80: SEL_GDT, \
81: 0x0005 \
82: } \
83: )
84: #define MACHCALL_SEL ((sel_t) /* MACH kernel traps */ \
85: { \
86: USER_PRIV, \
87: SEL_GDT, \
88: 0x0006 \
89: } \
90: )
91: #define MDCALL_SEL ((sel_t) /* machine dependent calls */ \
92: { \
93: USER_PRIV, \
94: SEL_GDT, \
95: 0x0007 \
96: } \
97: )
98: #define BIOSDATA_SEL ((sel_t) /* used by prot mode WINDOWS */ \
99: { \
100: KERN_PRIV, \
101: SEL_GDT, \
102: 0x0008 \
103: } \
104: )
105: #define LCODE_SEL ((sel_t) /* entire linear code space */ \
106: { \
107: KERN_PRIV, \
108: SEL_GDT, \
109: 0x0009 \
110: } \
111: )
112: #define LDATA_SEL ((sel_t) /* entire linear data space */ \
113: { \
114: KERN_PRIV, \
115: SEL_GDT, \
116: 0x000A \
117: } \
118: )
119: #define FPSTATE_SEL ((sel_t) /* for fp emulator */ \
120: { \
121: KERN_PRIV, \
122: SEL_GDT, \
123: 0x000B \
124: } \
125: )
126: #define UCODE_SEL ((sel_t) /* alternate UCS */ \
127: { \
128: USER_PRIV, \
129: SEL_GDT, \
130: 0x000C \
131: } \
132: )
133: #define UDATA_SEL ((sel_t) /* alternate UDS */ \
134: { \
135: USER_PRIV, \
136: SEL_GDT, \
137: 0x000D \
138: } \
139: )
140: #define DBLFLT_SEL ((sel_t) /* TSS for double faults */ \
141: { \
142: KERN_PRIV, \
143: SEL_GDT, \
144: 0x000E \
145: } \
146: )
147: #define APMCODE32_SEL ((sel_t) /* 32-bit code segment */ \
148: { \
149: KERN_PRIV, \
150: SEL_GDT, \
151: 0x000F \
152: } \
153: )
154: #define APMCODE16_SEL ((sel_t) /* 16-bit code segment */ \
155: { \
156: KERN_PRIV, \
157: SEL_GDT, \
158: 0x0010 \
159: } \
160: )
161: #define APMDATA_SEL ((sel_t) /* APM data segment */ \
162: { \
163: KERN_PRIV, \
164: SEL_GDT, \
165: 0x0011 \
166: } \
167: )
168: #define BIOSC32_SEL ((sel_t) /* 32-bit BIOScode segment */ \
169: { \
170: KERN_PRIV, \
171: SEL_GDT, \
172: 0x0012 \
173: } \
174: )
175: #define BIOSD32_SEL ((sel_t) /* 32-bit BIOS data segment */ \
176: { \
177: KERN_PRIV, \
178: SEL_GDT, \
179: 0x0013 \
180: } \
181: )
182:
183: /*
184: * Local descriptor table
185: */
186:
187: #define UCS_SEL ((sel_t) /* User CS of cur task */ \
188: { \
189: USER_PRIV, \
190: SEL_LDT, \
191: 0x0001 \
192: } \
193: )
194: #define UDS_SEL ((sel_t) /* User DS of cur task */ \
195: { \
196: USER_PRIV, \
197: SEL_LDT, \
198: 0x0002 \
199: } \
200: )
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.