From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:42338) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QvWj0-0006Jq-Nw for qemu-devel@nongnu.org; Mon, 22 Aug 2011 11:47:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QvWim-0001Jd-2g for qemu-devel@nongnu.org; Mon, 22 Aug 2011 11:47:34 -0400 Received: from goliath.siemens.de ([192.35.17.28]:21976) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QvWil-0001By-Ne for qemu-devel@nongnu.org; Mon, 22 Aug 2011 11:47:28 -0400 Message-ID: <4E5279E2.1030709@siemens.com> Date: Mon, 22 Aug 2011 17:46:42 +0200 From: Jan Kiszka MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [RESEND][PATCH 2/2] ioapic: Implement polarity List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori , qemu-devel 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 --- 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 */ -- 1.7.3.4