Commit 00047bcc authored by Martin J. Bligh's avatar Martin J. Bligh Committed by Patrick Mochel

[PATCH] cleanup IPI code

Reformat the IPI stuff, specifically send_IPI_mask, send_IPI_allbutself,
and send_IPI_all.  Though the way they work is pretty silly for NUMA-Q,
I do an equivalent transform here, and fix the code in a seperate patch
(next one).  Goes into mach_ipi.h
parent 37d1206a
......@@ -24,6 +24,7 @@
#include <asm/pgalloc.h>
#include <asm/tlbflush.h>
#include <asm/smpboot.h>
#include <mach_ipi.h>
/*
* Some notes on x86 processor bugs affecting SMP operation:
......@@ -227,54 +228,6 @@ static inline void send_IPI_mask_sequence(int mask, int vector)
local_irq_restore(flags);
}
static inline void send_IPI_mask(int mask, int vector)
{
if (clustered_apic_mode)
send_IPI_mask_sequence(mask, vector);
else
send_IPI_mask_bitmask(mask, vector);
}
static inline void 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 we have to avoid sending IPIs in this case.
*/
if (!(num_online_cpus() > 1))
return;
if (clustered_apic_mode) {
// Pointless. Use send_IPI_mask to do this instead
int cpu;
for (cpu = 0; cpu < NR_CPUS; ++cpu) {
if (cpu_online(cpu) && cpu != smp_processor_id())
send_IPI_mask(1 << cpu, vector);
}
} else {
__send_IPI_shortcut(APIC_DEST_ALLBUT, vector);
return;
}
}
static inline void send_IPI_all(int vector)
{
if (clustered_apic_mode) {
// Pointless. Use send_IPI_mask to do this instead
int cpu;
for (cpu = 0; cpu < NR_CPUS; ++cpu) {
if (!cpu_online(cpu))
continue;
send_IPI_mask(1 << cpu, vector);
}
} else {
__send_IPI_shortcut(APIC_DEST_ALLINC, vector);
}
}
/*
* Smarter SMP flushing macros.
* c/o Linus Torvalds.
......
#ifndef __ASM_MACH_IPI_H
#define __ASM_MACH_IPI_H
static inline void send_IPI_mask_bitmask(int mask, int vector);
static inline void __send_IPI_shortcut(unsigned int shortcut, int vector);
static inline void send_IPI_mask(int mask, int vector)
{
send_IPI_mask_bitmask(mask, vector);
}
static inline void 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;
__send_IPI_shortcut(APIC_DEST_ALLBUT, vector);
return;
}
static inline void send_IPI_all(int vector)
{
__send_IPI_shortcut(APIC_DEST_ALLINC, vector);
}
#endif /* __ASM_MACH_IPI_H */
#ifndef __ASM_MACH_IPI_H
#define __ASM_MACH_IPI_H
static inline void send_IPI_mask_sequence(int mask, int vector);
static inline void send_IPI_mask(int mask, int vector)
{
send_IPI_mask_sequence(mask, vector);
}
static inline void send_IPI_allbutself(int vector)
{
int cpu;
/*
* 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;
/* Pointless. Use send_IPI_mask to do this instead */
for (cpu = 0; cpu < NR_CPUS; ++cpu)
if (cpu_online(cpu) && cpu != smp_processor_id())
send_IPI_mask(1 << cpu, vector);
return;
}
static inline void send_IPI_all(int vector)
{
int cpu;
/* Pointless. Use send_IPI_mask to do this instead */
for (cpu = 0; cpu < NR_CPUS; ++cpu)
if (cpu_online(cpu))
send_IPI_mask(1 << cpu, vector);
}
#endif /* __ASM_MACH_IPI_H */
#ifndef __ASM_MACH_IPI_H
#define __ASM_MACH_IPI_H
static inline void send_IPI_mask_sequence(int mask, int vector);
static inline void send_IPI_mask(int mask, int vector)
{
send_IPI_mask_sequence(mask, vector);
}
static inline void send_IPI_allbutself(int vector)
{
int cpu;
/*
* 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;
/* Pointless. Use send_IPI_mask to do this instead */
for (cpu = 0; cpu < NR_CPUS; ++cpu)
if (cpu_online(cpu) && cpu != smp_processor_id())
send_IPI_mask(1 << cpu, vector);
return;
}
static inline void send_IPI_all(int vector)
{
int cpu;
/* Pointless. Use send_IPI_mask to do this instead */
for (cpu = 0; cpu < NR_CPUS; ++cpu)
if (cpu_online(cpu))
send_IPI_mask(1 << cpu, vector);
}
#endif /* __ASM_MACH_IPI_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment