diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2011-08-22 17:46:42 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2011-08-22 14:37:03 -0500 |
commit | 0035e5094c9e01c8227db2ddc0c607e3f6bc33b7 (patch) | |
tree | c0ff285506da5c3e7686db66f76c95f29795037d /hw/ioapic.c | |
parent | 1f6f408c8c38b83b9e3e4577b680dfd686ffe37a (diff) | |
download | qemu-0035e5094c9e01c8227db2ddc0c607e3f6bc33b7.zip qemu-0035e5094c9e01c8227db2ddc0c607e3f6bc33b7.tar.gz qemu-0035e5094c9e01c8227db2ddc0c607e3f6bc33b7.tar.bz2 |
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 <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/ioapic.c')
-rw-r--r-- | hw/ioapic.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/ioapic.c b/hw/ioapic.c index 5916387..61991d7 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 */ |