From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47785) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S9aMx-0002Yi-Nk for qemu-devel@nongnu.org; Mon, 19 Mar 2012 07:03:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S9aMr-0002UG-8W for qemu-devel@nongnu.org; Mon, 19 Mar 2012 07:03:19 -0400 Message-ID: <4F67126F.20402@suse.de> Date: Mon, 19 Mar 2012 12:03:11 +0100 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1331995186-18507-1-git-send-email-hpoussin@reactos.org> <1331995186-18507-2-git-send-email-hpoussin@reactos.org> In-Reply-To: <1331995186-18507-2-git-send-email-hpoussin@reactos.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 1/6] i82378/i82374: do not create DMA controller twice List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?SGVydsOpIFBvdXNzaW5lYXU=?= Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org Am 17.03.2012 15:39, schrieb Herv=C3=A9 Poussineau: > This fixes a crash in PReP emulation when using DMA controller to acces= s floppy drive. >=20 > Signed-off-by: Herv=C3=A9 Poussineau Reviewed-by: Andreas F=C3=A4rber Andreas > --- > hw/i82374.c | 5 ++++- > hw/i82378.c | 5 +++-- > 2 files changed, 7 insertions(+), 3 deletions(-) >=20 > diff --git a/hw/i82374.c b/hw/i82374.c > index 67298a3..4a922c3 100644 > --- a/hw/i82374.c > +++ b/hw/i82374.c > @@ -38,6 +38,7 @@ do { fprintf(stderr, "i82374 ERROR: " fmt , ## __VA_A= RGS__); } while (0) > =20 > typedef struct I82374State { > uint8_t commands[8]; > + qemu_irq out; > } I82374State; > =20 > static const VMStateDescription vmstate_i82374 =3D { > @@ -99,7 +100,7 @@ static uint32_t i82374_read_descriptor(void *opaque,= uint32_t nport) > =20 > static void i82374_init(I82374State *s) > { > - DMA_init(1, NULL); > + DMA_init(1, &s->out); > memset(s->commands, 0, sizeof(s->commands)); > } > =20 > @@ -132,6 +133,8 @@ static int i82374_isa_init(ISADevice *dev) > =20 > i82374_init(s); > =20 > + qdev_init_gpio_out(&dev->qdev, &s->out, 1); > + > return 0; > } > =20 > diff --git a/hw/i82378.c b/hw/i82378.c > index faad1a3..9b11d90 100644 > --- a/hw/i82378.c > +++ b/hw/i82378.c > @@ -170,6 +170,7 @@ static void i82378_init(DeviceState *dev, I82378Sta= te *s) > { > ISABus *isabus =3D DO_UPCAST(ISABus, qbus, qdev_get_child_bus(dev,= "isa.0")); > ISADevice *pit; > + ISADevice *isa; > qemu_irq *out0_irq; > =20 > /* This device has: > @@ -199,8 +200,8 @@ static void i82378_init(DeviceState *dev, I82378Sta= te *s) > pcspk_init(isabus, pit); > =20 > /* 2 82C37 (dma) */ > - DMA_init(1, &s->out[1]); > - isa_create_simple(isabus, "i82374"); > + isa =3D isa_create_simple(isabus, "i82374"); > + qdev_connect_gpio_out(&isa->qdev, 0, s->out[1]); > =20 > /* timer */ > isa_create_simple(isabus, "mc146818rtc"); --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg