x86, numa: Reduce minimum fake node size to 32M
[linux/fpc-iii.git] / arch / x86 / kernel / trampoline.c
bloba375616d77f787f692e625b8a2ab70de05cfbb9a
1 #include <linux/io.h>
2 #include <linux/memblock.h>
4 #include <asm/trampoline.h>
5 #include <asm/pgtable.h>
7 #if defined(CONFIG_X86_64) && defined(CONFIG_ACPI_SLEEP)
8 #define __trampinit
9 #define __trampinitdata
10 #else
11 #define __trampinit __cpuinit
12 #define __trampinitdata __cpuinitdata
13 #endif
15 /* ready for x86_64 and x86 */
16 unsigned char *__trampinitdata trampoline_base;
18 void __init reserve_trampoline_memory(void)
20 phys_addr_t mem;
22 /* Has to be in very low memory so we can execute real-mode AP code. */
23 mem = memblock_find_in_range(0, 1<<20, TRAMPOLINE_SIZE, PAGE_SIZE);
24 if (mem == MEMBLOCK_ERROR)
25 panic("Cannot allocate trampoline\n");
27 trampoline_base = __va(mem);
28 memblock_x86_reserve_range(mem, mem + TRAMPOLINE_SIZE, "TRAMPOLINE");
32 * Currently trivial. Write the real->protected mode
33 * bootstrap into the page concerned. The caller
34 * has made sure it's suitably aligned.
36 unsigned long __trampinit setup_trampoline(void)
38 memcpy(trampoline_base, trampoline_data, TRAMPOLINE_SIZE);
39 return virt_to_phys(trampoline_base);