summaryrefslogtreecommitdiffstats
path: root/arch/x86/include
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-01-28 15:42:24 +0100
committerIngo Molnar <mingo@elte.hu>2009-01-28 23:20:31 +0100
commitdac5f4121df3c39fdb2ea57acd669a0ae19e46f8 (patch)
treec3dde8b525b1a8e73732bdffdb7e819f4a14fd3a /arch/x86/include
parentdebccb3e77be52cfc26c5a99e123c114c5c72aeb (diff)
x86, apic: untangle the send_IPI_*() jungle
Our send_IPI_*() methods and definitions are a twisted mess: the same symbol is defined to different things depending on .config details, in a non-transparent way. - spread out the quirks into separately named per apic driver methods - prefix the standard PC methods with default_ - get rid of wrapper macro obfuscation - clean up various details Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/include')
-rw-r--r--arch/x86/include/asm/bigsmp/ipi.h16
-rw-r--r--arch/x86/include/asm/es7000/ipi.h16
-rw-r--r--arch/x86/include/asm/hw_irq.h4
-rw-r--r--arch/x86/include/asm/ipi.h38
-rw-r--r--arch/x86/include/asm/mach-default/mach_apic.h1
-rw-r--r--arch/x86/include/asm/mach-default/mach_ipi.h40
-rw-r--r--arch/x86/include/asm/mach-generic/mach_ipi.h4
-rw-r--r--arch/x86/include/asm/numaq/ipi.h16
-rw-r--r--arch/x86/include/asm/summit/ipi.h16
9 files changed, 71 insertions, 80 deletions
diff --git a/arch/x86/include/asm/bigsmp/ipi.h b/arch/x86/include/asm/bigsmp/ipi.h
index 27fcd01b3ae..a91db69cda6 100644
--- a/arch/x86/include/asm/bigsmp/ipi.h
+++ b/arch/x86/include/asm/bigsmp/ipi.h
@@ -1,22 +1,22 @@
#ifndef __ASM_MACH_IPI_H
#define __ASM_MACH_IPI_H
-void send_IPI_mask_sequence(const struct cpumask *mask, int vector);
-void send_IPI_mask_allbutself(const struct cpumask *mask, int vector);
+void default_send_IPI_mask_sequence(const struct cpumask *mask, int vector);
+void default_send_IPI_mask_allbutself(const struct cpumask *mask, int vector);
-static inline void send_IPI_mask(const struct cpumask *mask, int vector)
+static inline void default_send_IPI_mask(const struct cpumask *mask, int vector)
{
- send_IPI_mask_sequence(mask, vector);
+ default_send_IPI_mask_sequence(mask, vector);
}
-static inline void send_IPI_allbutself(int vector)
+static inline void bigsmp_send_IPI_allbutself(int vector)
{
- send_IPI_mask_allbutself(cpu_online_mask, vector);
+ default_send_IPI_mask_allbutself(cpu_online_mask, vector);
}
-static inline void send_IPI_all(int vector)
+static inline void bigsmp_send_IPI_all(int vector)
{
- send_IPI_mask(cpu_online_mask, vector);
+ default_send_IPI_mask(cpu_online_mask, vector);
}
#endif /* __ASM_MACH_IPI_H */
diff --git a/arch/x86/include/asm/es7000/ipi.h b/arch/x86/include/asm/es7000/ipi.h
index 7e8ed24d4b8..81e77c812ba 100644
--- a/arch/x86/include/asm/es7000/ipi.h
+++ b/arch/x86/include/asm/es7000/ipi.h
@@ -1,22 +1,22 @@
#ifndef __ASM_ES7000_IPI_H
#define __ASM_ES7000_IPI_H
-void send_IPI_mask_sequence(const struct cpumask *mask, int vector);
-void send_IPI_mask_allbutself(const struct cpumask *mask, int vector);
+void default_send_IPI_mask_sequence(const struct cpumask *mask, int vector);
+void default_send_IPI_mask_allbutself(const struct cpumask *mask, int vector);
-static inline void send_IPI_mask(const struct cpumask *mask, int vector)
+static inline void es7000_send_IPI_mask(const struct cpumask *mask, int vector)
{
- send_IPI_mask_sequence(mask, vector);
+ default_send_IPI_mask_sequence(mask, vector);
}
-static inline void send_IPI_allbutself(int vector)
+static inline void es7000_send_IPI_allbutself(int vector)
{
- send_IPI_mask_allbutself(cpu_online_mask, vector);
+ default_send_IPI_mask_allbutself(cpu_online_mask, vector);
}
-static inline void send_IPI_all(int vector)
+static inline void es7000_send_IPI_all(int vector)
{
- send_IPI_mask(cpu_online_mask, vector);
+ es7000_send_IPI_mask(cpu_online_mask, vector);
}
#endif /* __ASM_ES7000_IPI_H */
diff --git a/arch/x86/include/asm/hw_irq.h b/arch/x86/include/asm/hw_irq.h
index 8de644b6b95..bfa921fad13 100644
--- a/arch/x86/include/asm/hw_irq.h
+++ b/arch/x86/include/asm/hw_irq.h
@@ -73,9 +73,9 @@ extern void enable_IO_APIC(void);
/* IPI functions */
#ifdef CONFIG_X86_32
-extern void send_IPI_self(int vector);
+extern void default_send_IPI_self(int vector);
#endif
-extern void send_IPI(int dest, int vector);
+extern void default_send_IPI(int dest, int vector);
/* Statistics */
extern atomic_t irq_err_count;
diff --git a/arch/x86/include/asm/ipi.h b/arch/x86/include/asm/ipi.h
index c745a306f7d..a8d717f2c7e 100644
--- a/arch/x86/include/asm/ipi.h
+++ b/arch/x86/include/asm/ipi.h
@@ -55,8 +55,9 @@ static inline void __xapic_wait_icr_idle(void)
cpu_relax();
}
-static inline void __send_IPI_shortcut(unsigned int shortcut, int vector,
- unsigned int dest)
+static inline void
+__default_send_IPI_shortcut(unsigned int shortcut,
+ int vector, unsigned int dest)
{
/*
* Subtle. In the case of the 'never do double writes' workaround
@@ -87,8 +88,8 @@ static inline void __send_IPI_shortcut(unsigned int shortcut, int vector,
* This is used to send an IPI with no shorthand notation (the destination is
* specified in bits 56 to 63 of the ICR).
*/
-static inline void __send_IPI_dest_field(unsigned int mask, int vector,
- unsigned int dest)
+static inline void
+ __default_send_IPI_dest_field(unsigned int mask, int vector, unsigned int dest)
{
unsigned long cfg;
@@ -117,11 +118,11 @@ static inline void __send_IPI_dest_field(unsigned int mask, int vector,
native_apic_mem_write(APIC_ICR, cfg);
}
-static inline void send_IPI_mask_sequence(const struct cpumask *mask,
- int vector)
+static inline void
+default_send_IPI_mask_sequence(const struct cpumask *mask, int vector)
{
- unsigned long flags;
unsigned long query_cpu;
+ unsigned long flags;
/*
* Hack. The clustered APIC addressing mode doesn't allow us to send
@@ -130,27 +131,28 @@ static inline void send_IPI_mask_sequence(const struct cpumask *mask,
*/
local_irq_save(flags);
for_each_cpu(query_cpu, mask) {
- __send_IPI_dest_field(per_cpu(x86_cpu_to_apicid, query_cpu),
- vector, APIC_DEST_PHYSICAL);
+ __default_send_IPI_dest_field(per_cpu(x86_cpu_to_apicid,
+ query_cpu), vector, APIC_DEST_PHYSICAL);
}
local_irq_restore(flags);
}
-static inline void send_IPI_mask_allbutself(const struct cpumask *mask,
- int vector)
+static inline void
+default_send_IPI_mask_allbutself(const struct cpumask *mask, int vector)
{
- unsigned long flags;
- unsigned int query_cpu;
unsigned int this_cpu = smp_processor_id();
+ unsigned int query_cpu;
+ unsigned long flags;
/* See Hack comment above */
local_irq_save(flags);
- for_each_cpu(query_cpu, mask)
- if (query_cpu != this_cpu)
- __send_IPI_dest_field(
- per_cpu(x86_cpu_to_apicid, query_cpu),
- vector, APIC_DEST_PHYSICAL);
+ for_each_cpu(query_cpu, mask) {
+ if (query_cpu == this_cpu)
+ continue;
+ __default_send_IPI_dest_field(per_cpu(x86_cpu_to_apicid,
+ query_cpu), vector, APIC_DEST_PHYSICAL);
+ }
local_irq_restore(flags);
}
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h
index 8972f843414..2e4104cf348 100644
--- a/arch/x86/include/asm/mach-default/mach_apic.h
+++ b/arch/x86/include/asm/mach-default/mach_apic.h
@@ -20,7 +20,6 @@ static inline const struct cpumask *default_target_cpus(void)
#ifdef CONFIG_X86_64
#include <asm/genapic.h>
#define read_apic_id() (apic->get_apic_id(apic_read(APIC_ID)))
-#define send_IPI_self (apic->send_IPI_self)
#define wakeup_secondary_cpu (apic->wakeup_cpu)
extern void default_setup_apic_routing(void);
#else
diff --git a/arch/x86/include/asm/mach-default/mach_ipi.h b/arch/x86/include/asm/mach-default/mach_ipi.h
index 089399643df..85dec630c69 100644
--- a/arch/x86/include/asm/mach-default/mach_ipi.h
+++ b/arch/x86/include/asm/mach-default/mach_ipi.h
@@ -4,45 +4,40 @@
/* Avoid include hell */
#define NMI_VECTOR 0x02
-void send_IPI_mask_bitmask(const struct cpumask *mask, int vector);
-void send_IPI_mask_allbutself(const struct cpumask *mask, int vector);
-void __send_IPI_shortcut(unsigned int shortcut, int vector);
+void default_send_IPI_mask_bitmask(const struct cpumask *mask, int vector);
+void default_send_IPI_mask_allbutself(const struct cpumask *mask, int vector);
+void __default_send_IPI_shortcut(unsigned int shortcut, int vector);
extern int no_broadcast;
#ifdef CONFIG_X86_64
#include <asm/genapic.h>
-#define send_IPI_mask (apic->send_IPI_mask)
-#define send_IPI_mask_allbutself (apic->send_IPI_mask_allbutself)
#else
-static inline void send_IPI_mask(const struct cpumask *mask, int vector)
+static inline void default_send_IPI_mask(const struct cpumask *mask, int vector)
{
- send_IPI_mask_bitmask(mask, vector);
+ default_send_IPI_mask_bitmask(mask, vector);
}
-void send_IPI_mask_allbutself(const struct cpumask *mask, int vector);
+void default_send_IPI_mask_allbutself(const struct cpumask *mask, int vector);
#endif
-static inline void __local_send_IPI_allbutself(int vector)
+static inline void __default_local_send_IPI_allbutself(int vector)
{
if (no_broadcast || vector == NMI_VECTOR)
- send_IPI_mask_allbutself(cpu_online_mask, vector);
+ apic->send_IPI_mask_allbutself(cpu_online_mask, vector);
else
- __send_IPI_shortcut(APIC_DEST_ALLBUT, vector);
+ __default_send_IPI_shortcut(APIC_DEST_ALLBUT, vector);
}
-static inline void __local_send_IPI_all(int vector)
+static inline void __default_local_send_IPI_all(int vector)
{
if (no_broadcast || vector == NMI_VECTOR)
- send_IPI_mask(cpu_online_mask, vector);
+ apic->send_IPI_mask(cpu_online_mask, vector);
else
- __send_IPI_shortcut(APIC_DEST_ALLINC, vector);
+ __default_send_IPI_shortcut(APIC_DEST_ALLINC, vector);
}
-#ifdef CONFIG_X86_64
-#define send_IPI_allbutself (apic->send_IPI_allbutself)
-#define send_IPI_all (apic->send_IPI_all)
-#else
-static inline void send_IPI_allbutself(int vector)
+#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
@@ -51,13 +46,12 @@ static inline void send_IPI_allbutself(int vector)
if (!(num_online_cpus() > 1))
return;
- __local_send_IPI_allbutself(vector);
- return;
+ __default_local_send_IPI_allbutself(vector);
}
-static inline void send_IPI_all(int vector)
+static inline void default_send_IPI_all(int vector)
{
- __local_send_IPI_all(vector);
+ __default_local_send_IPI_all(vector);
}
#endif
diff --git a/arch/x86/include/asm/mach-generic/mach_ipi.h b/arch/x86/include/asm/mach-generic/mach_ipi.h
index 75e54bd6cbd..5691c09645c 100644
--- a/arch/x86/include/asm/mach-generic/mach_ipi.h
+++ b/arch/x86/include/asm/mach-generic/mach_ipi.h
@@ -3,8 +3,4 @@
#include <asm/genapic.h>
-#define send_IPI_mask (apic->send_IPI_mask)
-#define send_IPI_allbutself (apic->send_IPI_allbutself)
-#define send_IPI_all (apic->send_IPI_all)
-
#endif /* _ASM_X86_MACH_GENERIC_MACH_IPI_H */
diff --git a/arch/x86/include/asm/numaq/ipi.h b/arch/x86/include/asm/numaq/ipi.h
index a8374c65277..5dbc4b4cd5e 100644
--- a/arch/x86/include/asm/numaq/ipi.h
+++ b/arch/x86/include/asm/numaq/ipi.h
@@ -1,22 +1,22 @@
#ifndef __ASM_NUMAQ_IPI_H
#define __ASM_NUMAQ_IPI_H
-void send_IPI_mask_sequence(const struct cpumask *mask, int vector);
-void send_IPI_mask_allbutself(const struct cpumask *mask, int vector);
+void default_send_IPI_mask_sequence(const struct cpumask *mask, int vector);
+void default_send_IPI_mask_allbutself(const struct cpumask *mask, int vector);
-static inline void send_IPI_mask(const struct cpumask *mask, int vector)
+static inline void numaq_send_IPI_mask(const struct cpumask *mask, int vector)
{
- send_IPI_mask_sequence(mask, vector);
+ default_send_IPI_mask_sequence(mask, vector);
}
-static inline void send_IPI_allbutself(int vector)
+static inline void numaq_send_IPI_allbutself(int vector)
{
- send_IPI_mask_allbutself(cpu_online_mask, vector);
+ default_send_IPI_mask_allbutself(cpu_online_mask, vector);
}
-static inline void send_IPI_all(int vector)
+static inline void numaq_send_IPI_all(int vector)
{
- send_IPI_mask(cpu_online_mask, vector);
+ numaq_send_IPI_mask(cpu_online_mask, vector);
}
#endif /* __ASM_NUMAQ_IPI_H */
diff --git a/arch/x86/include/asm/summit/ipi.h b/arch/x86/include/asm/summit/ipi.h
index a8a2c24f50c..f87a43fe0ae 100644
--- a/arch/x86/include/asm/summit/ipi.h
+++ b/arch/x86/include/asm/summit/ipi.h
@@ -1,26 +1,26 @@
#ifndef __ASM_SUMMIT_IPI_H
#define __ASM_SUMMIT_IPI_H
-void send_IPI_mask_sequence(const cpumask_t *mask, int vector);
-void send_IPI_mask_allbutself(const cpumask_t *mask, int vector);
+void default_send_IPI_mask_sequence(const cpumask_t *mask, int vector);
+void default_send_IPI_mask_allbutself(const cpumask_t *mask, int vector);
-static inline void send_IPI_mask(const cpumask_t *mask, int vector)
+static inline void summit_send_IPI_mask(const cpumask_t *mask, int vector)
{
- send_IPI_mask_sequence(mask, vector);
+ default_send_IPI_mask_sequence(mask, vector);
}
-static inline void send_IPI_allbutself(int vector)
+static inline void summit_send_IPI_allbutself(int vector)
{
cpumask_t mask = cpu_online_map;
cpu_clear(smp_processor_id(), mask);
if (!cpus_empty(mask))
- send_IPI_mask(&mask, vector);
+ summit_send_IPI_mask(&mask, vector);
}
-static inline void send_IPI_all(int vector)
+static inline void summit_send_IPI_all(int vector)
{
- send_IPI_mask(&cpu_online_map, vector);
+ summit_send_IPI_mask(&cpu_online_map, vector);
}
#endif /* __ASM_SUMMIT_IPI_H */