3 * Trampoline.S Derived from Setup.S by Linus Torvalds
5 * 4 Jan 1997 Michael Chastain: changed to gnu as.
7 * This is only used for booting secondary CPUs in SMP machine
9 * Entry: CS:IP point to the start of our code, we are
10 * in real mode with no stack, but the rest of the
11 * trampoline page to make our stack and everything else
14 * We jump into arch/x86/kernel/head_32.S.
16 * On entry to trampoline_start, the processor is in real mode
17 * with 16-bit addressing and 16-bit data. CS has some value
18 * and IP is zero. Thus, we load CS to the physical segment
19 * of the real mode code before doing anything further.
22 #include <linux/linkage.h>
23 #include <asm/segment.h>
24 #include <asm/page_types.h>
31 ENTRY(trampoline_start)
32 wbinvd # Needed for NUMA-Q should be harmless for others
36 mov %cs, %ax # Code and data in the same place
39 cli # We should be safe anyway
41 movl tr_start, %eax # where we need to go
43 movl $0xA5A5A5A5, trampoline_status
44 # write marker for master knows we're running
47 * GDT tables in non default location kernel can be beyond 16MB and
48 * lgdt will not be able to load the address as in real mode default
49 * operand size is 16bit. Use lgdtl instead to force operand size
52 lidtl tr_idt # load idt with 0, 0
53 lgdtl tr_gdt # load gdt with whatever is appropriate
55 movw $1, %dx # protected mode (PE) bit
56 lmsw %dx # into protected mode
58 ljmpl $__BOOT_CS, $pa_startup_32
60 .section ".text32","ax"
62 ENTRY(startup_32) # note: also used from wakeup_asm.S
67 GLOBAL(trampoline_header)
71 END(trampoline_header)
73 #include "trampoline_common.S"