~vcs-imports/qemu/git

« back to all changes in this revision

Viewing changes to hw/usb-ohci.c

  • Committer: pbrook
  • Date: 2007-04-07 18:14:41 UTC
  • Revision ID: git-v1:d537cf6c8624b27ce2b63431d2f8937f6356f652
Unify IRQ handling.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2635 c046a42c-6fe2-441c-8c8c-71466251a162

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
};
60
60
 
61
61
typedef struct {
62
 
    void *pic;
63
 
    int irq;
 
62
    qemu_irq irq;
64
63
    enum ohci_type type;
65
64
    target_phys_addr_t mem_base;
66
65
    int mem;
282
281
        (ohci->intr_status & ohci->intr))
283
282
        level = 1;
284
283
 
285
 
    if (ohci->type == OHCI_TYPE_PCI)
286
 
      pci_set_irq((PCIDevice *)ohci->pic, ohci->irq, level);
287
 
    else
288
 
      pic_set_irq_new(ohci->pic, ohci->irq, level);
 
284
    qemu_set_irq(ohci->irq, level);
289
285
}
290
286
 
291
287
/* Set an interrupt */
1263
1259
};
1264
1260
 
1265
1261
static void usb_ohci_init(OHCIState *ohci, int num_ports, int devfn,
1266
 
            void *pic, int irq, enum ohci_type type, const char *name)
 
1262
            qemu_irq irq, enum ohci_type type, const char *name)
1267
1263
{
1268
1264
    int i;
1269
1265
 
1286
1282
    ohci->mem = cpu_register_io_memory(0, ohci_readfn, ohci_writefn, ohci);
1287
1283
    ohci->name = name;
1288
1284
 
1289
 
    ohci->pic = pic;
1290
1285
    ohci->irq = irq;
1291
1286
    ohci->type = type;
1292
1287
 
1334
1329
    ohci->pci_dev.config[0x0b] = 0xc;
1335
1330
    ohci->pci_dev.config[0x3d] = 0x01; /* interrupt pin 1 */
1336
1331
 
1337
 
    usb_ohci_init(&ohci->state, num_ports, devfn, &ohci->pci_dev,
1338
 
                  0, OHCI_TYPE_PCI, ohci->pci_dev.name);
 
1332
    usb_ohci_init(&ohci->state, num_ports, devfn, ohci->pci_dev.irq[0],
 
1333
                  OHCI_TYPE_PCI, ohci->pci_dev.name);
1339
1334
 
1340
1335
    pci_register_io_region((struct PCIDevice *)ohci, 0, 256,
1341
1336
                           PCI_ADDRESS_SPACE_MEM, ohci_mapfunc);
1342
1337
}
1343
1338
 
1344
1339
void usb_ohci_init_pxa(target_phys_addr_t base, int num_ports, int devfn,
1345
 
            void *pic, int irq)
 
1340
                       qemu_irq irq)
1346
1341
{
1347
1342
    OHCIState *ohci = (OHCIState *)qemu_mallocz(sizeof(OHCIState));
1348
1343
 
1349
 
    usb_ohci_init(ohci, num_ports, devfn, pic, irq,
 
1344
    usb_ohci_init(ohci, num_ports, devfn, irq,
1350
1345
                  OHCI_TYPE_PXA, "OHCI USB");
1351
1346
    ohci->mem_base = base;
1352
1347