1/*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * Copyright (c) 1992 NeXT Computer, Inc.
30 *
31 * Intel386 Family:	Descriptor tables.
32 *
33 * HISTORY
34 *
35 * 30 March 1992 ? at NeXT
36 *	Created.
37 */
38
39#include <architecture/i386/desc.h>
40#include <architecture/i386/tss.h>
41
42/*
43 * A totally generic descriptor
44 * table entry.
45 */
46
47typedef union dt_entry {
48    code_desc_t		code;
49    data_desc_t		data;
50    ldt_desc_t		ldt;
51    tss_desc_t		task_state;
52    call_gate_t		call_gate;
53    trap_gate_t		trap_gate;
54    intr_gate_t		intr_gate;
55    task_gate_t		task_gate;
56} dt_entry_t;
57
58#define DESC_TBL_MAX	8192
59
60/*
61 * Global descriptor table.
62 */
63
64typedef union gdt_entry {
65    code_desc_t		code;
66    data_desc_t		data;
67    ldt_desc_t		ldt;
68    call_gate_t		call_gate;
69    task_gate_t		task_gate;
70    tss_desc_t		task_state;
71} gdt_entry_t;
72
73typedef gdt_entry_t	gdt_t;
74
75/*
76 * Interrupt descriptor table.
77 */
78
79typedef union idt_entry {
80    trap_gate_t		trap_gate;
81    intr_gate_t		intr_gate;
82    task_gate_t		task_gate;
83} idt_entry_t;
84
85typedef idt_entry_t	idt_t;
86
87/*
88 * Local descriptor table.
89 */
90
91typedef union ldt_entry {
92    code_desc_t		code;
93    data_desc_t		data;
94    call_gate_t		call_gate;
95    task_gate_t		task_gate;
96} ldt_entry_t;
97
98typedef ldt_entry_t	ldt_t;
99