From: Jan Kiszka Date: Mon, 22 Aug 2011 15:46:42 +0000 (+0200) Subject: ioapic: Implement polarity X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=0035e5094c9e01c8227db2ddc0c607e3f6bc33b7;p=qemu.git ioapic: Implement polarity If the polarity bit is set in the redirection table, the input level simply has to inverted as it is low active in this case. Signed-off-by: Jan Kiszka Signed-off-by: Anthony Liguori --- diff --git a/hw/ioapic.c b/hw/ioapic.c index 5916387f0d..61991d7679 100644 --- a/hw/ioapic.c +++ b/hw/ioapic.c @@ -148,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 */