aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/io_apic.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2011-08-16 15:05:55 +0100
committerJan Beulich <jbeulich@novell.com>2011-08-16 15:05:55 +0100
commit2f399b3bb0cae8072ed42856eac6a805728516fe (patch)
tree57f48505fe3582c013a5abb9aaf7ae733aae5e23 /xen/arch/x86/io_apic.c
parent71abd26c352d6876f60050a2c624dc60e2ac01e3 (diff)
downloadxen-2f399b3bb0cae8072ed42856eac6a805728516fe.tar.gz
xen-2f399b3bb0cae8072ed42856eac6a805728516fe.tar.bz2
xen-2f399b3bb0cae8072ed42856eac6a805728516fe.zip
x86: simplify (and fix) clear_IO_APIC{,_pin}()
These are used during bootup and (emergency) shutdown only, and their only purpose is to get the actual IO-APIC's RTE(s) cleared. Consequently, only the "raw" accessors should be used (and the ones going through interrupt remapping code can be skipped), with the exception of determining the delivery mode: This one must always go through the interrupt remapping path, as in the VT-d case the actual IO-APIC's RTE will have the delivery mode always set to zero (which before possibly could have resulted in such an entry getting cleared in the "raw" pass, though I haven't observed this case in practice). Signed-off-by: Jan Beulich <jbeulich@novell.com>
Diffstat (limited to 'xen/arch/x86/io_apic.c')
-rw-r--r--xen/arch/x86/io_apic.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index 411e726b67..09caaf45de 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -372,14 +372,12 @@ static void eoi_IO_APIC_irq(unsigned int irq)
spin_unlock_irqrestore(&ioapic_lock, flags);
}
-#define clear_IO_APIC_pin(a,p) __clear_IO_APIC_pin(a,p,0)
-#define clear_IO_APIC_pin_raw(a,p) __clear_IO_APIC_pin(a,p,1)
-static void __clear_IO_APIC_pin(unsigned int apic, unsigned int pin, int raw)
+static void clear_IO_APIC_pin(unsigned int apic, unsigned int pin)
{
struct IO_APIC_route_entry entry;
/* Check delivery_mode to be sure we're not clearing an SMI pin */
- entry = ioapic_read_entry(apic, pin, raw);
+ entry = __ioapic_read_entry(apic, pin, FALSE);
if (entry.delivery_mode == dest_SMI)
return;
@@ -388,7 +386,7 @@ static void __clear_IO_APIC_pin(unsigned int apic, unsigned int pin, int raw)
*/
memset(&entry, 0, sizeof(entry));
entry.mask = 1;
- ioapic_write_entry(apic, pin, raw, entry);
+ __ioapic_write_entry(apic, pin, TRUE, entry);
}
static void clear_IO_APIC (void)
@@ -396,10 +394,8 @@ static void clear_IO_APIC (void)
int apic, pin;
for (apic = 0; apic < nr_ioapics; apic++) {
- for (pin = 0; pin < nr_ioapic_registers[apic]; pin++) {
+ for (pin = 0; pin < nr_ioapic_registers[apic]; pin++)
clear_IO_APIC_pin(apic, pin);
- clear_IO_APIC_pin_raw(apic, pin);
- }
}
}