qtest: Add set_irq_in command to set IRQ/GPIO level

Adds a new qtest command "set_irq_in" which allows
to set qemu gpio lines to a given level.

Based on https://lists.gnu.org/archive/html/qemu-devel/2012-12/msg02363.html
which never got merged.

Signed-off-by: Steffen Görtz <contrib@steffen-goertz.de>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20190103091119.9367-2-stefanha@redhat.com
Originally-by: Matthew Ogilvie <mmogilvi_qemu@miniinfo.net>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Steffen Görtz 2019-01-07 15:23:47 +00:00 committed by Peter Maydell
parent ead07aa4ef
commit 9813dc6ac3
3 changed files with 66 additions and 0 deletions

View file

@ -230,6 +230,19 @@ void qtest_irq_intercept_in(QTestState *s, const char *string);
*/
void qtest_irq_intercept_out(QTestState *s, const char *string);
/**
* qtest_set_irq_in:
* @s: QTestState instance to operate on.
* @string: QOM path of a device
* @name: IRQ name
* @irq: IRQ number
* @level: IRQ level
*
* Force given device/irq GPIO-in pin to the given level.
*/
void qtest_set_irq_in(QTestState *s, const char *string, const char *name,
int irq, int level);
/**
* qtest_outb:
* @s: #QTestState instance to operate on.