1 /* SPDX-License-Identifier: GPL-2.0-only */
5 .section .init, "ax", @progbits
7 .section .init._gdt_, "ax", @progbits
18 .word gdt_end - gdt -1 /* compute the table limit */
19 .long gdt /* we know the offset */
23 .section .init._gdt64_, "ax", @progbits
26 movabs $gdtptr64, %rax
34 .word gdt_end - gdt -1 /* compute the table limit */
35 .quad gdt /* we know the offset */
40 /* selgdt 0, unused */
41 .word 0x0000, 0x0000 /* dummy */
42 .byte 0x00, 0x00, 0x00, 0x00
44 /* selgdt 0x08, flat code segment */
46 .byte 0x00, 0x9b, 0xcf, 0x00 /* G=1 and 0x0f, So we get 4Gbytes
49 /* selgdt 0x10,flat data segment */
51 .byte 0x00, 0x93, 0xcf, 0x00
53 /* selgdt 0x18, flat code segment (64-bit) */
55 .byte 0x00, 0x9b, 0xaf, 0x00