diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-03-21 10:23:19 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-17 11:41:37 -0400 |
commit | 77ad386e596c6b0930cc2e09e3cce485e3ee7f72 (patch) | |
tree | 5c4a9b664c8ecf8147996a32eae35ff7e7350f89 /arch/x86/kernel/trampoline.c | |
parent | e44b7b7525ad9d43163ab5e60c784325419e0ea6 (diff) |
x86: standalone trampoline code
move the trampoline setup code out of smpboot.c - UP kernels can have
suspend support too.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/trampoline.c')
-rw-r--r-- | arch/x86/kernel/trampoline.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/x86/kernel/trampoline.c b/arch/x86/kernel/trampoline.c new file mode 100644 index 000000000000..abbf199adebb --- /dev/null +++ b/arch/x86/kernel/trampoline.c | |||
@@ -0,0 +1,18 @@ | |||
1 | #include <linux/io.h> | ||
2 | |||
3 | #include <asm/trampoline.h> | ||
4 | |||
5 | /* ready for x86_64, no harm for x86, since it will overwrite after alloc */ | ||
6 | unsigned char *trampoline_base = __va(TRAMPOLINE_BASE); | ||
7 | |||
8 | /* | ||
9 | * Currently trivial. Write the real->protected mode | ||
10 | * bootstrap into the page concerned. The caller | ||
11 | * has made sure it's suitably aligned. | ||
12 | */ | ||
13 | unsigned long setup_trampoline(void) | ||
14 | { | ||
15 | memcpy(trampoline_base, trampoline_data, | ||
16 | trampoline_end - trampoline_data); | ||
17 | return virt_to_phys(trampoline_base); | ||
18 | } | ||