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 | |
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')
-rw-r--r-- | arch/x86/kernel/Makefile | 1 | ||||
-rw-r--r-- | arch/x86/kernel/smpboot.c | 15 | ||||
-rw-r--r-- | arch/x86/kernel/trampoline.c | 18 |
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 | |||
28 | obj-$(CONFIG_X86_64) += pci-nommu_64.o bugs_64.o | 28 | obj-$(CONFIG_X86_64) += pci-nommu_64.o bugs_64.o |
29 | obj-y += tsc_$(BITS).o io_delay.o rtc.o | 29 | obj-y += tsc_$(BITS).o io_delay.o rtc.o |
30 | 30 | ||
31 | obj-$(CONFIG_X86_TRAMPOLINE) += trampoline.o | ||
31 | obj-y += i387.o | 32 | obj-y += i387.o |
32 | obj-y += ptrace.o | 33 | obj-y += ptrace.o |
33 | obj-y += ds.o | 34 | obj-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 | ||
141 | static int boot_cpu_logical_apicid; | 141 | static int boot_cpu_logical_apicid; |
142 | 142 | ||
143 | /* ready for x86_64, no harm for x86, since it will overwrite after alloc */ | ||
144 | unsigned 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 */ |
147 | static cpumask_t cpu_sibling_setup_map; | 144 | static 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 | */ | ||
558 | unsigned 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 */ | ||
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 | } | ||