[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] x86: remove open-coded IO-APIC RTE reads/writes


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-unstable <patchbot@xxxxxxx>
  • Date: Wed, 19 Sep 2012 16:22:09 +0000
  • Delivery-date: Wed, 19 Sep 2012 16:22:21 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxx>
# Date 1348039850 -7200
# Node ID 7b045d43e59dcb42340097058502bf456e151180
# Parent  3e3959413b2fbef584993beb434285d0691d5c67
x86: remove open-coded IO-APIC RTE reads/writes

This improves readability, not the least through doing away with a
couple of ugly casts.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Acked-by: Keir Fraser <keir@xxxxxxx>
---


diff -r 3e3959413b2f -r 7b045d43e59d xen/arch/x86/io_apic.c
--- a/xen/arch/x86/io_apic.c    Wed Sep 19 09:27:55 2012 +0200
+++ b/xen/arch/x86/io_apic.c    Wed Sep 19 09:30:50 2012 +0200
@@ -225,9 +225,8 @@ void __ioapic_write_entry(
 {
     void (*write)(unsigned int, unsigned int, unsigned int)
         = raw ? __io_apic_write : io_apic_write;
-    union entry_union eu = {{0, 0}};
+    union entry_union eu = { .entry = e };
 
-    eu.entry = e;
     (*write)(apic, 0x11 + 2*pin, eu.w2);
     (*write)(apic, 0x10 + 2*pin, eu.w1);
 }
@@ -2384,8 +2383,7 @@ int ioapic_guest_write(unsigned long phy
     SET_DEST(rte.dest.dest32, rte.dest.logical.logical_dest,
              cpu_mask_to_apicid(desc->arch.cpu_mask));
 
-    io_apic_write(apic, 0x10 + 2 * pin, *(((int *)&rte) + 0));
-    io_apic_write(apic, 0x11 + 2 * pin, *(((int *)&rte) + 1));
+    __ioapic_write_entry(apic, pin, 0, rte);
     
     spin_unlock_irqrestore(&ioapic_lock, flags);
 
@@ -2414,7 +2412,6 @@ void dump_ioapic_irq_info(void)
     struct irq_pin_list *entry;
     struct IO_APIC_route_entry rte;
     unsigned int irq, pin, printed = 0;
-    unsigned long flags;
 
     if ( !irq_2_pin )
         return;
@@ -2436,10 +2433,7 @@ void dump_ioapic_irq_info(void)
 
             printk("      Apic 0x%02x, Pin %2d: ", entry->apic, pin);
 
-            spin_lock_irqsave(&ioapic_lock, flags);
-            *(((int *)&rte) + 0) = io_apic_read(entry->apic, 0x10 + 2 * pin);
-            *(((int *)&rte) + 1) = io_apic_read(entry->apic, 0x11 + 2 * pin);
-            spin_unlock_irqrestore(&ioapic_lock, flags);
+            rte = ioapic_read_entry(entry->apic, pin, 0);
 
             printk("vec=%02x delivery=%-5s dest=%c status=%d "
                    "polarity=%d irr=%d trig=%c mask=%d dest_id:%d\n",

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.