[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 02/35] qtest: factor out qtest_install_gpio_out_intercept
From: |
Peter Maydell |
Subject: |
[PULL 02/35] qtest: factor out qtest_install_gpio_out_intercept |
Date: |
Thu, 24 Aug 2023 10:28:03 +0100 |
From: Chris Laplante <chris@laplante.io>
Signed-off-by: Chris Laplante <chris@laplante.io>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20230728160324.1159090-3-chris@laplante.io
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
softmmu/qtest.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/softmmu/qtest.c b/softmmu/qtest.c
index f8d764b7190..1b864891629 100644
--- a/softmmu/qtest.c
+++ b/softmmu/qtest.c
@@ -365,6 +365,15 @@ void qtest_set_command_cb(bool (*pc_cb)(CharBackend *chr,
gchar **words))
process_command_cb = pc_cb;
}
+static void qtest_install_gpio_out_intercept(DeviceState *dev, const char
*name, int n)
+{
+ qemu_irq *disconnected = g_new0(qemu_irq, 1);
+ qemu_irq icpt = qemu_allocate_irq(qtest_irq_handler,
+ disconnected, n);
+
+ *disconnected = qdev_intercept_gpio_out(dev, icpt, name, n);
+}
+
static void qtest_process_command(CharBackend *chr, gchar **words)
{
const gchar *command;
@@ -415,12 +424,7 @@ static void qtest_process_command(CharBackend *chr, gchar
**words)
if (words[0][14] == 'o') {
int i;
for (i = 0; i < ngl->num_out; ++i) {
- qemu_irq *disconnected = g_new0(qemu_irq, 1);
- qemu_irq icpt = qemu_allocate_irq(qtest_irq_handler,
- disconnected, i);
-
- *disconnected = qdev_intercept_gpio_out(dev, icpt,
- ngl->name, i);
+ qtest_install_gpio_out_intercept(dev, ngl->name, i);
}
} else {
qemu_irq_intercept_in(ngl->in, qtest_irq_handler,
--
2.34.1
- [PULL 00/35] target-arm queue, Peter Maydell, 2023/08/24
- [PULL 05/35] qtest: irq_intercept_[out/in]: return FAIL if no intercepts are installed, Peter Maydell, 2023/08/24
- [PULL 03/35] qtest: implement named interception of out-GPIO, Peter Maydell, 2023/08/24
- [PULL 06/35] qtest: microbit-test: add tests for nRF51 DETECT, Peter Maydell, 2023/08/24
- [PULL 01/35] hw/gpio/nrf51: implement DETECT signal, Peter Maydell, 2023/08/24
- [PULL 02/35] qtest: factor out qtest_install_gpio_out_intercept,
Peter Maydell <=
- [PULL 04/35] qtest: bail from irq_intercept_in if name is specified, Peter Maydell, 2023/08/24
- [PULL 28/35] target/arm/ptw: Load stage-2 tables from realm physical space, Peter Maydell, 2023/08/24
- [PULL 13/35] target/arm/ptw: Don't set fi->s1ptw for UnsuppAtomicUpdate fault, Peter Maydell, 2023/08/24
- [PULL 24/35] target/arm/ptw: Set attributes correctly for MMU disabled data accesses, Peter Maydell, 2023/08/24
- [PULL 09/35] mips: Report an error when KVM_VM_MIPS_VZ is unavailable, Peter Maydell, 2023/08/24
- [PULL 16/35] target/arm/ptw: Pass ptw into get_phys_addr_pmsa*() and get_phys_addr_disabled(), Peter Maydell, 2023/08/24
- [PULL 11/35] accel/kvm: Free as when an error occurred, Peter Maydell, 2023/08/24
- [PULL 15/35] target/arm/ptw: Set s1ns bit in fault info more consistently, Peter Maydell, 2023/08/24
- [PULL 10/35] accel/kvm: Use negative KVM type for error propagation, Peter Maydell, 2023/08/24
- [PULL 32/35] target/arm/helper: Check SCR_EL3.{NSE, NS} encoding for AT instructions, Peter Maydell, 2023/08/24