diff options
author | pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-04-07 18:14:41 +0000 |
---|---|---|
committer | pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-04-07 18:14:41 +0000 |
commit | d537cf6c8624b27ce2b63431d2f8937f6356f652 (patch) | |
tree | d7173d79977b4426b2ff225b35c839c8a2e4a215 /hw/usb-ohci.c | |
parent | b6e27ab8b12ef6075d85fc505f821643804a3a79 (diff) |
Unify IRQ handling.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2635 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/usb-ohci.c')
-rw-r--r-- | hw/usb-ohci.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/hw/usb-ohci.c b/hw/usb-ohci.c index a4f8aa6e31..6808579563 100644 --- a/hw/usb-ohci.c +++ b/hw/usb-ohci.c @@ -59,8 +59,7 @@ enum ohci_type { }; typedef struct { - void *pic; - int irq; + qemu_irq irq; enum ohci_type type; target_phys_addr_t mem_base; int mem; @@ -282,10 +281,7 @@ static inline void ohci_intr_update(OHCIState *ohci) (ohci->intr_status & ohci->intr)) level = 1; - if (ohci->type == OHCI_TYPE_PCI) - pci_set_irq((PCIDevice *)ohci->pic, ohci->irq, level); - else - pic_set_irq_new(ohci->pic, ohci->irq, level); + qemu_set_irq(ohci->irq, level); } /* Set an interrupt */ @@ -1263,7 +1259,7 @@ static CPUWriteMemoryFunc *ohci_writefn[3]={ }; static void usb_ohci_init(OHCIState *ohci, int num_ports, int devfn, - void *pic, int irq, enum ohci_type type, const char *name) + qemu_irq irq, enum ohci_type type, const char *name) { int i; @@ -1286,7 +1282,6 @@ static void usb_ohci_init(OHCIState *ohci, int num_ports, int devfn, ohci->mem = cpu_register_io_memory(0, ohci_readfn, ohci_writefn, ohci); ohci->name = name; - ohci->pic = pic; ohci->irq = irq; ohci->type = type; @@ -1334,19 +1329,19 @@ void usb_ohci_init_pci(struct PCIBus *bus, int num_ports, int devfn) ohci->pci_dev.config[0x0b] = 0xc; ohci->pci_dev.config[0x3d] = 0x01; /* interrupt pin 1 */ - usb_ohci_init(&ohci->state, num_ports, devfn, &ohci->pci_dev, - 0, OHCI_TYPE_PCI, ohci->pci_dev.name); + usb_ohci_init(&ohci->state, num_ports, devfn, ohci->pci_dev.irq[0], + OHCI_TYPE_PCI, ohci->pci_dev.name); pci_register_io_region((struct PCIDevice *)ohci, 0, 256, PCI_ADDRESS_SPACE_MEM, ohci_mapfunc); } void usb_ohci_init_pxa(target_phys_addr_t base, int num_ports, int devfn, - void *pic, int irq) + qemu_irq irq) { OHCIState *ohci = (OHCIState *)qemu_mallocz(sizeof(OHCIState)); - usb_ohci_init(ohci, num_ports, devfn, pic, irq, + usb_ohci_init(ohci, num_ports, devfn, irq, OHCI_TYPE_PXA, "OHCI USB"); ohci->mem_base = base; |