[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH 02/11] hw/ide: Add PCIIDEState::isa_bus link
From: |
Mark Cave-Ayland |
Subject: |
Re: [RFC PATCH 02/11] hw/ide: Add PCIIDEState::isa_bus link |
Date: |
Thu, 20 May 2021 09:29:37 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 |
On 20/05/2021 08:41, Mark Cave-Ayland wrote:
3) Add a new pci_isa_bridge_get_isabus(PCIDevice *d) function that the devices such
as via-ide can use to obtain a reference to the ISABus from their own PCIDevice. It
should hopefully be quite simple like this:
ISABus *pci_isa_bridge_get_isabus(PCIDevice *d)
{
PCIISABridge *s = PCI_ISA_BRIDGE(d);
return s->isa_bus;
}
Oops - have just realised that PCIDevice in this case is the PCI/ISA device and not
the bridge itself. This means there is a bit more work to do, perhaps something like:
ISABus *pci_device_get_isabus(PCIDevice *d)
{
PCIBus *bus = pci_get_bus(d);
PCIDeviceClass *k;
int devfn;
for (devfn = 0; devfn < ARRAY_SIZE(bus->devices); devfn++) {
PCIDevice *pd = bus->devices[devfn];
PCIDeviceClass *k = PCI_DEVICE_GET_CLASS(d);
PCIISABridge *s;
if (object_dynamic_cast(OBJECT(pd), TYPE_PCI_ISA_BRIDGE)) {
s = PCI_ISA_BRIDGE(pd);
return s->isa_bus;
}
}
return NULL;
}
Given that a PCI-ISA bridge effectively manages the bottom part of the single IO
address space then I believe there can only be one PCI-ISA bridge per PCI host
bridge, and therefore bus.
ATB,
Mark.
- [RFC PATCH 00/11] hw/isa: Remove dependencies on ISA bus singleton, Philippe Mathieu-Daudé, 2021/05/18
- [RFC PATCH 02/11] hw/ide: Add PCIIDEState::isa_bus link, Philippe Mathieu-Daudé, 2021/05/18
- Re: [RFC PATCH 02/11] hw/ide: Add PCIIDEState::isa_bus link, BALATON Zoltan, 2021/05/18
- Re: [RFC PATCH 02/11] hw/ide: Add PCIIDEState::isa_bus link, John Snow, 2021/05/19
- Re: [RFC PATCH 02/11] hw/ide: Add PCIIDEState::isa_bus link, BALATON Zoltan, 2021/05/19
- Re: [RFC PATCH 02/11] hw/ide: Add PCIIDEState::isa_bus link, Stefan Hajnoczi, 2021/05/20
- Re: [RFC PATCH 02/11] hw/ide: Add PCIIDEState::isa_bus link, Mark Cave-Ayland, 2021/05/20
- Re: [RFC PATCH 02/11] hw/ide: Add PCIIDEState::isa_bus link, BALATON Zoltan, 2021/05/20
- Re: [RFC PATCH 02/11] hw/ide: Add PCIIDEState::isa_bus link, Mark Cave-Ayland, 2021/05/20
- Re: [RFC PATCH 02/11] hw/ide: Add PCIIDEState::isa_bus link,
Mark Cave-Ayland <=
[RFC PATCH 03/11] hw/ide/piix: Set the ISA-bus QOM link, Philippe Mathieu-Daudé, 2021/05/18
[RFC PATCH 01/11] hw/isa: Explode pci_create_simple() calls, Philippe Mathieu-Daudé, 2021/05/18
[RFC PATCH 04/11] hw/ide/via: Set the ISA-bus QOM link, Philippe Mathieu-Daudé, 2021/05/18
[RFC PATCH 05/11] hw/isa: Extract isa_bus_get_irq() from isa_get_irq(), Philippe Mathieu-Daudé, 2021/05/18
[RFC PATCH 06/11] hw/ide: Replace isa_get_irq() by isa_bus_get_irq(), Philippe Mathieu-Daudé, 2021/05/18
[RFC PATCH 07/11] hw/isa: Simplify isa_get_irq(), Philippe Mathieu-Daudé, 2021/05/18
[RFC PATCH 09/11] hw/ide: Let ide_init_ioport() take an ISA bus argument instead of device, Philippe Mathieu-Daudé, 2021/05/18
[RFC PATCH 08/11] hw/isa: Extract bus part from isa_register_portio_list(), Philippe Mathieu-Daudé, 2021/05/18
[RFC PATCH 10/11] hw/isa: Remove use of global isa bus, Philippe Mathieu-Daudé, 2021/05/18