Revision fa0be69a hw/unin_pci.c

b/hw/unin_pci.c
36 36
#define UNIN_DPRINTF(fmt, ...)
37 37
#endif
38 38

  
39
static const int unin_irq_line[] = { 0x1b, 0x1c, 0x1d, 0x1e };
40

  
39 41
typedef struct UNINState {
40 42
    SysBusDevice busdev;
41 43
    PCIHostState host_state;
42 44
    ReadWriteHandler data_handler;
43 45
} UNINState;
44 46

  
45
/* Don't know if this matches real hardware, but it agrees with OHW.  */
46 47
static int pci_unin_map_irq(PCIDevice *pci_dev, int irq_num)
47 48
{
48
    return (irq_num + (pci_dev->devfn >> 3)) & 3;
49
    int retval;
50
    int devfn = pci_dev->devfn & 0x00FFFFFF;
51

  
52
    retval = (((devfn >> 11) & 0x1F) + irq_num) & 3;
53

  
54
    return retval;
49 55
}
50 56

  
51 57
static void pci_unin_set_irq(void *opaque, int irq_num, int level)
52 58
{
53 59
    qemu_irq *pic = opaque;
54 60

  
55
    qemu_set_irq(pic[irq_num + 8], level);
61
    UNIN_DPRINTF("%s: setting INT %d = %d\n", __func__,
62
                 unin_irq_line[irq_num], level);
63
    qemu_set_irq(pic[unin_irq_line[irq_num]], level);
56 64
}
57 65

  
58 66
static void pci_unin_save(QEMUFile* f, void *opaque)

Also available in: Unified diff