summaryrefslogtreecommitdiffstats
path: root/hw/versatile_pci.c
diff options
context:
space:
mode:
authorPaul Brook2009-05-14 23:35:07 +0200
committerPaul Brook2009-05-14 23:35:07 +0200
commit97aff481656b984559a3b6602e6be69ebbe746a4 (patch)
treec3698b09ae5965e8a5d4e0ed10cbf2b9621caa8a /hw/versatile_pci.c
parentESP SCSI qdev conversion (diff)
downloadqemu-97aff481656b984559a3b6602e6be69ebbe746a4.tar.gz
qemu-97aff481656b984559a3b6602e6be69ebbe746a4.tar.xz
qemu-97aff481656b984559a3b6602e6be69ebbe746a4.zip
PL190 qdev conversion
Signed-off-by: Paul Brook <paul@codesourcery.com>
Diffstat (limited to 'hw/versatile_pci.c')
-rw-r--r--hw/versatile_pci.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/hw/versatile_pci.c b/hw/versatile_pci.c
index c9e23422cd..95ccbdfc97 100644
--- a/hw/versatile_pci.c
+++ b/hw/versatile_pci.c
@@ -79,8 +79,6 @@ static CPUReadMemoryFunc *pci_vpb_config_read[] = {
&pci_vpb_config_readl,
};
-static int pci_vpb_irq;
-
static int pci_vpb_map_irq(PCIDevice *d, int irq_num)
{
return irq_num;
@@ -88,18 +86,23 @@ static int pci_vpb_map_irq(PCIDevice *d, int irq_num)
static void pci_vpb_set_irq(qemu_irq *pic, int irq_num, int level)
{
- qemu_set_irq(pic[pci_vpb_irq + irq_num], level);
+ qemu_set_irq(pic[irq_num], level);
}
-PCIBus *pci_vpb_init(qemu_irq *pic, int irq, int realview)
+PCIBus *pci_vpb_init(qemu_irq *pic, int realview)
{
PCIBus *s;
PCIDevice *d;
int mem_config;
uint32_t base;
const char * name;
+ qemu_irq *irqs;
+ int i;
- pci_vpb_irq = irq;
+ irqs = qemu_mallocz(sizeof(qemu_irq) * 4);
+ for (i = 0; i < 4; i++) {
+ irqs[i] = pic[i];
+ }
if (realview) {
base = 0x60000000;
name = "RealView EB PCI Controller";
@@ -107,7 +110,7 @@ PCIBus *pci_vpb_init(qemu_irq *pic, int irq, int realview)
base = 0x40000000;
name = "Versatile/PB PCI Controller";
}
- s = pci_register_bus(pci_vpb_set_irq, pci_vpb_map_irq, pic, 11 << 3, 4);
+ s = pci_register_bus(pci_vpb_set_irq, pci_vpb_map_irq, irqs, 11 << 3, 4);
/* ??? Register memory space. */
mem_config = cpu_register_io_memory(0, pci_vpb_config_read,