aboutsummaryrefslogtreecommitdiff
path: root/hw/ioapic.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/ioapic.c')
-rw-r--r--hw/ioapic.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/hw/ioapic.c b/hw/ioapic.c
index 6c26e820e0..61991d7679 100644
--- a/hw/ioapic.c
+++ b/hw/ioapic.c
@@ -104,7 +104,6 @@ static void ioapic_service(IOAPICState *s)
uint64_t entry;
uint8_t dest;
uint8_t dest_mode;
- uint8_t polarity;
for (i = 0; i < IOAPIC_NUM_PINS; i++) {
mask = 1 << i;
@@ -116,7 +115,6 @@ static void ioapic_service(IOAPICState *s)
dest_mode = (entry >> IOAPIC_LVT_DEST_MODE_SHIFT) & 1;
delivery_mode =
(entry >> IOAPIC_LVT_DELIV_MODE_SHIFT) & IOAPIC_DM_MASK;
- polarity = (entry >> IOAPIC_LVT_POLARITY_SHIFT) & 1;
if (trig_mode == IOAPIC_TRIGGER_EDGE) {
s->irr &= ~mask;
} else {
@@ -128,7 +126,7 @@ static void ioapic_service(IOAPICState *s)
vector = entry & IOAPIC_VECTOR_MASK;
}
apic_deliver_irq(dest, dest_mode, delivery_mode,
- vector, polarity, trig_mode);
+ vector, trig_mode);
}
}
}
@@ -150,6 +148,9 @@ static void ioapic_set_irq(void *opaque, int vector, int level)
uint32_t mask = 1 << vector;
uint64_t entry = s->ioredtbl[vector];
+ if (entry & (1 << IOAPIC_LVT_POLARITY_SHIFT)) {
+ level = !level;
+ }
if (((entry >> IOAPIC_LVT_TRIGGER_MODE_SHIFT) & 1) ==
IOAPIC_TRIGGER_LEVEL) {
/* level triggered */