From 2ab2ef078504c9a4979bd5c457fdf5903292e0f7 Mon Sep 17 00:00:00 2001 From: BALATON Zoltan Date: Fri, 25 Jan 2019 14:52:11 -0500 Subject: cmd646: Remove unused variable There was a pointer to PCIIDEState in CMD646BAR which was set but not used afterwards. Get rid of this unused variable. Signed-off-by: BALATON Zoltan Tested-by: Mark Cave-Ayland Reviewed-by: John Snow Message-id: 1e352f091aa601fb2e19771aac46529fe278dd91.1547166960.git.balaton@eik.bme.hu Signed-off-by: John Snow --- include/hw/ide/pci.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/hw/ide/pci.h') diff --git a/include/hw/ide/pci.h b/include/hw/ide/pci.h index dbc6a03..ed723ac 100644 --- a/include/hw/ide/pci.h +++ b/include/hw/ide/pci.h @@ -41,7 +41,6 @@ typedef struct CMD646BAR { MemoryRegion cmd; MemoryRegion data; IDEBus *bus; - struct PCIIDEState *pci_dev; } CMD646BAR; #define TYPE_PCI_IDE "pci-ide" -- cgit v1.1 From e210ec87b93cf94212b5f522d514115dc3604975 Mon Sep 17 00:00:00 2001 From: BALATON Zoltan Date: Fri, 25 Jan 2019 14:52:11 -0500 Subject: cmd646: Remove IDEBus from CMD646BAR The cmd646 io mem ops callbacks only need the IDEBus which is currently passed via a CMD646BAR struct. No need to wrap it up like that, we can pass it directly to these callbacks which then allows to drop the IDEBus from the CMD646BAR. Signed-off-by: BALATON Zoltan Tested-by: Mark Cave-Ayland Reviewed-by: John Snow Message-id: 7a31c155c9899869794499d841d30c7ef32aae47.1547166960.git.balaton@eik.bme.hu Signed-off-by: John Snow --- include/hw/ide/pci.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/hw/ide/pci.h') diff --git a/include/hw/ide/pci.h b/include/hw/ide/pci.h index ed723ac..013d793 100644 --- a/include/hw/ide/pci.h +++ b/include/hw/ide/pci.h @@ -40,7 +40,6 @@ typedef struct BMDMAState { typedef struct CMD646BAR { MemoryRegion cmd; MemoryRegion data; - IDEBus *bus; } CMD646BAR; #define TYPE_PCI_IDE "pci-ide" -- cgit v1.1 From c9ebc75dc24f99e881414e7f35544041f678235a Mon Sep 17 00:00:00 2001 From: BALATON Zoltan Date: Fri, 25 Jan 2019 14:52:11 -0500 Subject: cmd646: Move PCI IDE specific functions to ide/pci.c The io mem ops callbacks are not specific to CMD646 but really follow the PCI IDE spec so move these from cmd646.c to pci.c to allow other PCI IDE implementations to use them. Signed-off-by: BALATON Zoltan Tested-by: Mark Cave-Ayland Reviewed-by: John Snow Message-id: a2b1b2b74afdc78330b8b75605687f683a249635.1547166960.git.balaton@eik.bme.hu Signed-off-by: John Snow --- include/hw/ide/pci.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/hw/ide/pci.h') diff --git a/include/hw/ide/pci.h b/include/hw/ide/pci.h index 013d793..3110633 100644 --- a/include/hw/ide/pci.h +++ b/include/hw/ide/pci.h @@ -71,4 +71,6 @@ extern MemoryRegionOps bmdma_addr_ioport_ops; void pci_ide_create_devs(PCIDevice *dev, DriveInfo **hd_table); extern const VMStateDescription vmstate_ide_pci; +extern const MemoryRegionOps pci_ide_cmd_le_ops; +extern const MemoryRegionOps pci_ide_data_le_ops; #endif -- cgit v1.1 From 8ac98d1a97a7aeefe45f4a5af37d61caa41ded54 Mon Sep 17 00:00:00 2001 From: BALATON Zoltan Date: Fri, 25 Jan 2019 14:52:11 -0500 Subject: ide: Get rid of CMD646BAR struct Now that no CMD646 specific parts are left in CMD646BAR (all remaining members are really PCI IDE specific) this struct can be deleted moving the memory regions for PCI IDE BARs to PCIIDEState where they better belong. The CMD646 PCI IDE model is adjusted accordingly. Signed-off-by: BALATON Zoltan Tested-by: Mark Cave-Ayland Reviewed-by: John Snow Message-id: 4b6cb2ae150dc0d21178209e4beb1e35140a7325.1547166960.git.balaton@eik.bme.hu Signed-off-by: John Snow --- include/hw/ide/pci.h | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'include/hw/ide/pci.h') diff --git a/include/hw/ide/pci.h b/include/hw/ide/pci.h index 3110633..a9f2c33 100644 --- a/include/hw/ide/pci.h +++ b/include/hw/ide/pci.h @@ -37,11 +37,6 @@ typedef struct BMDMAState { struct PCIIDEState *pci_dev; } BMDMAState; -typedef struct CMD646BAR { - MemoryRegion cmd; - MemoryRegion data; -} CMD646BAR; - #define TYPE_PCI_IDE "pci-ide" #define PCI_IDE(obj) OBJECT_CHECK(PCIIDEState, (obj), TYPE_PCI_IDE) @@ -54,17 +49,16 @@ typedef struct PCIIDEState { BMDMAState bmdma[2]; uint32_t secondary; /* used only for cmd646 */ MemoryRegion bmdma_bar; - CMD646BAR cmd646_bar[2]; /* used only for cmd646 */ + MemoryRegion cmd_bar[2]; + MemoryRegion data_bar[2]; } PCIIDEState; - static inline IDEState *bmdma_active_if(BMDMAState *bmdma) { assert(bmdma->bus->retry_unit != (uint8_t)-1); return bmdma->bus->ifs + bmdma->bus->retry_unit; } - void bmdma_init(IDEBus *bus, BMDMAState *bm, PCIIDEState *d); void bmdma_cmd_writeb(BMDMAState *bm, uint32_t val); extern MemoryRegionOps bmdma_addr_ioport_ops; -- cgit v1.1