aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2019-12-13 13:00:43 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2019-12-17 19:33:51 +0100
commit3c29e188415e81c32a9107ecb2616fc6b967abc5 (patch)
treefc0d143e9be3818af11c4d8a37cedce4c5c7637a /include
parent14a1bb48ea48d541ea6f373c12fb7e88d2c89d8f (diff)
downloadqemu-3c29e188415e81c32a9107ecb2616fc6b967abc5.zip
qemu-3c29e188415e81c32a9107ecb2616fc6b967abc5.tar.gz
qemu-3c29e188415e81c32a9107ecb2616fc6b967abc5.tar.bz2
hw/isa/isa-bus: cleanup irq functions
The irq number is unsigned; we reject negative values. But -1 is used for the isairq array, which is declared unsigned! And since we have a definition for the number of ISA IRQs, use it. Based on a patch by Philippe Mathieu-Daudé. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/hw/isa/isa.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h
index 79f703f..e9ac1f1 100644
--- a/include/hw/isa/isa.h
+++ b/include/hw/isa/isa.h
@@ -88,7 +88,7 @@ struct ISADevice {
DeviceState parent_obj;
/*< public >*/
- uint32_t isairq[2];
+ int8_t isairq[2]; /* -1 = unassigned */
int nirqs;
int ioport_id;
};
@@ -96,9 +96,9 @@ struct ISADevice {
ISABus *isa_bus_new(DeviceState *dev, MemoryRegion *address_space,
MemoryRegion *address_space_io, Error **errp);
void isa_bus_irqs(ISABus *bus, qemu_irq *irqs);
-qemu_irq isa_get_irq(ISADevice *dev, int isairq);
-void isa_init_irq(ISADevice *dev, qemu_irq *p, int isairq);
-void isa_connect_gpio_out(ISADevice *isadev, int gpioirq, int isairq);
+qemu_irq isa_get_irq(ISADevice *dev, unsigned isairq);
+void isa_init_irq(ISADevice *dev, qemu_irq *p, unsigned isairq);
+void isa_connect_gpio_out(ISADevice *isadev, int gpioirq, unsigned isairq);
void isa_bus_dma(ISABus *bus, IsaDma *dma8, IsaDma *dma16);
IsaDma *isa_get_dma(ISABus *bus, int nchan);
MemoryRegion *isa_address_space(ISADevice *dev);