[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-block] [PATCH v2 12/14] isa: introduce wrapper isa_connect_gpio_ou

From: Efimov Vasily
Subject: [Qemu-block] [PATCH v2 12/14] isa: introduce wrapper isa_connect_gpio_out
Date: Wed, 22 Jun 2016 15:24:56 +0300

Currently a direct access to the device structure field is used to connect ISA
device IRQ to the bus. GPIO access should be used instead if possible.

The patch adds wrapper isa_connect_gpio_out. The function connects specified
output GPIO to specified ISA IRQ.

Signed-off-by: Efimov Vasily <address@hidden>
 hw/isa/isa-bus.c     | 7 +++++++
 include/hw/isa/isa.h | 1 +
 2 files changed, 8 insertions(+)

diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c
index 7aa115c..ce74db2 100644
--- a/hw/isa/isa-bus.c
+++ b/hw/isa/isa-bus.c
@@ -97,6 +97,13 @@ void isa_init_irq(ISADevice *dev, qemu_irq *p, int isairq)
+void isa_connect_gpio_out(ISADevice *isadev, int gpioirq, int isairq)
+    qemu_irq irq;
+    isa_init_irq(isadev, &irq, isairq);
+    qdev_connect_gpio_out(DEVICE(isadev), gpioirq, irq);
 void isa_bus_dma(ISABus *bus, IsaDma *dma8, IsaDma *dma16)
     assert(bus && dma8 && dma16);
diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h
index c87fbad..7693ac5 100644
--- a/include/hw/isa/isa.h
+++ b/include/hw/isa/isa.h
@@ -102,6 +102,7 @@ ISABus *isa_bus_new(DeviceState *dev, MemoryRegion 
 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);
 void isa_bus_dma(ISABus *bus, IsaDma *dma8, IsaDma *dma16);
 IsaDma *isa_get_dma(ISABus *bus, int nchan);
 MemoryRegion *isa_address_space(ISADevice *dev);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]