summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
Diffstat (limited to 'hw')
-rw-r--r--hw/arm_gic.c2
-rw-r--r--hw/armv7m.c2
-rw-r--r--hw/axis_dev88.c6
-rw-r--r--hw/esp.c2
-rw-r--r--hw/etraxfs.c6
-rw-r--r--hw/etraxfs_pic.c2
-rw-r--r--hw/integratorcp.c4
-rw-r--r--hw/mpcore.c6
-rw-r--r--hw/musicpal.c4
-rw-r--r--hw/pcnet.c2
-rw-r--r--hw/pl190.c2
-rw-r--r--hw/qdev.c13
-rw-r--r--hw/qdev.h5
-rw-r--r--hw/realview.c2
-rw-r--r--hw/sun4m.c2
-rw-r--r--hw/syborg.c2
-rw-r--r--hw/syborg_interrupt.c2
-rw-r--r--hw/versatilepb.c6
18 files changed, 27 insertions, 43 deletions
diff --git a/hw/arm_gic.c b/hw/arm_gic.c
index 5dc944836..817234da9 100644
--- a/hw/arm_gic.c
+++ b/hw/arm_gic.c
@@ -721,7 +721,7 @@ static void gic_init(gic_state *s)
{
int i;
- qdev_init_irq_sink(&s->busdev.qdev, gic_set_irq, GIC_NIRQ - 32);
+ qdev_init_gpio_in(&s->busdev.qdev, gic_set_irq, GIC_NIRQ - 32);
for (i = 0; i < NCPU; i++) {
sysbus_init_irq(&s->busdev, &s->parent_irq[i]);
}
diff --git a/hw/armv7m.c b/hw/armv7m.c
index 6be9940bc..e3d00ffd7 100644
--- a/hw/armv7m.c
+++ b/hw/armv7m.c
@@ -186,7 +186,7 @@ qemu_irq *armv7m_init(int flash_size, int sram_size,
cpu_pic = arm_pic_init_cpu(env);
sysbus_connect_irq(sysbus_from_qdev(nvic), 0, cpu_pic[ARM_PIC_CPU_IRQ]);
for (i = 0; i < 64; i++) {
- pic[i] = qdev_get_irq_sink(nvic, i);
+ pic[i] = qdev_get_gpio_in(nvic, i);
}
image_size = load_elf(kernel_filename, 0, &entry, &lowaddr, NULL);
diff --git a/hw/axis_dev88.c b/hw/axis_dev88.c
index 60b719b2f..fc527cbec 100644
--- a/hw/axis_dev88.c
+++ b/hw/axis_dev88.c
@@ -304,10 +304,10 @@ void axisdev88_init (ram_addr_t ram_size,
sysbus_connect_irq(s, 0, cpu_irq[0]);
sysbus_connect_irq(s, 1, cpu_irq[1]);
for (i = 0; i < 30; i++) {
- irq[i] = qdev_get_irq_sink(dev, i);
+ irq[i] = qdev_get_gpio_in(dev, i);
}
- nmi[0] = qdev_get_irq_sink(dev, 30);
- nmi[1] = qdev_get_irq_sink(dev, 31);
+ nmi[0] = qdev_get_gpio_in(dev, 30);
+ nmi[1] = qdev_get_gpio_in(dev, 31);
etraxfs_dmac = etraxfs_dmac_init(env, 0x30000000, 10);
for (i = 0; i < 10; i++) {
diff --git a/hw/esp.c b/hw/esp.c
index 6ac8c35d6..ffb222525 100644
--- a/hw/esp.c
+++ b/hw/esp.c
@@ -684,7 +684,7 @@ static void esp_init1(SysBusDevice *dev)
register_savevm("esp", -1, 3, esp_save, esp_load, s);
qemu_register_reset(esp_reset, 0, s);
- qdev_init_irq_sink(&dev->qdev, parent_esp_reset, 1);
+ qdev_init_gpio_in(&dev->qdev, parent_esp_reset, 1);
scsi_bus_new(&dev->qdev, esp_scsi_attach);
}
diff --git a/hw/etraxfs.c b/hw/etraxfs.c
index f82e1cd0f..1e200553e 100644
--- a/hw/etraxfs.c
+++ b/hw/etraxfs.c
@@ -90,10 +90,10 @@ void bareetraxfs_init (ram_addr_t ram_size,
/* FIXME: Is there a proper way to signal vectors to the CPU core? */
qdev_set_prop_ptr(dev, "interrupt_vector", &env->interrupt_vector);
for (i = 0; i < 30; i++) {
- irq[i] = qdev_get_irq_sink(dev, i);
+ irq[i] = qdev_get_gpio_in(dev, i);
}
- nmi[0] = qdev_get_irq_sink(dev, 30);
- nmi[1] = qdev_get_irq_sink(dev, 31);
+ nmi[0] = qdev_get_gpio_in(dev, 30);
+ nmi[1] = qdev_get_gpio_in(dev, 31);
etraxfs_dmac = etraxfs_dmac_init(env, 0x30000000, 10);
for (i = 0; i < 10; i++) {
diff --git a/hw/etraxfs_pic.c b/hw/etraxfs_pic.c
index da9d0c3be..585e7850f 100644
--- a/hw/etraxfs_pic.c
+++ b/hw/etraxfs_pic.c
@@ -141,7 +141,7 @@ static void etraxfs_pic_init(SysBusDevice *dev)
int intr_vect_regs;
s->interrupt_vector = qdev_get_prop_ptr(&dev->qdev, "interrupt_vector");
- qdev_init_irq_sink(&dev->qdev, irq_handler, 32);
+ qdev_init_gpio_in(&dev->qdev, irq_handler, 32);
sysbus_init_irq(dev, &s->parent_irq);
sysbus_init_irq(dev, &s->parent_nmi);
diff --git a/hw/integratorcp.c b/hw/integratorcp.c
index 493866c92..b6fbe1523 100644
--- a/hw/integratorcp.c
+++ b/hw/integratorcp.c
@@ -378,7 +378,7 @@ static void icp_pic_init(SysBusDevice *dev)
icp_pic_state *s = FROM_SYSBUS(icp_pic_state, dev);
int iomemtype;
- qdev_init_irq_sink(&dev->qdev, icp_pic_set_irq, 32);
+ qdev_init_gpio_in(&dev->qdev, icp_pic_set_irq, 32);
sysbus_init_irq(dev, &s->parent_irq);
sysbus_init_irq(dev, &s->parent_fiq);
iomemtype = cpu_register_io_memory(0, icp_pic_readfn,
@@ -484,7 +484,7 @@ static void integratorcp_init(ram_addr_t ram_size,
cpu_pic[ARM_PIC_CPU_IRQ],
cpu_pic[ARM_PIC_CPU_FIQ], NULL);
for (i = 0; i < 32; i++) {
- pic[i] = qdev_get_irq_sink(dev, i);
+ pic[i] = qdev_get_gpio_in(dev, i);
}
sysbus_create_simple("integrator_pic", 0xca000000, pic[26]);
sysbus_create_varargs("integrator_pit", 0x13000000,
diff --git a/hw/mpcore.c b/hw/mpcore.c
index 6df9a91ad..a5eddd9cc 100644
--- a/hw/mpcore.c
+++ b/hw/mpcore.c
@@ -320,17 +320,17 @@ static void realview_mpcore_init(SysBusDevice *dev)
priv = sysbus_create_simple("arm11mpcore_priv", MPCORE_PRIV_BASE, NULL);
sysbus_pass_irq(dev, sysbus_from_qdev(priv));
for (i = 0; i < 32; i++) {
- s->cpuic[i] = qdev_get_irq_sink(priv, i);
+ s->cpuic[i] = qdev_get_gpio_in(priv, i);
}
/* ??? IRQ routing is hardcoded to "normal" mode. */
for (n = 0; n < 4; n++) {
gic = sysbus_create_simple("realview_gic", 0x10040000 + n * 0x10000,
s->cpuic[10 + n]);
for (i = 0; i < 64; i++) {
- s->rvic[n][i] = qdev_get_irq_sink(gic, i);
+ s->rvic[n][i] = qdev_get_gpio_in(gic, i);
}
}
- qdev_init_irq_sink(&dev->qdev, mpcore_rirq_set_irq, 64);
+ qdev_init_gpio_in(&dev->qdev, mpcore_rirq_set_irq, 64);
}
static void mpcore_register_devices(void)
diff --git a/hw/musicpal.c b/hw/musicpal.c
index 1e0aff5cb..9389af958 100644
--- a/hw/musicpal.c
+++ b/hw/musicpal.c
@@ -1040,7 +1040,7 @@ static void mv88w8618_pic_init(SysBusDevice *dev)
mv88w8618_pic_state *s = FROM_SYSBUS(mv88w8618_pic_state, dev);
int iomemtype;
- qdev_init_irq_sink(&dev->qdev, mv88w8618_pic_set_irq, 32);
+ qdev_init_gpio_in(&dev->qdev, mv88w8618_pic_set_irq, 32);
sysbus_init_irq(dev, &s->parent_irq);
iomemtype = cpu_register_io_memory(0, mv88w8618_pic_readfn,
mv88w8618_pic_writefn, s);
@@ -1534,7 +1534,7 @@ static void musicpal_init(ram_addr_t ram_size,
dev = sysbus_create_simple("mv88w8618_pic", MP_PIC_BASE,
cpu_pic[ARM_PIC_CPU_IRQ]);
for (i = 0; i < 32; i++) {
- pic[i] = qdev_get_irq_sink(dev, i);
+ pic[i] = qdev_get_gpio_in(dev, i);
}
sysbus_create_varargs("mv88w8618_pit", MP_PIT_BASE, pic[MP_TIMER1_IRQ],
pic[MP_TIMER2_IRQ], pic[MP_TIMER3_IRQ],
diff --git a/hw/pcnet.c b/hw/pcnet.c
index 2c22f4a50..c44ba7edf 100644
--- a/hw/pcnet.c
+++ b/hw/pcnet.c
@@ -2127,7 +2127,7 @@ static void lance_init(SysBusDevice *dev)
s->dma_opaque = qdev_get_prop_ptr(&dev->qdev, "dma");
- qdev_init_irq_sink(&dev->qdev, parent_lance_reset, 1);
+ qdev_init_gpio_in(&dev->qdev, parent_lance_reset, 1);
sysbus_init_mmio(dev, 4, s->mmio_index);
diff --git a/hw/pl190.c b/hw/pl190.c
index b8c2018d3..10857683d 100644
--- a/hw/pl190.c
+++ b/hw/pl190.c
@@ -235,7 +235,7 @@ static void pl190_init(SysBusDevice *dev)
iomemtype = cpu_register_io_memory(0, pl190_readfn,
pl190_writefn, s);
sysbus_init_mmio(dev, 0x1000, iomemtype);
- qdev_init_irq_sink(&dev->qdev, pl190_set_irq, 32);
+ qdev_init_gpio_in(&dev->qdev, pl190_set_irq, 32);
sysbus_init_irq(dev, &s->irq);
sysbus_init_irq(dev, &s->fiq);
pl190_reset(s);
diff --git a/hw/qdev.c b/hw/qdev.c
index b9278e9a5..d945ff953 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -156,19 +156,6 @@ void qdev_set_netdev(DeviceState *dev, NICInfo *nd)
}
-qemu_irq qdev_get_irq_sink(DeviceState *dev, int n)
-{
- assert(n >= 0 && n < dev->num_irq_sink);
- return dev->irq_sink[n];
-}
-
-/* Register device IRQ sinks. */
-void qdev_init_irq_sink(DeviceState *dev, qemu_irq_handler handler, int nirq)
-{
- dev->num_irq_sink = nirq;
- dev->irq_sink = qemu_allocate_irqs(handler, dev, nirq);
-}
-
/* Get a character (serial) device interface. */
CharDriverState *qdev_init_chardev(DeviceState *dev)
{
diff --git a/hw/qdev.h b/hw/qdev.h
index 0931bc19d..143a1f873 100644
--- a/hw/qdev.h
+++ b/hw/qdev.h
@@ -17,8 +17,6 @@ struct DeviceState {
DeviceType *type;
BusState *parent_bus;
DeviceProperty *props;
- int num_irq_sink;
- qemu_irq *irq_sink;
int num_gpio_out;
qemu_irq *gpio_out;
int num_gpio_in;
@@ -55,7 +53,6 @@ void qdev_set_prop_int(DeviceState *dev, const char *name, uint64_t value);
void qdev_set_prop_ptr(DeviceState *dev, const char *name, void *value);
void qdev_set_netdev(DeviceState *dev, NICInfo *nd);
-qemu_irq qdev_get_irq_sink(DeviceState *dev, int n);
qemu_irq qdev_get_gpio_in(DeviceState *dev, int n);
void qdev_connect_gpio_out(DeviceState *dev, int n, qemu_irq pin);
@@ -77,7 +74,7 @@ struct DeviceInfo {
void qdev_register(const char *name, int size, DeviceInfo *info);
/* Register device properties. */
-void qdev_init_irq_sink(DeviceState *dev, qemu_irq_handler handler, int nirq);
+/* GPIO inputs also double as IRQ sinks. */
void qdev_init_gpio_in(DeviceState *dev, qemu_irq_handler handler, int n);
void qdev_init_gpio_out(DeviceState *dev, qemu_irq *pins, int n);
diff --git a/hw/realview.c b/hw/realview.c
index 535f90762..62d8bf503 100644
--- a/hw/realview.c
+++ b/hw/realview.c
@@ -84,7 +84,7 @@ static void realview_init(ram_addr_t ram_size,
cpu_irq[3], NULL);
}
for (n = 0; n < 64; n++) {
- pic[n] = qdev_get_irq_sink(dev, n);
+ pic[n] = qdev_get_gpio_in(dev, n);
}
sysbus_create_simple("pl050_keyboard", 0x10006000, pic[20]);
diff --git a/hw/sun4m.c b/hw/sun4m.c
index af9f8719a..4ba9e89ed 100644
--- a/hw/sun4m.c
+++ b/hw/sun4m.c
@@ -379,7 +379,7 @@ static void lance_init(NICInfo *nd, target_phys_addr_t leaddr,
s = sysbus_from_qdev(dev);
sysbus_mmio_map(s, 0, leaddr);
sysbus_connect_irq(s, 0, irq);
- *reset = qdev_get_irq_sink(dev, 0);
+ *reset = qdev_get_gpio_in(dev, 0);
}
static void sun4m_hw_init(const struct sun4m_hwdef *hwdef, ram_addr_t RAM_size,
diff --git a/hw/syborg.c b/hw/syborg.c
index ae0ca6702..5ca9977b2 100644
--- a/hw/syborg.c
+++ b/hw/syborg.c
@@ -58,7 +58,7 @@ static void syborg_init(ram_addr_t ram_size,
dev = sysbus_create_simple("syborg,interrupt", 0xC0000000,
cpu_pic[ARM_PIC_CPU_IRQ]);
for (i = 0; i < 64; i++) {
- pic[i] = qdev_get_irq_sink(dev, i);
+ pic[i] = qdev_get_gpio_in(dev, i);
}
sysbus_create_simple("syborg,rtc", 0xC0001000, NULL);
diff --git a/hw/syborg_interrupt.c b/hw/syborg_interrupt.c
index e3fbbf7bf..29e0d1a74 100644
--- a/hw/syborg_interrupt.c
+++ b/hw/syborg_interrupt.c
@@ -209,7 +209,7 @@ static void syborg_int_init(SysBusDevice *dev)
sysbus_init_irq(dev, &s->parent_irq);
s->num_irqs = qdev_get_prop_int(&dev->qdev, "num-interrupts", 64);
- qdev_init_irq_sink(&dev->qdev, syborg_int_set_irq, s->num_irqs);
+ qdev_init_gpio_in(&dev->qdev, syborg_int_set_irq, s->num_irqs);
iomemtype = cpu_register_io_memory(0, syborg_int_readfn,
syborg_int_writefn, s);
sysbus_init_mmio(dev, 0x1000, iomemtype);
diff --git a/hw/versatilepb.c b/hw/versatilepb.c
index eed97d6db..03cf4d8f3 100644
--- a/hw/versatilepb.c
+++ b/hw/versatilepb.c
@@ -135,7 +135,7 @@ static void vpb_sic_init(SysBusDevice *dev)
int iomemtype;
int i;
- qdev_init_irq_sink(&dev->qdev, vpb_sic_set_irq, 32);
+ qdev_init_gpio_in(&dev->qdev, vpb_sic_set_irq, 32);
for (i = 0; i < 32; i++) {
sysbus_init_irq(dev, &s->parent[i]);
}
@@ -188,12 +188,12 @@ static void versatile_init(ram_addr_t ram_size,
dev = sysbus_create_varargs("pl190", 0x10140000,
cpu_pic[0], cpu_pic[1], NULL);
for (n = 0; n < 32; n++) {
- pic[n] = qdev_get_irq_sink(dev, n);
+ pic[n] = qdev_get_gpio_in(dev, n);
}
dev = sysbus_create_simple("versatilepb_sic", 0x10003000, NULL);
for (n = 0; n < 32; n++) {
sysbus_connect_irq(sysbus_from_qdev(dev), n, pic[n]);
- sic[n] = qdev_get_irq_sink(dev, n);
+ sic[n] = qdev_get_gpio_in(dev, n);
}
sysbus_create_simple("pl050_keyboard", 0x10006000, sic[3]);