aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@suse.de>2006-07-01 04:36:18 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-01 09:56:02 -0700
commit8ec4d41f88872e6a5980558e362c0174dce54e40 (patch)
treef02eaf6b61832ded30bc19bd8e5d8494d91f8bc6 /arch/i386
parent27b678dd04a636f2c351816f4b3042c8815d4e9d (diff)
downloadlinux-8ec4d41f88872e6a5980558e362c0174dce54e40.tar.gz
[PATCH] SMP alternatives: skip with UP kernels
Hide the magic in alternative.h and provide some dummy inline functions for the UP case (gcc should manage to optimize away these calls). No changes in module.c. Cc: Dave Jones <davej@codemonkey.org.uk> Cc: Andi Kleen <ak@muc.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/i386')
-rw-r--r--arch/i386/kernel/alternative.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/i386/kernel/alternative.c b/arch/i386/kernel/alternative.c
index 50eb0e03777e4b..7b421b3a053e0c 100644
--- a/arch/i386/kernel/alternative.c
+++ b/arch/i386/kernel/alternative.c
@@ -168,6 +168,8 @@ void apply_alternatives(struct alt_instr *start, struct alt_instr *end)
}
}
+#ifdef CONFIG_SMP
+
static void alternatives_smp_save(struct alt_instr *start, struct alt_instr *end)
{
struct alt_instr *a;
@@ -328,6 +330,8 @@ void alternatives_smp_switch(int smp)
spin_unlock_irqrestore(&smp_alt, flags);
}
+#endif
+
void __init alternative_instructions(void)
{
if (no_replacement) {
@@ -349,6 +353,7 @@ void __init alternative_instructions(void)
smp_alt_once = 1;
#endif
+#ifdef CONFIG_SMP
if (smp_alt_once) {
if (1 == num_possible_cpus()) {
printk(KERN_INFO "SMP alternatives: switching to UP code\n");
@@ -370,4 +375,5 @@ void __init alternative_instructions(void)
_text, _etext);
alternatives_smp_switch(0);
}
+#endif
}