3 #include <asm/trampoline.h>
4 #include <asm/pgtable.h>
7 #if defined(CONFIG_X86_64) && defined(CONFIG_ACPI_SLEEP)
9 #define __trampinitdata
11 #define __trampinit __cpuinit
12 #define __trampinitdata __cpuinitdata
15 /* ready for x86_64 and x86 */
16 unsigned char *__trampinitdata trampoline_base = __va(TRAMPOLINE_BASE);
18 void __init reserve_trampoline_memory(void)
22 * But first pinch a few for the stack/trampoline stuff
23 * FIXME: Don't need the extra page at 4K, but need to fix
24 * trampoline before removing it. (see the GDT stuff)
26 reserve_early(PAGE_SIZE, PAGE_SIZE + PAGE_SIZE, "EX TRAMPOLINE");
28 /* Has to be in very low memory so we can execute real-mode AP code. */
29 reserve_early(TRAMPOLINE_BASE, TRAMPOLINE_BASE + TRAMPOLINE_SIZE,
34 * Currently trivial. Write the real->protected mode
35 * bootstrap into the page concerned. The caller
36 * has made sure it's suitably aligned.
38 unsigned long __trampinit setup_trampoline(void)
40 memcpy(trampoline_base, trampoline_data, TRAMPOLINE_SIZE);
41 return virt_to_phys(trampoline_base);
44 void __init setup_trampoline_page_table(void)
47 /* Copy kernel address range */
48 clone_pgd_range(trampoline_pg_dir + KERNEL_PGD_BOUNDARY,
49 swapper_pg_dir + KERNEL_PGD_BOUNDARY,
50 min_t(unsigned long, KERNEL_PGD_PTRS,
51 KERNEL_PGD_BOUNDARY));
53 /* Initialize low mappings */
54 clone_pgd_range(trampoline_pg_dir,
55 swapper_pg_dir + KERNEL_PGD_BOUNDARY,
56 min_t(unsigned long, KERNEL_PGD_PTRS,
57 KERNEL_PGD_BOUNDARY));