提交 0035e509 编写于 作者: J Jan Kiszka 提交者: Anthony Liguori

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: NJan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 1f6f408c
......@@ -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 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册