From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57662) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFu7E-0003Vr-FS for qemu-devel@nongnu.org; Tue, 18 Feb 2014 18:30:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WFu76-0006fN-2F for qemu-devel@nongnu.org; Tue, 18 Feb 2014 18:30:16 -0500 Received: from mail-ee0-x229.google.com ([2a00:1450:4013:c00::229]:46855) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFu75-0006ev-SV for qemu-devel@nongnu.org; Tue, 18 Feb 2014 18:30:08 -0500 Received: by mail-ee0-f41.google.com with SMTP id e51so7559123eek.0 for ; Tue, 18 Feb 2014 15:30:07 -0800 (PST) Date: Wed, 19 Feb 2014 00:29:56 +0100 From: Beniamino Galvani Message-ID: <20140218232956.GD24042@gmail.com> References: <1392659003-8264-1-git-send-email-b.galvani@gmail.com> <1392659003-8264-5-git-send-email-b.galvani@gmail.com> <5302D8CE.5020502@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5302D8CE.5020502@cn.fujitsu.com> Subject: Re: [Qemu-devel] [PATCH 4/7] allwinner-a10-pit: use level triggered interrupts List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Li Guang Cc: Peter Maydell , Peter Crosthwaite , qemu-devel@nongnu.org On Tue, Feb 18, 2014 at 11:51:42AM +0800, Li Guang wrote: > Beniamino Galvani wrote: > >Converts the interrupt generation logic to the use of level triggered > >interrupts. > > any real difference, or block something? This is a consequence of the change to the implementation of pending register of the interrupt controller in patch 2. Beniamino > > >Signed-off-by: Beniamino Galvani > >--- > > hw/timer/allwinner-a10-pit.c | 13 ++++++++++++- > > 1 file changed, 12 insertions(+), 1 deletion(-) > > > >diff --git a/hw/timer/allwinner-a10-pit.c b/hw/timer/allwinner-a10-pit.c > >index 3e1c183..4723b25 100644 > >--- a/hw/timer/allwinner-a10-pit.c > >+++ b/hw/timer/allwinner-a10-pit.c > >@@ -24,6 +24,15 @@ typedef struct TimerContext { > > int index; > > } TimerContext; > > > >+static void a10_pit_update_irq(AwA10PITState *s) > >+{ > >+ int i; > >+ > >+ for (i = 0; i< AW_A10_PIT_TIMER_NR; i++) { > >+ qemu_set_irq(s->irq[i], s->irq_status& s->irq_enable& (1<< i)); > >+ } > >+} > >+ > > static uint64_t a10_pit_read(void *opaque, hwaddr offset, unsigned size) > > { > > AwA10PITState *s = AW_A10_PIT(opaque); > >@@ -79,9 +88,11 @@ static void a10_pit_write(void *opaque, hwaddr offset, uint64_t value, > > switch (offset) { > > case AW_A10_PIT_TIMER_IRQ_EN: > > s->irq_enable = value; > >+ a10_pit_update_irq(s); > > break; > > case AW_A10_PIT_TIMER_IRQ_ST: > > s->irq_status&= ~value; > >+ a10_pit_update_irq(s); > > break; > > case AW_A10_PIT_TIMER_BASE ... AW_A10_PIT_TIMER_BASE_END: > > index = offset& 0xf0; > >@@ -208,7 +219,7 @@ static void a10_pit_timer_cb(void *opaque) > > ptimer_stop(s->timer[i]); > > s->control[i]&= ~AW_A10_PIT_TIMER_EN; > > } > >- qemu_irq_pulse(s->irq[i]); > >+ a10_pit_update_irq(s); > > } > > } > > >