Skip to content

Commit

Permalink
x86: standalone trampoline code
Browse files Browse the repository at this point in the history
move the trampoline setup code out of smpboot.c - UP kernels can have
suspend support too.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Ingo Molnar committed Apr 17, 2008
1 parent e44b7b7 commit 77ad386
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 15 deletions.
1 change: 1 addition & 0 deletions arch/x86/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ obj-y += alternative.o i8253.o
obj-$(CONFIG_X86_64) += pci-nommu_64.o bugs_64.o
obj-y += tsc_$(BITS).o io_delay.o rtc.o

obj-$(CONFIG_X86_TRAMPOLINE) += trampoline.o
obj-y += i387.o
obj-y += ptrace.o
obj-y += ds.o
Expand Down
15 changes: 0 additions & 15 deletions arch/x86/kernel/smpboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,6 @@ static atomic_t init_deasserted;

static int boot_cpu_logical_apicid;

/* ready for x86_64, no harm for x86, since it will overwrite after alloc */
unsigned char *trampoline_base = __va(TRAMPOLINE_BASE);

/* representing cpus for which sibling maps can be computed */
static cpumask_t cpu_sibling_setup_map;

Expand Down Expand Up @@ -550,18 +547,6 @@ cpumask_t cpu_coregroup_map(int cpu)
return c->llc_shared_map;
}

/*
* Currently trivial. Write the real->protected mode
* bootstrap into the page concerned. The caller
* has made sure it's suitably aligned.
*/
unsigned long setup_trampoline(void)
{
memcpy(trampoline_base, trampoline_data,
trampoline_end - trampoline_data);
return virt_to_phys(trampoline_base);
}

#ifdef CONFIG_X86_32
/*
* We are called very early to get the low memory for the
Expand Down
18 changes: 18 additions & 0 deletions arch/x86/kernel/trampoline.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <linux/io.h>

#include <asm/trampoline.h>

/* ready for x86_64, no harm for x86, since it will overwrite after alloc */
unsigned char *trampoline_base = __va(TRAMPOLINE_BASE);

/*
* Currently trivial. Write the real->protected mode
* bootstrap into the page concerned. The caller
* has made sure it's suitably aligned.
*/
unsigned long setup_trampoline(void)
{
memcpy(trampoline_base, trampoline_data,
trampoline_end - trampoline_data);
return virt_to_phys(trampoline_base);
}

0 comments on commit 77ad386

Please sign in to comment.