0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #include <linux/linkage.h>
0011 #include <asm/purgatory.h>
0012
0013 .text
0014 .balign 16
0015 .code64
0016
0017 SYM_CODE_START(purgatory_start)
0018
0019 lgdt gdt(%rip)
0020
0021
0022 movl $0x18, %eax
0023 movl %eax, %ds
0024 movl %eax, %es
0025 movl %eax, %ss
0026 movl %eax, %fs
0027 movl %eax, %gs
0028
0029
0030 leaq lstack_end(%rip), %rsp
0031
0032
0033 call purgatory
0034 jmp entry64
0035 SYM_CODE_END(purgatory_start)
0036
0037 .section ".rodata"
0038 .balign 16
0039 SYM_DATA_START_LOCAL(gdt)
0040
0041
0042
0043
0044 .word gdt_end - gdt - 1
0045 .quad gdt
0046 .word 0, 0, 0
0047
0048
0049 .word 0xFFFF, 0x0000, 0x9A00, 0x00AF
0050
0051
0052 .word 0xFFFF, 0x0000, 0x9200, 0x00CF
0053 SYM_DATA_END_LABEL(gdt, SYM_L_LOCAL, gdt_end)
0054
0055 .bss
0056 .balign 4096
0057 SYM_DATA_START_LOCAL(lstack)
0058 .skip 4096
0059 SYM_DATA_END_LABEL(lstack, SYM_L_LOCAL, lstack_end)