aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-03-21 10:23:19 -0400
committerIngo Molnar <mingo@elte.hu>2008-04-17 11:41:37 -0400
commit77ad386e596c6b0930cc2e09e3cce485e3ee7f72 (patch)
tree5c4a9b664c8ecf8147996a32eae35ff7e7350f89 /arch/x86
parente44b7b7525ad9d43163ab5e60c784325419e0ea6 (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')
-rw-r--r--arch/x86/kernel/Makefile1
-rw-r--r--arch/x86/kernel/smpboot.c15
-rw-r--r--arch/x86/kernel/trampoline.c18
3 files changed, 19 insertions, 15 deletions
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
index fdd8395e0ed3..530ed6a4a031 100644
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
@@ -28,6 +28,7 @@ obj-y += alternative.o i8253.o
28obj-$(CONFIG_X86_64) += pci-nommu_64.o bugs_64.o 28obj-$(CONFIG_X86_64) += pci-nommu_64.o bugs_64.o
29obj-y += tsc_$(BITS).o io_delay.o rtc.o 29obj-y += tsc_$(BITS).o io_delay.o rtc.o
30 30
31obj-$(CONFIG_X86_TRAMPOLINE) += trampoline.o
31obj-y += i387.o 32obj-y += i387.o
32obj-y += ptrace.o 33obj-y += ptrace.o
33obj-y += ds.o 34obj-y += ds.o
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 424600e671bd..e6abe8a49b1f 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -140,9 +140,6 @@ static atomic_t init_deasserted;
140 140
141static int boot_cpu_logical_apicid; 141static int boot_cpu_logical_apicid;
142 142
143/* ready for x86_64, no harm for x86, since it will overwrite after alloc */
144unsigned char *trampoline_base = __va(TRAMPOLINE_BASE);
145
146/* representing cpus for which sibling maps can be computed */ 143/* representing cpus for which sibling maps can be computed */
147static cpumask_t cpu_sibling_setup_map; 144static cpumask_t cpu_sibling_setup_map;
148 145
@@ -550,18 +547,6 @@ cpumask_t cpu_coregroup_map(int cpu)
550 return c->llc_shared_map; 547 return c->llc_shared_map;
551} 548}
552 549
553/*
554 * Currently trivial. Write the real->protected mode
555 * bootstrap into the page concerned. The caller
556 * has made sure it's suitably aligned.
557 */
558unsigned long setup_trampoline(void)
559{
560 memcpy(trampoline_base, trampoline_data,
561 trampoline_end - trampoline_data);
562 return virt_to_phys(trampoline_base);
563}
564
565#ifdef CONFIG_X86_32 550#ifdef CONFIG_X86_32
566/* 551/*
567 * We are called very early to get the low memory for the 552 * We are called very early to get the low memory for the
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 */
6unsigned 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 */
13unsigned long setup_trampoline(void)
14{
15 memcpy(trampoline_base, trampoline_data,
16 trampoline_end - trampoline_data);
17 return virt_to_phys(trampoline_base);
18}