[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v8 08/10] qtest: fix qemu_irq_intercept_out()
From: |
Matthew Ogilvie |
Subject: |
[Qemu-devel] [PATCH v8 08/10] qtest: fix qemu_irq_intercept_out() |
Date: |
Sun, 16 Dec 2012 16:56:27 -0700 |
For the 8259 (at least), we need to modify the entries in gpio_out
(which is pointing at PICCommonState::int_out) in-place rather than
change it to point to a totally different table. The 8259 sends its
output to int_out even if gpio_out is a different table.
Signed-off-by: Matthew Ogilvie <address@hidden>
---
hw/irq.c | 11 ++++++++---
hw/irq.h | 2 +-
qtest.c | 2 +-
3 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/hw/irq.c b/hw/irq.c
index f4e2a78..60fa152 100644
--- a/hw/irq.c
+++ b/hw/irq.c
@@ -129,8 +129,13 @@ void qemu_irq_intercept_in(qemu_irq *gpio_in,
qemu_irq_handler handler, int n)
}
}
-void qemu_irq_intercept_out(qemu_irq **gpio_out, qemu_irq_handler handler, int
n)
+void qemu_irq_intercept_out(qemu_irq *gpio_out, qemu_irq_handler handler, int
n)
{
- qemu_irq *old_irqs = *gpio_out;
- *gpio_out = qemu_allocate_irqs(handler, old_irqs, n);
+ int i;
+ qemu_irq *old_irqs = qemu_allocate_irqs(NULL, NULL, n);
+ for (i = 0; i < n; i++) {
+ *old_irqs[i] = *gpio_out[i];
+ gpio_out[i]->handler = handler;
+ gpio_out[i]->opaque = old_irqs;
+ }
}
diff --git a/hw/irq.h b/hw/irq.h
index 610e6b7..8dc26cf 100644
--- a/hw/irq.h
+++ b/hw/irq.h
@@ -52,6 +52,6 @@ qemu_irq *qemu_irq_proxy(qemu_irq **target, int n);
/* For internal use in qtest. Similar to qemu_irq_split, but operating
on an existing vector of qemu_irq. */
void qemu_irq_intercept_in(qemu_irq *gpio_in, qemu_irq_handler handler, int n);
-void qemu_irq_intercept_out(qemu_irq **gpio_out, qemu_irq_handler handler, int
n);
+void qemu_irq_intercept_out(qemu_irq *gpio_out, qemu_irq_handler handler, int
n);
#endif
diff --git a/qtest.c b/qtest.c
index fbfab4e..6965910 100644
--- a/qtest.c
+++ b/qtest.c
@@ -232,7 +232,7 @@ static void qtest_process_command(CharDriverState *chr,
gchar **words)
}
if (words[0][14] == 'o') {
- qemu_irq_intercept_out(&dev->gpio_out, qtest_irq_handler,
dev->num_gpio_out);
+ qemu_irq_intercept_out(dev->gpio_out, qtest_irq_handler,
dev->num_gpio_out);
} else {
qemu_irq_intercept_in(dev->gpio_in, qtest_irq_handler,
dev->num_gpio_in);
}
--
1.7.10.2.484.gcd07cc5
- [Qemu-devel] [PATCH v8 00/10] i8254, i8259 and running Microport UNIX (ca 1987), Matthew Ogilvie, 2012/12/16
- [Qemu-devel] [PATCH v8 01/10] fix some debug printf format strings, Matthew Ogilvie, 2012/12/16
- [Qemu-devel] [PATCH v8 02/10] vl: fix -hdachs/-hda argument order parsing issues, Matthew Ogilvie, 2012/12/16
- [Qemu-devel] [PATCH v8 04/10] vga: add some optional CGA compatibility hacks, Matthew Ogilvie, 2012/12/16
- [Qemu-devel] [PATCH v8 03/10] qemu-options.hx: mention retrace= VGA option, Matthew Ogilvie, 2012/12/16
- [Qemu-devel] [PATCH v8 05/10] fix i8254 output logic to match the spec, Matthew Ogilvie, 2012/12/16
- [Qemu-devel] [PATCH v8 06/10] i8259: fix so that dropping IRQ level always clears the interrupt request, Matthew Ogilvie, 2012/12/16
- [Qemu-devel] [PATCH v8 07/10] i8259: refactor pic_set_irq level logic, Matthew Ogilvie, 2012/12/16
- [Qemu-devel] [PATCH v8 08/10] qtest: fix qemu_irq_intercept_out(),
Matthew Ogilvie <=
- [Qemu-devel] [PATCH v8 09/10] qtest: add set_irq_{in, out} infrastructure for testing interrupt controllers, Matthew Ogilvie, 2012/12/16
- [Qemu-devel] [PATCH v8 10/10] add test/pic-test.c, Matthew Ogilvie, 2012/12/16