From patchwork Wed Dec 8 12:13:12 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 74696 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 1CC8DB6F11 for ; Wed, 8 Dec 2010 23:28:34 +1100 (EST) Received: from localhost ([127.0.0.1]:53132 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQJ8J-0004YN-8k for incoming@patchwork.ozlabs.org; Wed, 08 Dec 2010 07:28:31 -0500 Received: from [140.186.70.92] (port=58456 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQItk-0006GU-Lf for qemu-devel@nongnu.org; Wed, 08 Dec 2010 07:13:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PQItg-0007fp-3h for qemu-devel@nongnu.org; Wed, 08 Dec 2010 07:13:28 -0500 Received: from cantor.suse.de ([195.135.220.2]:33276 helo=mx1.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PQItf-0007f3-NA for qemu-devel@nongnu.org; Wed, 08 Dec 2010 07:13:23 -0500 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id B3B0493987; Wed, 8 Dec 2010 13:13:21 +0100 (CET) From: Alexander Graf To: QEMU-devel Developers Date: Wed, 8 Dec 2010 13:13:12 +0100 Message-Id: <1291810400-11309-6-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: <1291810400-11309-1-git-send-email-agraf@suse.de> References: <1291810400-11309-1-git-send-email-agraf@suse.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 Cc: Kevin Wolf , Joerg Roedel , Paul Brook , Blue Swirl , Gerd Hoffmann , Stefan Hajnoczi , tj@kernel.org, Roland Elek , Sebastian Herbszt Subject: [Qemu-devel] [PATCH 05/13] bmdma: move header definitions out X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The bmdma header definitions currently reside in generic code, but only PCI specific code should know about BMDMA internals. So let's move the definitions and everything using them out to pci.h. Signed-off-by: Alexander Graf --- hw/ide/internal.h | 27 --------------------------- hw/ide/pci.h | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 27 deletions(-) diff --git a/hw/ide/internal.h b/hw/ide/internal.h index af7e741..7e2ba1a 100644 --- a/hw/ide/internal.h +++ b/hw/ide/internal.h @@ -20,7 +20,6 @@ typedef struct IDEBus IDEBus; typedef struct IDEDevice IDEDevice; typedef struct IDEDeviceInfo IDEDeviceInfo; typedef struct IDEState IDEState; -typedef struct BMDMAState BMDMAState; typedef struct IDEDMA IDEDMA; typedef struct IDEDMAOps IDEDMAOps; @@ -512,37 +511,11 @@ struct IDEDeviceInfo { #define BM_CMD_START 0x01 #define BM_CMD_READ 0x08 -struct BMDMAState { - uint8_t cmd; - uint8_t status; - uint32_t addr; - - IDEBus *bus; - /* current transfer state */ - uint32_t cur_addr; - uint32_t cur_prd_last; - uint32_t cur_prd_addr; - uint32_t cur_prd_len; - uint8_t unit; - BlockDriverCompletionFunc *dma_cb; - int64_t sector_num; - uint32_t nsector; - IORange addr_ioport; - QEMUBH *bh; - qemu_irq irq; -}; - static inline IDEState *idebus_active_if(IDEBus *bus) { return bus->ifs + bus->unit; } -static inline IDEState *bmdma_active_if(BMDMAState *bmdma) -{ - assert(bmdma->unit != (uint8_t)-1); - return bmdma->bus->ifs + bmdma->unit; -} - static inline void ide_set_irq(IDEBus *bus) { if (!(bus->cmd & IDE_CMD_DISABLE_IRQ)) { diff --git a/hw/ide/pci.h b/hw/ide/pci.h index 1cd7b06..0f96297 100644 --- a/hw/ide/pci.h +++ b/hw/ide/pci.h @@ -3,6 +3,26 @@ #include +typedef struct BMDMAState { + uint8_t cmd; + uint8_t status; + uint32_t addr; + + IDEBus *bus; + /* current transfer state */ + uint32_t cur_addr; + uint32_t cur_prd_last; + uint32_t cur_prd_addr; + uint32_t cur_prd_len; + uint8_t unit; + BlockDriverCompletionFunc *dma_cb; + int64_t sector_num; + uint32_t nsector; + IORange addr_ioport; + QEMUBH *bh; + qemu_irq irq; +} BMDMAState; + typedef struct PCIIDEState { PCIDevice dev; IDEBus bus[2]; @@ -10,6 +30,14 @@ typedef struct PCIIDEState { uint32_t secondary; /* used only for cmd646 */ } PCIIDEState; + +static inline IDEState *bmdma_active_if(BMDMAState *bmdma) +{ + assert(bmdma->unit != (uint8_t)-1); + return bmdma->bus->ifs + bmdma->unit; +} + + void bmdma_init(IDEBus *bus, BMDMAState *bm); void bmdma_cmd_writeb(void *opaque, uint32_t addr, uint32_t val); extern const IORangeOps bmdma_addr_ioport_ops;