x86, trampoline: Common infrastructure for low memory trampolines
[deliverable/linux.git] / arch / x86 / kernel / trampoline_64.S
index 075d130efcf9019eb3f4745677e281533335fa11..49c77a682522b83fc4abe9d93115506d32e61ee6 100644 (file)
 #include <asm/segment.h>
 #include <asm/processor-flags.h>
 
-#ifdef CONFIG_ACPI_SLEEP
-.section .rodata, "a", @progbits
-#else
-/* We can free up the trampoline after bootup if cpu hotplug is not supported. */
-__CPUINITRODATA
-#endif
-.code16
+       .section ".x86_trampoline","a"
+       .balign PAGE_SIZE
+       .code16
 
 ENTRY(trampoline_data)
 r_base = .
@@ -50,7 +46,7 @@ r_base = .
        mov     %ax, %ss
 
 
-       movl    $0xA5A5A5A5, trampoline_data - r_base
+       movl    $0xA5A5A5A5, trampoline_status - r_base
                                # write marker for master knows we're running
 
                                        # Setup stack
@@ -64,10 +60,13 @@ r_base = .
        movzx   %ax, %esi               # Find the 32bit trampoline location
        shll    $4, %esi
 
-                                       # Fixup the vectors
-       addl    %esi, startup_32_vector - r_base
-       addl    %esi, startup_64_vector - r_base
-       addl    %esi, tgdt + 2 - r_base # Fixup the gdt pointer
+                                       # Fixup the absolute vectors
+       leal    (startup_32 - r_base)(%esi), %eax
+       movl    %eax, startup_32_vector - r_base
+       leal    (startup_64 - r_base)(%esi), %eax
+       movl    %eax, startup_64_vector - r_base
+       leal    (tgdt - r_base)(%esi), %eax
+       movl    %eax, (tgdt + 2 - r_base)
 
        /*
         * GDT tables in non default location kernel can be beyond 16MB and
@@ -129,6 +128,7 @@ no_longmode:
        jmp no_longmode
 #include "verify_cpu.S"
 
+       .balign 4
        # Careful these need to be in the same 64K segment as the above;
 tidt:
        .word   0                       # idt limit = 0
@@ -156,6 +156,12 @@ startup_64_vector:
        .long   startup_64 - r_base
        .word   __KERNEL_CS, 0
 
+       .balign 4
+fixup_base:
+       .long   0
+ENTRY(trampoline_status)
+       .long   0
+
 trampoline_stack:
        .org 0x1000
 trampoline_stack_end:
This page took 0.044693 seconds and 5 git commands to generate.