mirror of https://github.com/xemu-project/xemu.git
raven: some minor IRQ-related tidy-ups
This really lays the groundwork for the upcoming patches: it renames the irqs PREPPCIState struct member to pci_irqs (as soon there will be a distinction) and then changes the raven IRQ opaque to use PREPPCIState instead of just irqs array. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Hervé Poussineau <hpoussin@reactos.org> Tested-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
8e93b2c393
commit
55a2290254
|
@ -55,7 +55,7 @@ typedef struct RavenPCIState {
|
||||||
typedef struct PRePPCIState {
|
typedef struct PRePPCIState {
|
||||||
PCIHostState parent_obj;
|
PCIHostState parent_obj;
|
||||||
|
|
||||||
qemu_irq irq[PCI_NUM_PINS];
|
qemu_irq pci_irqs[PCI_NUM_PINS];
|
||||||
PCIBus pci_bus;
|
PCIBus pci_bus;
|
||||||
AddressSpace pci_io_as;
|
AddressSpace pci_io_as;
|
||||||
MemoryRegion pci_io;
|
MemoryRegion pci_io;
|
||||||
|
@ -194,9 +194,9 @@ static int raven_map_irq(PCIDevice *pci_dev, int irq_num)
|
||||||
|
|
||||||
static void raven_set_irq(void *opaque, int irq_num, int level)
|
static void raven_set_irq(void *opaque, int irq_num, int level)
|
||||||
{
|
{
|
||||||
qemu_irq *pic = opaque;
|
PREPPCIState *s = opaque;
|
||||||
|
|
||||||
qemu_set_irq(pic[irq_num] , level);
|
qemu_set_irq(s->pci_irqs[irq_num], level);
|
||||||
}
|
}
|
||||||
|
|
||||||
static AddressSpace *raven_pcihost_set_iommu(PCIBus *bus, void *opaque,
|
static AddressSpace *raven_pcihost_set_iommu(PCIBus *bus, void *opaque,
|
||||||
|
@ -223,13 +223,12 @@ static void raven_pcihost_realizefn(DeviceState *d, Error **errp)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < PCI_NUM_PINS; i++) {
|
for (i = 0; i < PCI_NUM_PINS; i++) {
|
||||||
sysbus_init_irq(dev, &s->irq[i]);
|
sysbus_init_irq(dev, &s->pci_irqs[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
qdev_init_gpio_in(d, raven_change_gpio, 1);
|
qdev_init_gpio_in(d, raven_change_gpio, 1);
|
||||||
|
|
||||||
pci_bus_irqs(&s->pci_bus, raven_set_irq, raven_map_irq, s->irq,
|
pci_bus_irqs(&s->pci_bus, raven_set_irq, raven_map_irq, s, PCI_NUM_PINS);
|
||||||
PCI_NUM_PINS);
|
|
||||||
|
|
||||||
memory_region_init_io(&h->conf_mem, OBJECT(h), &pci_host_conf_le_ops, s,
|
memory_region_init_io(&h->conf_mem, OBJECT(h), &pci_host_conf_le_ops, s,
|
||||||
"pci-conf-idx", 4);
|
"pci-conf-idx", 4);
|
||||||
|
|
Loading…
Reference in New Issue