hw/pci-host/i440fx: Have common names for some local variables
`PCIHostState` is often referred to as `phb`, own device state usually as `s`. Signed-off-by: Bernhard Beschow <shentey@gmail.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230630073720.21297-11-shentey@gmail.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
cda39f134b
commit
a707466dd6
|
@ -205,28 +205,28 @@ static void i440fx_pcihost_get_pci_hole64_end(Object *obj, Visitor *v,
|
||||||
|
|
||||||
static void i440fx_pcihost_initfn(Object *obj)
|
static void i440fx_pcihost_initfn(Object *obj)
|
||||||
{
|
{
|
||||||
PCIHostState *s = PCI_HOST_BRIDGE(obj);
|
PCIHostState *phb = PCI_HOST_BRIDGE(obj);
|
||||||
|
|
||||||
memory_region_init_io(&s->conf_mem, obj, &pci_host_conf_le_ops, s,
|
memory_region_init_io(&phb->conf_mem, obj, &pci_host_conf_le_ops, phb,
|
||||||
"pci-conf-idx", 4);
|
"pci-conf-idx", 4);
|
||||||
memory_region_init_io(&s->data_mem, obj, &pci_host_data_le_ops, s,
|
memory_region_init_io(&phb->data_mem, obj, &pci_host_data_le_ops, phb,
|
||||||
"pci-conf-data", 4);
|
"pci-conf-data", 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void i440fx_pcihost_realize(DeviceState *dev, Error **errp)
|
static void i440fx_pcihost_realize(DeviceState *dev, Error **errp)
|
||||||
{
|
{
|
||||||
PCIHostState *s = PCI_HOST_BRIDGE(dev);
|
PCIHostState *phb = PCI_HOST_BRIDGE(dev);
|
||||||
SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
|
SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
|
||||||
|
|
||||||
memory_region_add_subregion(s->bus->address_space_io, 0xcf8, &s->conf_mem);
|
memory_region_add_subregion(phb->bus->address_space_io, 0xcf8, &phb->conf_mem);
|
||||||
sysbus_init_ioports(sbd, 0xcf8, 4);
|
sysbus_init_ioports(sbd, 0xcf8, 4);
|
||||||
|
|
||||||
memory_region_add_subregion(s->bus->address_space_io, 0xcfc, &s->data_mem);
|
memory_region_add_subregion(phb->bus->address_space_io, 0xcfc, &phb->data_mem);
|
||||||
sysbus_init_ioports(sbd, 0xcfc, 4);
|
sysbus_init_ioports(sbd, 0xcfc, 4);
|
||||||
|
|
||||||
/* register i440fx 0xcf8 port as coalesced pio */
|
/* register i440fx 0xcf8 port as coalesced pio */
|
||||||
memory_region_set_flush_coalesced(&s->data_mem);
|
memory_region_set_flush_coalesced(&phb->data_mem);
|
||||||
memory_region_add_coalescing(&s->conf_mem, 0, 4);
|
memory_region_add_coalescing(&phb->conf_mem, 0, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void i440fx_realize(PCIDevice *dev, Error **errp)
|
static void i440fx_realize(PCIDevice *dev, Error **errp)
|
||||||
|
@ -248,17 +248,16 @@ PCIBus *i440fx_init(const char *pci_type,
|
||||||
MemoryRegion *pci_address_space,
|
MemoryRegion *pci_address_space,
|
||||||
MemoryRegion *ram_memory)
|
MemoryRegion *ram_memory)
|
||||||
{
|
{
|
||||||
|
I440FXState *s = I440FX_PCI_HOST_BRIDGE(dev);
|
||||||
|
PCIHostState *phb = PCI_HOST_BRIDGE(dev);
|
||||||
PCIBus *b;
|
PCIBus *b;
|
||||||
PCIDevice *d;
|
PCIDevice *d;
|
||||||
PCIHostState *s;
|
|
||||||
PCII440FXState *f;
|
PCII440FXState *f;
|
||||||
unsigned i;
|
unsigned i;
|
||||||
I440FXState *i440fx;
|
|
||||||
|
|
||||||
s = PCI_HOST_BRIDGE(dev);
|
|
||||||
b = pci_root_bus_new(dev, NULL, pci_address_space,
|
b = pci_root_bus_new(dev, NULL, pci_address_space,
|
||||||
address_space_io, 0, TYPE_PCI_BUS);
|
address_space_io, 0, TYPE_PCI_BUS);
|
||||||
s->bus = b;
|
phb->bus = b;
|
||||||
sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
|
sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
|
||||||
|
|
||||||
d = pci_create_simple(b, 0, pci_type);
|
d = pci_create_simple(b, 0, pci_type);
|
||||||
|
@ -267,8 +266,7 @@ PCIBus *i440fx_init(const char *pci_type,
|
||||||
f->pci_address_space = pci_address_space;
|
f->pci_address_space = pci_address_space;
|
||||||
f->ram_memory = ram_memory;
|
f->ram_memory = ram_memory;
|
||||||
|
|
||||||
i440fx = I440FX_PCI_HOST_BRIDGE(dev);
|
range_set_bounds(&s->pci_hole, below_4g_mem_size,
|
||||||
range_set_bounds(&i440fx->pci_hole, below_4g_mem_size,
|
|
||||||
IO_APIC_DEFAULT_ADDRESS - 1);
|
IO_APIC_DEFAULT_ADDRESS - 1);
|
||||||
|
|
||||||
/* setup pci memory mapping */
|
/* setup pci memory mapping */
|
||||||
|
|
Loading…
Reference in New Issue