xref: /titanic_52/usr/src/uts/i86pc/boot/boot_gdt.s (revision a99982a76d4cc12b1e9021e88531cf425d1e7369)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22/*
23 * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
24 * Use is subject to license terms.
25 */
26
27#pragma ident	"%Z%%M%	%I%	%E% SMI"
28
29#if defined(__lint)
30
31int global_descriptor_table[0x10];
32
33#else	/* __lint */
34
35	.align 16
36
37	/*
38	 * This must remain in sync with the entries in intel/sys/gdt.h; in
39	 * particular kmdb uses B64CODE_SEL or B32CODE_SEL in perpetuity for
40	 * its IDT entries (they're copied to the kernel's GDT in init_idt()).
41	 */
42
43global_descriptor_table:
44	.long   0
45	.long   0
46
47	/* GDT_B32DATA: 32 bit flat data descriptor */
48	.value  0xFFFF	/* segment limit 0..15 */
49	.value  0x0000	/* segment base 0..15 */
50	.byte   0x0	/* segment base 16..23 */
51	.byte   0x92	/* P = 1, read/write data */
52	.byte   0xCF	/* G=1, B=1, Limit (16..19)=1111 */
53	.byte   0x0	/* segment base 24..32 */
54
55	/* GDT_B32CODE 32 bit flat code descriptor */
56	.value  0xFFFF	/* segment limit 0..15 */
57	.value  0x0000	/* segment base 0..15 */
58	.byte   0x0	/* segment base 16..23 */
59	.byte   0x9E	/* P=1, code, exec, readable */
60	.byte   0xCF	/* G=1, D=1, Limit (16..19)=1111 */
61	.byte   0x0	/* segment base 24..32 */
62
63	/*
64	 * GDT_B16CODE 16 bit code descriptor for doing BIOS calls
65	 */
66	.value  0xFFFF	/* segment limit 0..15 */
67	.value  0x0000	/* segment base 0..15 */
68	.byte   0x0	/* segment base 16..23 */
69	.byte   0x9E	/* P=1, code, exec, readable */
70	.byte   0x0F	/* G=0, D=0, Limit (16..19)=1111 */
71	.byte   0x0	/* segment base 24..32 */
72
73	/*
74	 * GDT_B16DATA 16 bit data descriptor for doing BIOS calls
75	 */
76	.value  0xFFFF	/* segment limit 0..15 */
77	.value  0x0000	/* segment base 0..15 */
78	.byte   0x0	/* segment base 16..23 */
79	.byte   0x92	/* P = 1, read/write data */
80	.byte   0x4F	/* G=0, D=1, Limit (16..19)=1111 */
81	.byte   0x0	/* segment base 24..32 */
82
83	/* GDT_B64CODE: 64 bit flat code descriptor - only L bit has meaning */
84	.value  0xFFFF	/* segment limit 0..15 */
85	.value  0x0000	/* segment base 0..15 */
86	.byte   0x0	/* segment base 16..23 */
87	.byte   0x9E	/* P=1, code, exec, readable */
88	.byte   0xAF	/* G=1, D=0, L=1, Limit (16..19)=1111 */
89	.byte   0x0	/* segment base 24..32 */
90
91	/*
92	 * unused
93	 */
94	.long	0
95	.long	0
96
97	/*
98	 * GDT_BGSTMP -- an entry for kmdb to use during boot
99	 */
100	.long	0
101	.long	0
102
103gdt_info:
104	.value	gdt_info - global_descriptor_table - 1
105	.long	global_descriptor_table
106	.long   0		/* needed for 64 bit */
107
108#endif	/* __lint */
109