2008-03-21 10:23:19 -04:00
|
|
|
#include <linux/io.h>
|
|
|
|
|
|
|
|
#include <asm/trampoline.h>
|
2008-12-07 18:50:22 -05:00
|
|
|
#include <asm/e820.h>
|
2008-03-21 10:23:19 -04:00
|
|
|
|
2008-05-18 04:18:57 -04:00
|
|
|
/* ready for x86_64 and x86 */
|
2009-09-04 04:16:22 -04:00
|
|
|
unsigned char *__cpuinitdata trampoline_base = __va(TRAMPOLINE_BASE);
|
2008-03-21 10:23:19 -04:00
|
|
|
|
2008-12-07 18:50:22 -05:00
|
|
|
void __init reserve_trampoline_memory(void)
|
|
|
|
{
|
|
|
|
#ifdef CONFIG_X86_32
|
|
|
|
/*
|
|
|
|
* But first pinch a few for the stack/trampoline stuff
|
|
|
|
* FIXME: Don't need the extra page at 4K, but need to fix
|
|
|
|
* trampoline before removing it. (see the GDT stuff)
|
|
|
|
*/
|
|
|
|
reserve_early(PAGE_SIZE, PAGE_SIZE + PAGE_SIZE, "EX TRAMPOLINE");
|
|
|
|
#endif
|
|
|
|
/* Has to be in very low memory so we can execute real-mode AP code. */
|
|
|
|
reserve_early(TRAMPOLINE_BASE, TRAMPOLINE_BASE + TRAMPOLINE_SIZE,
|
|
|
|
"TRAMPOLINE");
|
|
|
|
}
|
|
|
|
|
2008-03-21 10:23:19 -04:00
|
|
|
/*
|
|
|
|
* Currently trivial. Write the real->protected mode
|
|
|
|
* bootstrap into the page concerned. The caller
|
|
|
|
* has made sure it's suitably aligned.
|
|
|
|
*/
|
2009-09-04 04:16:22 -04:00
|
|
|
unsigned long __cpuinit setup_trampoline(void)
|
2008-03-21 10:23:19 -04:00
|
|
|
{
|
2008-12-07 18:50:22 -05:00
|
|
|
memcpy(trampoline_base, trampoline_data, TRAMPOLINE_SIZE);
|
2008-03-21 10:23:19 -04:00
|
|
|
return virt_to_phys(trampoline_base);
|
|
|
|
}
|