x86: unify setup_trampoline
setup_trampoline() looks very similar between architectures, and this
patch unifies them. The i386 version allocates bootmem memory, while
the x86_64 version uses a fixed address.
In this patch, we initialize the global trampoline_base to the x86_64 version,
and i386 allocation can later override it.
Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
diff --git a/include/asm-x86/smp.h b/include/asm-x86/smp.h
index b2a1697..513c857 100644
--- a/include/asm-x86/smp.h
+++ b/include/asm-x86/smp.h
@@ -14,6 +14,7 @@
*/
extern const unsigned char trampoline_data [];
extern const unsigned char trampoline_end [];
+extern unsigned char *trampoline_base;
struct smp_ops {
void (*smp_prepare_boot_cpu)(void);
@@ -81,6 +82,9 @@
extern unsigned disabled_cpus;
extern void prefill_possible_map(void);
+
+#define SMP_TRAMPOLINE_BASE 0x6000
+extern unsigned long setup_trampoline(void);
#endif
#ifdef CONFIG_X86_32
diff --git a/include/asm-x86/smp_64.h b/include/asm-x86/smp_64.h
index d554d7d..394c785 100644
--- a/include/asm-x86/smp_64.h
+++ b/include/asm-x86/smp_64.h
@@ -40,8 +40,6 @@
#ifdef CONFIG_SMP
-#define SMP_TRAMPOLINE_BASE 0x6000
-
#define raw_smp_processor_id() read_pda(cpunumber)
#define cpu_physical_id(cpu) per_cpu(x86_cpu_to_apicid, cpu)