1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 #include <linux/linkage.h>
24 #include <asm/segment.h>
25 #include <asm/page_types.h>
26 #include "realmode.h"
27
28 .text
29 .code16
30
31 .balign PAGE_SIZE
32 ENTRY(trampoline_start)
33 wbinvd # Needed for NUMA-Q should be harmless for others
34
35 LJMPW_RM(1f)
36 1:
37 mov %cs, %ax # Code and data in the same place
38 mov %ax, %ds
39
40 cli # We should be safe anyway
41
42 movl tr_start, %eax # where we need to go
43
44
45
46
47
48
49
50 lidtl tr_idt # load idt with 0, 0
51 lgdtl tr_gdt # load gdt with whatever is appropriate
52
53 movw $1, %dx # protected mode (PE) bit
54 lmsw %dx # into protected mode
55
56 ljmpl $__BOOT_CS, $pa_startup_32
57
58 .section ".text32","ax"
59 .code32
60 ENTRY(startup_32) # note: also used from wakeup_asm.S
61 jmp *%eax
62
63 .bss
64 .balign 8
65 GLOBAL(trampoline_header)
66 tr_start: .space 4
67 tr_gdt_pad: .space 2
68 tr_gdt: .space 6
69 END(trampoline_header)
70
71 #include "trampoline_common.S"