aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/include/asm/ipi.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-01-28 19:14:52 +0100
committerIngo Molnar <mingo@elte.hu>2009-01-29 14:16:49 +0100
commitd53e2f2855f1c7c2725d550c1ae6b26f4d671c50 (patch)
treef749e169c6b8099428cb3aa3f0aa1412ce6e1a17 /arch/x86/include/asm/ipi.h
parent9f4187f0a3b93fc215b4472063b6c0b44364e60c (diff)
x86, smp: remove mach_ipi.h
Move mach_ipi.h definitions into genapic.h. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/include/asm/ipi.h')
-rw-r--r--arch/x86/include/asm/ipi.h61
1 files changed, 59 insertions, 2 deletions
diff --git a/arch/x86/include/asm/ipi.h b/arch/x86/include/asm/ipi.h
index a8d717f2c7e..e2e8e4e0a65 100644
--- a/arch/x86/include/asm/ipi.h
+++ b/arch/x86/include/asm/ipi.h
@@ -1,6 +1,8 @@
#ifndef _ASM_X86_IPI_H
#define _ASM_X86_IPI_H
+#ifdef CONFIG_X86_LOCAL_APIC
+
/*
* Copyright 2004 James Cleverdon, IBM.
* Subject to the GNU Public License, v.2
@@ -56,8 +58,7 @@ static inline void __xapic_wait_icr_idle(void)
}
static inline void
-__default_send_IPI_shortcut(unsigned int shortcut,
- int vector, unsigned int dest)
+__default_send_IPI_shortcut(unsigned int shortcut, int vector, unsigned int dest)
{
/*
* Subtle. In the case of the 'never do double writes' workaround
@@ -156,4 +157,60 @@ default_send_IPI_mask_allbutself(const struct cpumask *mask, int vector)
local_irq_restore(flags);
}
+
+/* Avoid include hell */
+#define NMI_VECTOR 0x02
+
+void default_send_IPI_mask_bitmask(const struct cpumask *mask, int vector);
+void default_send_IPI_mask_allbutself(const struct cpumask *mask, int vector);
+
+extern int no_broadcast;
+
+#ifdef CONFIG_X86_64
+#include <asm/genapic.h>
+#else
+static inline void default_send_IPI_mask(const struct cpumask *mask, int vector)
+{
+ default_send_IPI_mask_bitmask(mask, vector);
+}
+void default_send_IPI_mask_allbutself(const struct cpumask *mask, int vector);
+#endif
+
+static inline void __default_local_send_IPI_allbutself(int vector)
+{
+ if (no_broadcast || vector == NMI_VECTOR)
+ apic->send_IPI_mask_allbutself(cpu_online_mask, vector);
+ else
+ __default_send_IPI_shortcut(APIC_DEST_ALLBUT, vector, apic->dest_logical);
+}
+
+static inline void __default_local_send_IPI_all(int vector)
+{
+ if (no_broadcast || vector == NMI_VECTOR)
+ apic->send_IPI_mask(cpu_online_mask, vector);
+ else
+ __default_send_IPI_shortcut(APIC_DEST_ALLINC, vector, apic->dest_logical);
+}
+
+#ifdef CONFIG_X86_32
+static inline void default_send_IPI_allbutself(int vector)
+{
+ /*
+ * if there are no other CPUs in the system then we get an APIC send
+ * error if we try to broadcast, thus avoid sending IPIs in this case.
+ */
+ if (!(num_online_cpus() > 1))
+ return;
+
+ __default_local_send_IPI_allbutself(vector);
+}
+
+static inline void default_send_IPI_all(int vector)
+{
+ __default_local_send_IPI_all(vector);
+}
+#endif
+
+#endif
+
#endif /* _ASM_X86_IPI_H */