Chameleon

Chameleon Svn Source Tree

Root/tags/2.3/i386/include/architecture/i386/desc.h

Source at commit 2862 created 7 years 24 days ago.
By ifabio, Tag 2.3 release, bump svn to 2.4
1/*
2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_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. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
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
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
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.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23/*
24 * Copyright (c) 1992 NeXT Computer, Inc.
25 *
26 * Intel386 Family:Segment descriptors.
27 *
28 * HISTORY
29 *
30 * 29 March 1992 ? at NeXT
31 *Created.
32 */
33
34#ifndef _ARCH_I386_DESC_H_
35#define _ARCH_I386_DESC_H_
36
37/*
38 * Code segment descriptor.
39 */
40
41typedef struct code_desc {
42 unsigned shortlimit00;
43 unsigned shortbase00;
44 unsigned charbase16;
45 unsigned chartype:5,
46#define DESC_CODE_EXEC0x18
47#define DESC_CODE_READ0x1a
48dpl:2,
49present:1;
50 unsigned charlimit16:4,
51:2,
52opsz:1,
53#define DESC_CODE_16B0
54#define DESC_CODE_32B1
55granular:1;
56#define DESC_GRAN_BYTE0
57#define DESC_GRAN_PAGE1
58 unsigned charbase24;
59} code_desc_t;
60
61/*
62 * Data segment descriptor.
63 */
64
65typedef struct data_desc {
66 unsigned shortlimit00;
67 unsigned shortbase00;
68 unsigned charbase16;
69 unsigned chartype:5,
70#define DESC_DATA_RONLY0x10
71#define DESC_DATA_WRITE0x12
72dpl:2,
73present:1;
74 unsigned charlimit16:4,
75:2,
76stksz:1,
77#define DESC_DATA_16B0
78#define DESC_DATA_32B1
79granular:1;
80 unsigned charbase24;
81} data_desc_t;
82
83/*
84 * LDT segment descriptor.
85 */
86
87typedef struct ldt_desc {
88 unsigned shortlimit00;
89 unsigned shortbase00;
90 unsigned charbase16;
91 unsigned chartype:5,
92#define DESC_LDT0x02
93:2,
94present:1;
95 unsigned charlimit16:4,
96:3,
97granular:1;
98 unsigned charbase24;
99} ldt_desc_t;
100
101#include <architecture/i386/sel.h>
102
103/*
104 * Call gate descriptor.
105 */
106
107typedef struct call_gate {
108 unsigned shortoffset00;
109 sel_tseg;
110 unsigned intargcnt:5,
111 :3,
112type:5,
113#define DESC_CALL_GATE0x0c
114dpl:2,
115present:1,
116offset16:16;
117} call_gate_t;
118
119/*
120 * Trap gate descriptor.
121 */
122
123typedef struct trap_gate {
124 unsigned shortoffset00;
125 sel_tseg;
126 unsigned int:8,
127 type:5,
128#define DESC_TRAP_GATE0x0f
129dpl:2,
130present:1,
131offset16:16;
132} trap_gate_t;
133
134
135/*
136 * Interrupt gate descriptor.
137 */
138
139typedef struct intr_gate {
140 unsigned shortoffset00;
141 sel_tseg;
142 unsigned int:8,
143 type:5,
144#define DESC_INTR_GATE0x0e
145dpl:2,
146present:1,
147offset16:16;
148} intr_gate_t;
149
150#endif/* _ARCH_I386_DESC_H_ */
151

Archive Download this file

Revision: 2862