From patchwork Wed Sep 28 11:01:01 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 116760 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 76DC8B6F84 for ; Wed, 28 Sep 2011 21:30:52 +1000 (EST) Received: from localhost ([::1]:35907 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8rul-0000Mw-Vs for incoming@patchwork.ozlabs.org; Wed, 28 Sep 2011 07:02:59 -0400 Received: from eggs.gnu.org ([140.186.70.92]:46955) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8rtB-0004sL-4W for qemu-devel@nongnu.org; Wed, 28 Sep 2011 07:01:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R8rt3-0004G5-FQ for qemu-devel@nongnu.org; Wed, 28 Sep 2011 07:01:20 -0400 Received: from thoth.sbs.de ([192.35.17.2]:15760) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8rt3-0004FM-4J for qemu-devel@nongnu.org; Wed, 28 Sep 2011 07:01:13 -0400 Received: from mail1.siemens.de (localhost [127.0.0.1]) by thoth.sbs.de (8.13.6/8.13.6) with ESMTP id p8SB1AmR005511; Wed, 28 Sep 2011 13:01:11 +0200 Received: from mchn199C.mchp.siemens.de ([139.25.109.49]) by mail1.siemens.de (8.13.6/8.13.6) with ESMTP id p8SB18W3017664; Wed, 28 Sep 2011 13:01:10 +0200 From: Jan Kiszka To: Anthony Liguori , qemu-devel Date: Wed, 28 Sep 2011 13:01:01 +0200 Message-Id: <622f6661f3aa3a18d9bf0cb59c933c0165788416.1317207666.git.jan.kiszka@siemens.com> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 192.35.17.2 Cc: Blue Swirl , Alexander Graf Subject: [Qemu-devel] [PATCH 15/22] i8259: PREP: Replace pic_intack_read with pic_read_irq X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org There is nothing in the i8259 spec that justifies the special pic_intack_read. At least the Linux PREP kernels configure the PICs properly so that pic_read_irq returns identical values, and setting read_reg_select in PIC0 cannot be derived from any special i8259 mode. So switch ppc_prep to pic_read_irq and drop the now unused PIC code. CC: Alexander Graf Signed-off-by: Jan Kiszka --- hw/i8259.c | 39 --------------------------------------- hw/pc.h | 1 - hw/ppc_prep.c | 2 +- 3 files changed, 1 insertions(+), 41 deletions(-) diff --git a/hw/i8259.c b/hw/i8259.c index 9e32ceb..bbb12cf 100644 --- a/hw/i8259.c +++ b/hw/i8259.c @@ -356,30 +356,6 @@ static void pic_ioport_write(void *opaque, target_phys_addr_t addr64, } } -static uint32_t pic_poll_read(PicState *s) -{ - int ret; - - ret = pic_get_irq(s); - if (ret >= 0) { - bool slave = (s == &isa_pic->pics[1]); - - if (slave) { - s->pics_state->pics[0].isr &= ~(1 << 2); - s->pics_state->pics[0].irr &= ~(1 << 2); - } - s->irr &= ~(1 << ret); - s->isr &= ~(1 << ret); - if (slave || ret != 2) { - pic_update_irq(s); - } - } else { - ret = 0x07; - } - - return ret; -} - static uint64_t pic_ioport_read(void *opaque, target_phys_addr_t addr, unsigned size) { @@ -409,21 +385,6 @@ static uint64_t pic_ioport_read(void *opaque, target_phys_addr_t addr, return ret; } -/* memory mapped interrupt status */ -/* XXX: may be the same than pic_read_irq() */ -uint32_t pic_intack_read(PicState2 *s) -{ - int ret; - - ret = pic_poll_read(&s->pics[0]); - if (ret == 2) - ret = pic_poll_read(&s->pics[1]) + 8; - /* Prepare for ISR read */ - s->pics[0].read_reg_select = 1; - - return ret; -} - int pic_get_output(PicState2 *s) { return (pic_get_irq(&s->pics[0]) >= 0); diff --git a/hw/pc.h b/hw/pc.h index fd5f9b2..14c61a2 100644 --- a/hw/pc.h +++ b/hw/pc.h @@ -65,7 +65,6 @@ extern PicState2 *isa_pic; qemu_irq *i8259_init(qemu_irq parent_irq); int pic_read_irq(PicState2 *s); int pic_get_output(PicState2 *s); -uint32_t pic_intack_read(PicState2 *s); void pic_info(Monitor *mon); void irq_info(Monitor *mon); diff --git a/hw/ppc_prep.c b/hw/ppc_prep.c index d26049b..6427baa 100644 --- a/hw/ppc_prep.c +++ b/hw/ppc_prep.c @@ -130,7 +130,7 @@ static inline uint32_t _PPC_intack_read(target_phys_addr_t addr) uint32_t retval = 0; if ((addr & 0xf) == 0) - retval = pic_intack_read(isa_pic); + retval = pic_read_irq(isa_pic); #if 0 printf("%s: 0x" TARGET_FMT_plx " <= %08" PRIx32 "\n", __func__, addr, retval);