From nobody Tue Feb 10 13:33:57 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1506264904070977.9074896489525; Sun, 24 Sep 2017 07:55:04 -0700 (PDT) Received: from localhost ([::1]:38447 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dw8J4-0008M2-Bb for importer@patchew.org; Sun, 24 Sep 2017 10:54:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57157) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dw8Cb-0002gw-M1 for qemu-devel@nongnu.org; Sun, 24 Sep 2017 10:48:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dw8Ca-0002HK-IX for qemu-devel@nongnu.org; Sun, 24 Sep 2017 10:48:13 -0400 Received: from chuckie.co.uk ([82.165.15.123]:49780 helo=s16892447.onlinehome-server.info) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dw8CW-0002Cu-FF; Sun, 24 Sep 2017 10:48:08 -0400 Received: from host86-191-82-173.range86-191.btcentralplus.com ([86.191.82.173] helo=kentang.home) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1dw8CZ-0006gI-8O; Sun, 24 Sep 2017 15:48:12 +0100 From: Mark Cave-Ayland To: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, david@gibson.dropbear.id.au Date: Sun, 24 Sep 2017 15:47:46 +0100 Message-Id: <1506264466-28252-8-git-send-email-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1506264466-28252-1-git-send-email-mark.cave-ayland@ilande.co.uk> References: <1506264466-28252-1-git-send-email-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.191.82.173 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [PATCH 7/7] mac_dbdma: change DBDMA_kick to a MAC_DBDMA type method X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" With this we can now remove the last external method used to interface between macio and DBDMA. Signed-off-by: Mark Cave-Ayland --- hw/ide/macio.c | 3 ++- hw/misc/macio/mac_dbdma.c | 19 ++++++++++--------- include/hw/ppc/mac_dbdma.h | 4 +--- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/hw/ide/macio.c b/hw/ide/macio.c index b296017..6f7f286 100644 --- a/hw/ide/macio.c +++ b/hw/ide/macio.c @@ -384,6 +384,7 @@ static void ide_dbdma_start(IDEDMA *dma, IDEState *s, BlockCompletionFunc *cb) { MACIOIDEState *m =3D container_of(dma, MACIOIDEState, dma); + DBDMAState *dbdma =3D (DBDMAState *)m->dbdma; =20 s->io_buffer_index =3D 0; if (s->drive_kind =3D=3D IDE_CD) { @@ -399,7 +400,7 @@ static void ide_dbdma_start(IDEDMA *dma, IDEState *s, MACIO_DPRINTF("-------------------------\n"); =20 m->dma_active =3D true; - DBDMA_kick(m->dbdma); + dbdma->kick(dbdma); } =20 static const IDEDMAOps dbdma_ops =3D { diff --git a/hw/misc/macio/mac_dbdma.c b/hw/misc/macio/mac_dbdma.c index addb97d..f8375db 100644 --- a/hw/misc/macio/mac_dbdma.c +++ b/hw/misc/macio/mac_dbdma.c @@ -301,6 +301,11 @@ wait: channel_run(ch); } =20 +static void dbdma_kick(DBDMAState *dbdma) +{ + qemu_bh_schedule(dbdma->bh); +} + static void start_output(DBDMA_channel *ch, int key, uint32_t addr, uint16_t req_count, int is_last) { @@ -381,7 +386,7 @@ static void load_word(DBDMA_channel *ch, int key, uint3= 2_t addr, next(ch); =20 wait: - DBDMA_kick(dbdma_from_ch(ch)); + dbdma_kick(dbdma_from_ch(ch)); } =20 static void store_word(DBDMA_channel *ch, int key, uint32_t addr, @@ -413,7 +418,7 @@ static void store_word(DBDMA_channel *ch, int key, uint= 32_t addr, next(ch); =20 wait: - DBDMA_kick(dbdma_from_ch(ch)); + dbdma_kick(dbdma_from_ch(ch)); } =20 static void nop(DBDMA_channel *ch) @@ -430,7 +435,7 @@ static void nop(DBDMA_channel *ch) conditional_branch(ch); =20 wait: - DBDMA_kick(dbdma_from_ch(ch)); + dbdma_kick(dbdma_from_ch(ch)); } =20 static void stop(DBDMA_channel *ch) @@ -552,11 +557,6 @@ static void DBDMA_run_bh(void *opaque) DBDMA_DPRINTF("<- DBDMA_run_bh\n"); } =20 -void DBDMA_kick(DBDMAState *dbdma) -{ - qemu_bh_schedule(dbdma->bh); -} - static void dbdma_register_channel(DBDMAState *s, int nchan, qemu_irq irq, DBDMA_rw rw, DBDMA_flush flush, void *opaque) @@ -686,7 +686,7 @@ static void dbdma_control_write(DBDMA_channel *ch) =20 /* If active, make sure the BH gets to run */ if (status & ACTIVE) { - DBDMA_kick(dbdma_from_ch(ch)); + dbdma_kick(dbdma_from_ch(ch)); } } =20 @@ -904,6 +904,7 @@ static void mac_dbdma_init(Object *obj) sysbus_init_mmio(sbd, &s->mem); =20 s->register_channel =3D dbdma_register_channel; + s->kick =3D dbdma_kick; } =20 static void mac_dbdma_realize(DeviceState *dev, Error **errp) diff --git a/include/hw/ppc/mac_dbdma.h b/include/hw/ppc/mac_dbdma.h index d6a38c5..a30f8d8 100644 --- a/include/hw/ppc/mac_dbdma.h +++ b/include/hw/ppc/mac_dbdma.h @@ -169,11 +169,9 @@ typedef struct DBDMAState { =20 void (*register_channel)(struct DBDMAState *s, int nchan, qemu_irq irq, DBDMA_rw rw, DBDMA_flush flush, void *opaque); + void (*kick)(struct DBDMAState *s); } DBDMAState; =20 -/* Externally callable functions */ -void DBDMA_kick(DBDMAState *dbdma); - #define TYPE_MAC_DBDMA "mac-dbdma" #define MAC_DBDMA(obj) OBJECT_CHECK(DBDMAState, (obj), TYPE_MAC_DBDMA) =20 --=20 1.7.10.4