From patchwork Mon Oct 9 21:06:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 823523 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3y9tFg6l6yz9t5Q for ; Tue, 10 Oct 2017 08:11:03 +1100 (AEDT) Received: from localhost ([::1]:59812 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e1fKH-0006Wz-IC for incoming@patchwork.ozlabs.org; Mon, 09 Oct 2017 17:11:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56688) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e1fGv-0004Fu-HW for qemu-devel@nongnu.org; Mon, 09 Oct 2017 17:07:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e1fGu-0006dT-0U for qemu-devel@nongnu.org; Mon, 09 Oct 2017 17:07:33 -0400 Received: from chuckie.co.uk ([82.165.15.123]:40551 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 1e1fGt-0006ae-Pt for qemu-devel@nongnu.org; Mon, 09 Oct 2017 17:07:31 -0400 Received: from host109-153-37-179.range109-153.btcentralplus.com ([109.153.37.179] 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 1e1fGq-0003wf-Dl; Mon, 09 Oct 2017 22:07:29 +0100 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, atar4qemu@gmail.com Date: Mon, 9 Oct 2017 22:06:58 +0100 Message-Id: <1507583223-14819-4-git-send-email-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1507583223-14819-1-git-send-email-mark.cave-ayland@ilande.co.uk> References: <1507583223-14819-1-git-send-email-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 109.153.37.179 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 3/8] sparc32_dma: move type declarations from sparc32_dma.c to sparc32_dma.h 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Mark Cave-Ayland --- hw/dma/sparc32_dma.c | 34 ---------------------------------- include/hw/sparc/sparc32_dma.h | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 34 deletions(-) diff --git a/hw/dma/sparc32_dma.c b/hw/dma/sparc32_dma.c index fbbfe57..db70192 100644 --- a/hw/dma/sparc32_dma.c +++ b/hw/dma/sparc32_dma.c @@ -40,7 +40,6 @@ * http://www.ibiblio.org/pub/historic-linux/early-ports/Sparc/NCR/DMA2.txt */ -#define DMA_REGS 4 #define DMA_SIZE (4 * sizeof(uint32_t)) /* We need the mask, because one instance of the device is not page aligned (ledma, start address 0x0010) */ @@ -61,39 +60,6 @@ /* XXX SCSI and ethernet should have different read-only bit masks */ #define DMA_CSR_RO_MASK 0xfe000007 -#define TYPE_SPARC32_DMA_DEVICE "sparc32-dma-device" -#define SPARC32_DMA_DEVICE(obj) OBJECT_CHECK(DMADeviceState, (obj), \ - TYPE_SPARC32_DMA_DEVICE) - -typedef struct DMADeviceState DMADeviceState; - -struct DMADeviceState { - SysBusDevice parent_obj; - - MemoryRegion iomem; - uint32_t dmaregs[DMA_REGS]; - qemu_irq irq; - void *iommu; - qemu_irq gpio[2]; - uint32_t is_ledma; -}; - -#define TYPE_SPARC32_ESPDMA_DEVICE "sparc32-espdma" -#define SPARC32_ESPDMA_DEVICE(obj) OBJECT_CHECK(ESPDMADeviceState, (obj), \ - TYPE_SPARC32_ESPDMA_DEVICE) - -typedef struct ESPDMADeviceState { - DMADeviceState parent_obj; -} ESPDMADeviceState; - -#define TYPE_SPARC32_LEDMA_DEVICE "sparc32-ledma" -#define SPARC32_LEDMA_DEVICE(obj) OBJECT_CHECK(LEDMADeviceState, (obj), \ - TYPE_SPARC32_LEDMA_DEVICE) - -typedef struct LEDMADeviceState { - DMADeviceState parent_obj; -} LEDMADeviceState; - enum { GPIO_RESET = 0, GPIO_DMA, diff --git a/include/hw/sparc/sparc32_dma.h b/include/hw/sparc/sparc32_dma.h index 9497b13..df7491d 100644 --- a/include/hw/sparc/sparc32_dma.h +++ b/include/hw/sparc/sparc32_dma.h @@ -1,6 +1,43 @@ #ifndef SPARC32_DMA_H #define SPARC32_DMA_H +#include "hw/sysbus.h" + +#define DMA_REGS 4 + +#define TYPE_SPARC32_DMA_DEVICE "sparc32-dma-device" +#define SPARC32_DMA_DEVICE(obj) OBJECT_CHECK(DMADeviceState, (obj), \ + TYPE_SPARC32_DMA_DEVICE) + +typedef struct DMADeviceState DMADeviceState; + +struct DMADeviceState { + SysBusDevice parent_obj; + + MemoryRegion iomem; + uint32_t dmaregs[DMA_REGS]; + qemu_irq irq; + void *iommu; + qemu_irq gpio[2]; + uint32_t is_ledma; +}; + +#define TYPE_SPARC32_ESPDMA_DEVICE "sparc32-espdma" +#define SPARC32_ESPDMA_DEVICE(obj) OBJECT_CHECK(ESPDMADeviceState, (obj), \ + TYPE_SPARC32_ESPDMA_DEVICE) + +typedef struct ESPDMADeviceState { + DMADeviceState parent_obj; +} ESPDMADeviceState; + +#define TYPE_SPARC32_LEDMA_DEVICE "sparc32-ledma" +#define SPARC32_LEDMA_DEVICE(obj) OBJECT_CHECK(LEDMADeviceState, (obj), \ + TYPE_SPARC32_LEDMA_DEVICE) + +typedef struct LEDMADeviceState { + DMADeviceState parent_obj; +} LEDMADeviceState; + /* sparc32_dma.c */ void ledma_memory_read(void *opaque, hwaddr addr, uint8_t *buf, int len, int do_bswap);