diff options
author | Damien Zammit <damien@zamaudio.com> | 2021-04-05 21:59:21 +1000 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2021-04-05 14:08:34 +0200 |
commit | dbbda3c238f47b5f5621068a047c404b92748b24 (patch) | |
tree | 970f3949ef2dd444073890ee90287943946f6e3a /i386/i386at/ioapic.c | |
parent | c722aff68a2e4ed0db8525f849e449341370f705 (diff) | |
download | gnumach-dbbda3c238f47b5f5621068a047c404b92748b24.tar.gz gnumach-dbbda3c238f47b5f5621068a047c404b92748b24.tar.bz2 gnumach-dbbda3c238f47b5f5621068a047c404b92748b24.zip |
ioapic: Fix arg passing of redirection entry
Message-Id: <20210405115921.184572-3-damien@zamaudio.com>
Diffstat (limited to 'i386/i386at/ioapic.c')
-rw-r--r-- | i386/i386at/ioapic.c | 13 |
1 files 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; } |