qtest: implement named interception of out-GPIO

Adds qtest_irq_intercept_out_named method, which utilizes a new optional
name parameter to the irq_intercept_out qtest command.

Signed-off-by: Chris Laplante <chris@laplante.io>
Message-id: 20230728160324.1159090-4-chris@laplante.io
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Chris Laplante 2023-08-22 17:31:00 +01:00 committed by Peter Maydell
parent 7458dcf4e6
commit a8610f8bd7
3 changed files with 27 additions and 8 deletions

View file

@ -993,6 +993,12 @@ void qtest_irq_intercept_out(QTestState *s, const char *qom_path)
qtest_rsp(s);
}
void qtest_irq_intercept_out_named(QTestState *s, const char *qom_path, const char *name)
{
qtest_sendf(s, "irq_intercept_out %s %s\n", qom_path, name);
qtest_rsp(s);
}
void qtest_irq_intercept_in(QTestState *s, const char *qom_path)
{
qtest_sendf(s, "irq_intercept_in %s\n", qom_path);

View file

@ -371,6 +371,17 @@ void qtest_irq_intercept_in(QTestState *s, const char *string);
*/
void qtest_irq_intercept_out(QTestState *s, const char *string);
/**
* qtest_irq_intercept_out_named:
* @s: #QTestState instance to operate on.
* @qom_path: QOM path of a device.
* @name: Name of the GPIO out pin
*
* Associate a qtest irq with the named GPIO-out pin of the device
* whose path is specified by @string and whose name is @name.
*/
void qtest_irq_intercept_out_named(QTestState *s, const char *qom_path, const char *name);
/**
* qtest_set_irq_in:
* @s: QTestState instance to operate on.