From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:60530) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QLZBS-00088s-2z for qemu-devel@nongnu.org; Sun, 15 May 2011 07:08:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QLZBR-0008UR-6n for qemu-devel@nongnu.org; Sun, 15 May 2011 07:08:26 -0400 Received: from fmmailgate02.web.de ([217.72.192.227]:33860) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QLZBQ-0008UN-UW for qemu-devel@nongnu.org; Sun, 15 May 2011 07:08:25 -0400 Received: from smtp01.web.de ( [172.20.0.243]) by fmmailgate02.web.de (Postfix) with ESMTP id C657819F9745E for ; Sun, 15 May 2011 13:07:27 +0200 (CEST) Received: from [88.65.37.225] (helo=mchn199C.mchp.siemens.de) by smtp01.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #2) id 1QLZAV-0008Vx-00 for qemu-devel@nongnu.org; Sun, 15 May 2011 13:07:27 +0200 Message-ID: <4DCFB3EF.3060801@web.de> Date: Sun, 15 May 2011 13:07:27 +0200 From: Jan Kiszka MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Sender: jan.kiszka@web.de Subject: [Qemu-devel] [PATCH 2/2] ioapic: Implement polarity List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel From: Jan Kiszka If the polarity bit is set in a redirection table entry, 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 */