Merge commit '74ecdb5171c9f3673b9393b1a3dc6f3a65e93895'
[unleashed.git] / arch / x86 / kernel / platform / i86pc / boot / boot_gdt.s
blob23af5c11752ef80745698281c49c61921d137433
1 /*
2 * CDDL HEADER START
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.
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.
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]
19 * CDDL HEADER END
23 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
29 .align 16
30 .data
32 * This must remain in sync with the entries in x86/include/sys/gdt.h;
33 * in particular kmdb uses B64CODE_SEL or B32CODE_SEL in perpetuity for
34 * its IDT entries (they're copied to the kernel's GDT in init_idt()).
37 global_descriptor_table:
38 .long 0
39 .long 0
41 /* GDT_B32DATA: 32 bit flat data descriptor */
42 .value 0xFFFF /* segment limit 0..15 */
43 .value 0x0000 /* segment base 0..15 */
44 .byte 0x0 /* segment base 16..23 */
45 .byte 0x92 /* P = 1, read/write data */
46 .byte 0xCF /* G=1, B=1, Limit (16..19)=1111 */
47 .byte 0x0 /* segment base 24..32 */
49 /* GDT_B32CODE 32 bit flat code descriptor */
50 .value 0xFFFF /* segment limit 0..15 */
51 .value 0x0000 /* segment base 0..15 */
52 .byte 0x0 /* segment base 16..23 */
53 .byte 0x9A /* P=1, code, exec, readable */
54 .byte 0xCF /* G=1, D=1, Limit (16..19)=1111 */
55 .byte 0x0 /* segment base 24..32 */
58 * GDT_B16CODE 16 bit code descriptor for doing BIOS calls
60 .value 0xFFFF /* segment limit 0..15 */
61 .value 0x0000 /* segment base 0..15 */
62 .byte 0x0 /* segment base 16..23 */
63 .byte 0x9A /* P=1, code, exec, readable */
64 .byte 0x0F /* G=0, D=0, Limit (16..19)=1111 */
65 .byte 0x0 /* segment base 24..32 */
68 * GDT_B16DATA 16 bit data descriptor for doing BIOS calls
70 .value 0xFFFF /* segment limit 0..15 */
71 .value 0x0000 /* segment base 0..15 */
72 .byte 0x0 /* segment base 16..23 */
73 .byte 0x92 /* P = 1, read/write data */
74 .byte 0x4F /* G=0, D=1, Limit (16..19)=1111 */
75 .byte 0x0 /* segment base 24..32 */
77 /* GDT_B64CODE: 64 bit flat code descriptor - only L bit has meaning */
78 .value 0xFFFF /* segment limit 0..15 */
79 .value 0x0000 /* segment base 0..15 */
80 .byte 0x0 /* segment base 16..23 */
81 .byte 0x9A /* P=1, code, exec, readable */
82 .byte 0xAF /* G=1, D=0, L=1, Limit (16..19)=1111 */
83 .byte 0x0 /* segment base 24..32 */
86 * unused
88 .long 0
89 .long 0
92 * GDT_BGSTMP -- an entry for kmdb to use during boot
93 * the fast reboot code uses this entry for memory copies, too.
95 .value 0x0001 /* segment limit 0..15 */
97 .globl fake_cpu_gdt_base_0_15
98 fake_cpu_gdt_base_0_15:
100 .value 0x0000 /* segment base 0..15 */
102 .globl fake_cpu_gdt_base_16_23
103 fake_cpu_gdt_base_16_23:
104 .byte 0x0 /* segment base 16..23 */
105 .byte 0x9A /* P=1, code, exec, readable */
106 .byte 0xC0 /* G=1, D=1, Limit (16..19)=0000 */
108 .globl fake_cpu_gdt_base_24_31
109 fake_cpu_gdt_base_24_31:
110 .byte 0x0 /* segment base 24..32 */
112 / .long 0
113 / .long 0
115 gdt_info:
116 .value gdt_info - global_descriptor_table - 1
117 .long global_descriptor_table
118 .long 0 /* needed for 64 bit */
120 fake_cpu:
121 .4byte 0
122 .4byte 0
123 .4byte 0
124 .globl fake_cpu_ptr
125 fake_cpu_ptr:
126 .4byte 0
127 .skip 0x6c0, 0