bug-hurd
[Top][All Lists]
Advanced

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

[PATCH 2/2] ioapic: Fix arg passing of redirection entry


From: Damien Zammit
Subject: [PATCH 2/2] ioapic: Fix arg passing of redirection entry
Date: Mon, 5 Apr 2021 21:59:21 +1000

---
 i386/i386at/ioapic.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/i386/i386at/ioapic.c b/i386/i386at/ioapic.c
index 4d0f4fca..18a9bec6 100644
--- a/i386/i386at/ioapic.c
+++ b/i386/i386at/ioapic.c
@@ -114,15 +114,15 @@ ioapic_write(uint8_t id, uint8_t reg, uint32_t value)
     ioapic->window.r = value;
 }
 
-static struct ioapic_route_entry
-ioapic_read_entry(int apic, int pin)
+static void
+ioapic_read_entry(int apic, int pin, struct ioapic_route_entry *e)
 {
     union ioapic_route_entry_union entry;
 
     entry.lo = ioapic_read(apic, APIC_IO_REDIR_LOW(pin));
     entry.hi = ioapic_read(apic, APIC_IO_REDIR_HIGH(pin));
 
-    return entry.both;
+    *e = entry.both;
 }
 
 /* Write the high word first because mask bit is in low word */
@@ -142,7 +142,7 @@ ioapic_toggle_entry(int apic, int pin, int mask)
 {
     union ioapic_route_entry_union entry;
 
-    entry.both = ioapic_read_entry(apic, pin);
+    ioapic_read_entry(apic, pin, &entry.both);
     entry.both.mask = mask & 0x1;
     ioapic_write(apic, APIC_IO_REDIR_LOW(pin), entry.lo);
 }
@@ -249,7 +249,8 @@ ioapic_irq_eoi(int pin)
         /* Workaround for old IOAPICs with no specific EOI */
 
         /* Mask the pin and change to edge triggered */
-        oldentry.both = entry.both = ioapic_read_entry(apic, pin);
+        ioapic_read_entry(apic, pin, &entry.both);
+        oldentry = entry;
         entry.both.mask = IOAPIC_MASK_DISABLED;
         entry.both.trigger = IOAPIC_EDGE_TRIGGERED;
         ioapic_write_entry(apic, pin, entry.both);
@@ -259,7 +260,7 @@ ioapic_irq_eoi(int pin)
     } else {
         volatile ApicIoUnit *ioapic = apic_get_ioapic(apic)->ioapic;
 
-        entry.both = ioapic_read_entry(apic, pin);
+        ioapic_read_entry(apic, pin, &entry.both);
         ioapic->eoi.r = entry.both.vector;
     }
 
-- 
2.30.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]