aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/realmode
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2012-05-16 16:44:10 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2012-05-16 16:44:10 -0400
commit51edbe6a2f47c78c6c6e529999ee0a044fe59a89 (patch)
tree8e68fcbac877e409e04596e97f6868d7db8f3fe2 /arch/x86/realmode
parent796038799a72adb279d785c9154df6eeb98b6e8d (diff)
x86, realmode: Move not-common bits out of trampoline_common.S
Move the bits that aren't actually common out of trampoline_common.S and into the arch-specific files. Furthermore, make sure the page directory is first in the .bss section for trampoline_64.S in order to not waste an entire page of memory. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com> Cc: Jarkko Sakkinen <jarkko.sakkinen@intel.com>
Diffstat (limited to 'arch/x86/realmode')
-rw-r--r--arch/x86/realmode/rm/trampoline_32.S8
-rw-r--r--arch/x86/realmode/rm/trampoline_64.S25
-rw-r--r--arch/x86/realmode/rm/trampoline_common.S35
3 files changed, 33 insertions, 35 deletions
diff --git a/arch/x86/realmode/rm/trampoline_32.S b/arch/x86/realmode/rm/trampoline_32.S
index 6fc064b4d2b9..c1b2791183e7 100644
--- a/arch/x86/realmode/rm/trampoline_32.S
+++ b/arch/x86/realmode/rm/trampoline_32.S
@@ -63,4 +63,12 @@ ENTRY(trampoline_start)
63ENTRY(startup_32) # note: also used from wakeup_asm.S 63ENTRY(startup_32) # note: also used from wakeup_asm.S
64 jmp *%eax 64 jmp *%eax
65 65
66 .bss
67 .balign 8
68GLOBAL(trampoline_header)
69 tr_start: .space 4
70 tr_gdt_pad: .space 2
71 tr_gdt: .space 6
72END(trampoline_header)
73
66#include "trampoline_common.S" 74#include "trampoline_common.S"
diff --git a/arch/x86/realmode/rm/trampoline_64.S b/arch/x86/realmode/rm/trampoline_64.S
index 66e26f088288..1b9e1bc1ac5e 100644
--- a/arch/x86/realmode/rm/trampoline_64.S
+++ b/arch/x86/realmode/rm/trampoline_64.S
@@ -125,4 +125,29 @@ ENTRY(startup_64)
125 # Now jump into the kernel using virtual addresses 125 # Now jump into the kernel using virtual addresses
126 jmpq *tr_start(%rip) 126 jmpq *tr_start(%rip)
127 127
128 .section ".rodata","a"
129 # Duplicate the global descriptor table
130 # so the kernel can live anywhere
131 .balign 16
132 .globl tr_gdt
133tr_gdt:
134 .short tr_gdt_end - tr_gdt - 1 # gdt limit
135 .long pa_tr_gdt
136 .short 0
137 .quad 0x00cf9b000000ffff # __KERNEL32_CS
138 .quad 0x00af9b000000ffff # __KERNEL_CS
139 .quad 0x00cf93000000ffff # __KERNEL_DS
140tr_gdt_end:
141
142 .bss
143 .balign PAGE_SIZE
144GLOBAL(trampoline_pgd) .space PAGE_SIZE
145
146 .balign 8
147GLOBAL(trampoline_header)
148 tr_start: .space 8
149 GLOBAL(tr_cr4) .space 4
150 GLOBAL(tr_efer) .space 8
151END(trampoline_header)
152
128#include "trampoline_common.S" 153#include "trampoline_common.S"
diff --git a/arch/x86/realmode/rm/trampoline_common.S b/arch/x86/realmode/rm/trampoline_common.S
index cac444b942f8..b1ecdb9692ad 100644
--- a/arch/x86/realmode/rm/trampoline_common.S
+++ b/arch/x86/realmode/rm/trampoline_common.S
@@ -1,42 +1,7 @@
1 .section ".rodata","a" 1 .section ".rodata","a"
2
3#ifdef CONFIG_X86_64
4 # Duplicate the global descriptor table
5 # so the kernel can live anywhere
6 .balign 16 2 .balign 16
7 .globl tr_gdt
8tr_gdt:
9 .short tr_gdt_end - tr_gdt - 1 # gdt limit
10 .long pa_tr_gdt
11 .short 0
12 .quad 0x00cf9b000000ffff # __KERNEL32_CS
13 .quad 0x00af9b000000ffff # __KERNEL_CS
14 .quad 0x00cf93000000ffff # __KERNEL_DS
15tr_gdt_end:
16#endif
17
18 .balign 4
19tr_idt: .fill 1, 6, 0 3tr_idt: .fill 1, 6, 0
20 4
21 .bss 5 .bss
22
23 .balign 4 6 .balign 4
24GLOBAL(trampoline_status) .space 4 7GLOBAL(trampoline_status) .space 4
25
26 .balign 8
27GLOBAL(trampoline_header)
28#ifdef CONFIG_X86_32
29 tr_start: .space 4
30 tr_gdt_pad: .space 2
31 tr_gdt: .space 6
32#else
33 tr_start: .space 8
34 GLOBAL(tr_cr4) .space 4
35 GLOBAL(tr_efer) .space 8
36#endif
37END(trampoline_header)
38
39#ifdef CONFIG_X86_64
40 .balign PAGE_SIZE
41GLOBAL(trampoline_pgd) .space PAGE_SIZE
42#endif