From: Bernhard Beschow <shentey@gmail.com>
To: qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org, "Jiaxun Yang" <jiaxun.yang@flygoat.com>,
"BALATON Zoltan" <balaton@eik.bme.hu>,
"John Snow" <jsnow@redhat.com>,
"Huacai Chen" <chenhuacai@kernel.org>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
qemu-ppc@nongnu.org, "Bernhard Beschow" <shentey@gmail.com>
Subject: [PATCH 08/13] hw/ide: Rename PCIIDEState::*_bar attributes
Date: Sat, 22 Apr 2023 17:07:23 +0200 [thread overview]
Message-ID: <20230422150728.176512-9-shentey@gmail.com> (raw)
In-Reply-To: <20230422150728.176512-1-shentey@gmail.com>
The attributes represent memory regions containing operations which are mapped
by the device models into PCI BARs. Reflect this by changing the suffic into
"_ops".
Note that in a few commits piix will also use the {cmd,data}_ops but won't map
them into BARs. This further suggests that the "_bar" suffix doesn't match
very well.
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
include/hw/ide/pci.h | 6 +++---
hw/ide/cmd646.c | 10 +++++-----
hw/ide/pci.c | 18 +++++++++---------
hw/ide/piix.c | 2 +-
hw/ide/via.c | 10 +++++-----
5 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/include/hw/ide/pci.h b/include/hw/ide/pci.h
index 597c77c7ad..5025df5b82 100644
--- a/include/hw/ide/pci.h
+++ b/include/hw/ide/pci.h
@@ -51,9 +51,9 @@ struct PCIIDEState {
BMDMAState bmdma[2];
qemu_irq isa_irq[2];
uint32_t secondary; /* used only for cmd646 */
- MemoryRegion bmdma_bar;
- MemoryRegion cmd_bar[2];
- MemoryRegion data_bar[2];
+ MemoryRegion bmdma_ops;
+ MemoryRegion cmd_ops[2];
+ MemoryRegion data_ops[2];
};
void bmdma_init(IDEBus *bus, BMDMAState *bm, PCIIDEState *d);
diff --git a/hw/ide/cmd646.c b/hw/ide/cmd646.c
index 85716aaf17..b9d005a357 100644
--- a/hw/ide/cmd646.c
+++ b/hw/ide/cmd646.c
@@ -251,13 +251,13 @@ static void pci_cmd646_ide_realize(PCIDevice *dev, Error **errp)
dev->wmask[MRDMODE] = 0x0;
dev->w1cmask[MRDMODE] = MRDMODE_INTR_CH0 | MRDMODE_INTR_CH1;
- pci_register_bar(dev, 0, PCI_BASE_ADDRESS_SPACE_IO, &d->data_bar[0]);
- pci_register_bar(dev, 1, PCI_BASE_ADDRESS_SPACE_IO, &d->cmd_bar[0]);
- pci_register_bar(dev, 2, PCI_BASE_ADDRESS_SPACE_IO, &d->data_bar[1]);
- pci_register_bar(dev, 3, PCI_BASE_ADDRESS_SPACE_IO, &d->cmd_bar[1]);
+ pci_register_bar(dev, 0, PCI_BASE_ADDRESS_SPACE_IO, &d->data_ops[0]);
+ pci_register_bar(dev, 1, PCI_BASE_ADDRESS_SPACE_IO, &d->cmd_ops[0]);
+ pci_register_bar(dev, 2, PCI_BASE_ADDRESS_SPACE_IO, &d->data_ops[1]);
+ pci_register_bar(dev, 3, PCI_BASE_ADDRESS_SPACE_IO, &d->cmd_ops[1]);
bmdma_init_ops(d, &cmd646_bmdma_ops);
- pci_register_bar(dev, 4, PCI_BASE_ADDRESS_SPACE_IO, &d->bmdma_bar);
+ pci_register_bar(dev, 4, PCI_BASE_ADDRESS_SPACE_IO, &d->bmdma_ops);
/* TODO: RST# value should be 0 */
pci_conf[PCI_INTERRUPT_PIN] = 0x01; // interrupt on pin 1
diff --git a/hw/ide/pci.c b/hw/ide/pci.c
index a9194313bd..b2fcc00a64 100644
--- a/hw/ide/pci.c
+++ b/hw/ide/pci.c
@@ -527,15 +527,15 @@ void bmdma_init_ops(PCIIDEState *d, const MemoryRegionOps *bmdma_ops)
{
size_t i;
- memory_region_init(&d->bmdma_bar, OBJECT(d), "bmdma-container", 16);
+ memory_region_init(&d->bmdma_ops, OBJECT(d), "bmdma-container", 16);
for (i = 0; i < ARRAY_SIZE(d->bmdma); i++) {
BMDMAState *bm = &d->bmdma[i];
memory_region_init_io(&bm->extra_io, OBJECT(d), bmdma_ops, bm, "bmdma-ops", 4);
- memory_region_add_subregion(&d->bmdma_bar, i * 8, &bm->extra_io);
+ memory_region_add_subregion(&d->bmdma_ops, i * 8, &bm->extra_io);
memory_region_init_io(&bm->addr_ioport, OBJECT(d), &bmdma_addr_ioport_ops, bm,
"bmdma-ioport-ops", 4);
- memory_region_add_subregion(&d->bmdma_bar, i * 8 + 4, &bm->addr_ioport);
+ memory_region_add_subregion(&d->bmdma_ops, i * 8 + 4, &bm->addr_ioport);
}
}
@@ -543,14 +543,14 @@ static void pci_ide_init(Object *obj)
{
PCIIDEState *d = PCI_IDE(obj);
- memory_region_init_io(&d->data_bar[0], OBJECT(d), &pci_ide_data_le_ops,
+ memory_region_init_io(&d->data_ops[0], OBJECT(d), &pci_ide_data_le_ops,
&d->bus[0], "pci-ide0-data-ops", 8);
- memory_region_init_io(&d->cmd_bar[0], OBJECT(d), &pci_ide_cmd_le_ops,
+ memory_region_init_io(&d->cmd_ops[0], OBJECT(d), &pci_ide_cmd_le_ops,
&d->bus[0], "pci-ide0-cmd-ops", 4);
- memory_region_init_io(&d->data_bar[1], OBJECT(d), &pci_ide_data_le_ops,
+ memory_region_init_io(&d->data_ops[1], OBJECT(d), &pci_ide_data_le_ops,
&d->bus[1], "pci-ide1-data-ops", 8);
- memory_region_init_io(&d->cmd_bar[1], OBJECT(d), &pci_ide_cmd_le_ops,
+ memory_region_init_io(&d->cmd_ops[1], OBJECT(d), &pci_ide_cmd_le_ops,
&d->bus[1], "pci-ide1-cmd-ops", 4);
qdev_init_gpio_out(DEVICE(d), d->isa_irq, ARRAY_SIZE(d->isa_irq));
@@ -562,8 +562,8 @@ static void pci_ide_exitfn(PCIDevice *dev)
unsigned i;
for (i = 0; i < ARRAY_SIZE(d->bmdma); ++i) {
- memory_region_del_subregion(&d->bmdma_bar, &d->bmdma[i].extra_io);
- memory_region_del_subregion(&d->bmdma_bar, &d->bmdma[i].addr_ioport);
+ memory_region_del_subregion(&d->bmdma_ops, &d->bmdma[i].extra_io);
+ memory_region_del_subregion(&d->bmdma_ops, &d->bmdma[i].addr_ioport);
}
}
diff --git a/hw/ide/piix.c b/hw/ide/piix.c
index 5611473d37..6942b484f9 100644
--- a/hw/ide/piix.c
+++ b/hw/ide/piix.c
@@ -140,7 +140,7 @@ static void pci_piix_ide_realize(PCIDevice *dev, Error **errp)
pci_conf[PCI_CLASS_PROG] = 0x80; // legacy ATA mode
bmdma_init_ops(d, &piix_bmdma_ops);
- pci_register_bar(dev, 4, PCI_BASE_ADDRESS_SPACE_IO, &d->bmdma_bar);
+ pci_register_bar(dev, 4, PCI_BASE_ADDRESS_SPACE_IO, &d->bmdma_ops);
for (unsigned i = 0; i < 2; i++) {
if (!pci_piix_init_bus(d, i, errp)) {
diff --git a/hw/ide/via.c b/hw/ide/via.c
index 704a8024cb..35dd97e49b 100644
--- a/hw/ide/via.c
+++ b/hw/ide/via.c
@@ -154,13 +154,13 @@ static void via_ide_realize(PCIDevice *dev, Error **errp)
dev->wmask[PCI_INTERRUPT_LINE] = 0;
dev->wmask[PCI_CLASS_PROG] = 5;
- pci_register_bar(dev, 0, PCI_BASE_ADDRESS_SPACE_IO, &d->data_bar[0]);
- pci_register_bar(dev, 1, PCI_BASE_ADDRESS_SPACE_IO, &d->cmd_bar[0]);
- pci_register_bar(dev, 2, PCI_BASE_ADDRESS_SPACE_IO, &d->data_bar[1]);
- pci_register_bar(dev, 3, PCI_BASE_ADDRESS_SPACE_IO, &d->cmd_bar[1]);
+ pci_register_bar(dev, 0, PCI_BASE_ADDRESS_SPACE_IO, &d->data_ops[0]);
+ pci_register_bar(dev, 1, PCI_BASE_ADDRESS_SPACE_IO, &d->cmd_ops[0]);
+ pci_register_bar(dev, 2, PCI_BASE_ADDRESS_SPACE_IO, &d->data_ops[1]);
+ pci_register_bar(dev, 3, PCI_BASE_ADDRESS_SPACE_IO, &d->cmd_ops[1]);
bmdma_init_ops(d, &via_bmdma_ops);
- pci_register_bar(dev, 4, PCI_BASE_ADDRESS_SPACE_IO, &d->bmdma_bar);
+ pci_register_bar(dev, 4, PCI_BASE_ADDRESS_SPACE_IO, &d->bmdma_ops);
qdev_init_gpio_in(ds, via_ide_set_irq, ARRAY_SIZE(d->bus));
for (i = 0; i < ARRAY_SIZE(d->bus); i++) {
--
2.40.0
next prev parent reply other threads:[~2023-04-22 15:08 UTC|newest]
Thread overview: 77+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-22 15:07 [PATCH 00/13] Clean up PCI IDE device models Bernhard Beschow
2023-04-22 15:07 ` [PATCH 01/13] hw/ide/pci: Expose legacy interrupts as GPIOs Bernhard Beschow
2023-04-26 10:41 ` Mark Cave-Ayland
2023-04-26 19:26 ` Bernhard Beschow
2023-04-22 15:07 ` [PATCH 02/13] hw/ide/via: Implement ISA IRQ routing Bernhard Beschow
2023-04-22 17:23 ` BALATON Zoltan
2023-04-22 18:47 ` Bernhard Beschow
2023-04-22 19:21 ` BALATON Zoltan
2023-04-24 7:50 ` Bernhard Beschow
2023-04-24 10:10 ` BALATON Zoltan
2023-04-26 10:55 ` Mark Cave-Ayland
2023-04-22 15:07 ` [PATCH 03/13] hw/isa/vt82c686: Remove via_isa_set_irq() Bernhard Beschow
2023-04-26 10:55 ` Mark Cave-Ayland
2023-04-22 15:07 ` [PATCH 04/13] hw/ide: Extract IDEBus assignment into bmdma_init() Bernhard Beschow
2023-04-22 17:31 ` BALATON Zoltan
2023-04-23 17:36 ` Philippe Mathieu-Daudé
2023-04-26 10:56 ` Mark Cave-Ayland
2023-04-22 15:07 ` [PATCH 05/13] hw/ide: Extract pci_ide_class_init() Bernhard Beschow
2023-04-22 17:34 ` BALATON Zoltan
2023-04-22 18:59 ` Bernhard Beschow
2023-04-23 17:41 ` Philippe Mathieu-Daudé
2023-04-23 22:11 ` Bernhard Beschow
2023-04-23 22:23 ` BALATON Zoltan
2023-04-26 11:04 ` Mark Cave-Ayland
2023-04-26 18:32 ` Bernhard Beschow
2023-04-22 15:07 ` [PATCH 06/13] hw/ide: Extract bmdma_init_ops() Bernhard Beschow
2023-04-23 17:43 ` Philippe Mathieu-Daudé
2023-04-23 22:06 ` Bernhard Beschow
2023-04-26 11:14 ` Mark Cave-Ayland
2023-04-22 15:07 ` [PATCH 07/13] hw/ide: Extract pci_ide_{cmd, data}_le_ops initialization into base class constructor Bernhard Beschow
2023-04-23 17:46 ` [PATCH 07/13] hw/ide: Extract pci_ide_{cmd,data}_le_ops " Philippe Mathieu-Daudé
2023-04-24 7:45 ` Bernhard Beschow
2023-04-26 11:16 ` [PATCH 07/13] hw/ide: Extract pci_ide_{cmd, data}_le_ops " Mark Cave-Ayland
2023-04-22 15:07 ` Bernhard Beschow [this message]
2023-04-22 17:53 ` [PATCH 08/13] hw/ide: Rename PCIIDEState::*_bar attributes BALATON Zoltan
2023-04-26 11:21 ` Mark Cave-Ayland
2023-04-26 18:29 ` Bernhard Beschow
2023-04-27 11:07 ` Mark Cave-Ayland
2023-04-22 15:07 ` [PATCH 09/13] hw/ide/piix: Disuse isa_get_irq() Bernhard Beschow
2023-04-26 11:33 ` Mark Cave-Ayland
2023-04-26 18:25 ` Bernhard Beschow
2023-04-27 12:31 ` Mark Cave-Ayland
2023-05-13 11:53 ` Bernhard Beschow
2023-05-14 12:43 ` Mark Cave-Ayland
2023-04-22 15:07 ` [PATCH 10/13] hw/ide/piix: Reuse PCIIDEState::{cmd,data}_ops Bernhard Beschow
2023-04-26 11:37 ` Mark Cave-Ayland
2023-04-26 18:18 ` Bernhard Beschow
2023-04-26 20:14 ` Bernhard Beschow
2023-04-27 10:52 ` Mark Cave-Ayland
2023-04-27 18:15 ` Bernhard Beschow
2023-04-28 15:58 ` Bernhard Beschow
2023-04-28 17:00 ` BALATON Zoltan
2023-05-03 19:52 ` Mark Cave-Ayland
2023-05-13 12:21 ` Bernhard Beschow
2023-05-18 14:53 ` Mark Cave-Ayland
2023-05-19 17:09 ` Bernhard Beschow
2023-04-22 15:07 ` [PATCH 11/13] hw/ide/sii3112: " Bernhard Beschow
2023-04-22 21:10 ` BALATON Zoltan
2023-04-23 22:19 ` Bernhard Beschow
2023-04-23 22:38 ` BALATON Zoltan
2023-04-26 11:41 ` Mark Cave-Ayland
2023-04-26 20:24 ` Bernhard Beschow
2023-04-26 23:24 ` BALATON Zoltan
2023-04-27 11:15 ` Mark Cave-Ayland
2023-04-27 12:55 ` BALATON Zoltan
2023-05-03 20:25 ` Mark Cave-Ayland
2023-04-22 15:07 ` [PATCH 12/13] hw/ide/sii3112: Reuse PCIIDEState::bmdma_ops Bernhard Beschow
2023-04-26 11:44 ` Mark Cave-Ayland
2023-04-26 20:26 ` Bernhard Beschow
2023-04-22 15:07 ` [PATCH 13/13] hw/ide: Extract bmdma_clear_status() Bernhard Beschow
2023-04-22 21:26 ` BALATON Zoltan
2023-04-23 7:48 ` Bernhard Beschow
2023-04-23 10:40 ` BALATON Zoltan
2023-04-23 21:53 ` Bernhard Beschow
2023-04-22 22:46 ` BALATON Zoltan
2023-04-23 7:35 ` Bernhard Beschow
2023-04-26 11:48 ` Mark Cave-Ayland
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230422150728.176512-9-shentey@gmail.com \
--to=shentey@gmail.com \
--cc=balaton@eik.bme.hu \
--cc=chenhuacai@kernel.org \
--cc=jiaxun.yang@flygoat.com \
--cc=jsnow@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).