Revision ee951a37 hw/isa-bus.c

b/hw/isa-bus.c
25 25
struct ISABus {
26 26
    BusState qbus;
27 27
    qemu_irq *irqs;
28
    uint32_t assigned;
29 28
};
30 29
static ISABus *isabus;
31 30
target_phys_addr_t isa_mem_base = 0;
......
61 60
}
62 61

  
63 62
/*
64
 * isa_reserve_irq() reserves the ISA irq and returns the corresponding
65
 * qemu_irq entry for the i8259.
63
 * isa_get_irq() returns the corresponding qemu_irq entry for the i8259.
66 64
 *
67 65
 * This function is only for special cases such as the 'ferr', and
68 66
 * temporary use for normal devices until they are converted to qdev.
69 67
 */
70
qemu_irq isa_reserve_irq(int isairq)
68
qemu_irq isa_get_irq(int isairq)
71 69
{
72 70
    if (isairq < 0 || isairq > 15) {
73 71
        hw_error("isa irq %d invalid", isairq);
74 72
    }
75
    if (isabus->assigned & (1 << isairq)) {
76
        hw_error("isa irq %d already assigned", isairq);
77
    }
78
    isabus->assigned |= (1 << isairq);
79 73
    return isabus->irqs[isairq];
80 74
}
81 75

  
82 76
void isa_init_irq(ISADevice *dev, qemu_irq *p, int isairq)
83 77
{
84 78
    assert(dev->nirqs < ARRAY_SIZE(dev->isairq));
85
    if (isabus->assigned & (1 << isairq)) {
86
        hw_error("isa irq %d already assigned", isairq);
87
    }
88
    isabus->assigned |= (1 << isairq);
89 79
    dev->isairq[dev->nirqs] = isairq;
90
    *p = isabus->irqs[isairq];
80
    *p = isa_get_irq(isairq);
91 81
    dev->nirqs++;
92 82
}
93 83

  

Also available in: Unified diff