Skip to content

Commit 8941290

Browse files
author
Andre Beckus
committed
Update GPIO IRQ structure reference to match new location in QEMU
1 parent b37e56f commit 8941290

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

hw/gpio/stm32_gpio.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,15 @@ static void stm32_gpio_GPIOx_ODR_write(Stm32Gpio *s, uint32_t new_value)
158158
*/
159159
if (changed_out & BIT(pin)) {
160160
qemu_set_irq(
161-
DEVICE(s)->gpio_out[pin],
161+
/* The "irq_intercept_out" command in the qtest
162+
framework overwrites the out IRQ array in the
163+
NamedGPIOList structure (via the
164+
qemu_irq_intercept_out procedure). So we need
165+
to reference this structure directly (rather than
166+
use our local s->out_irq array) in order for
167+
the unit tests to work. This is something of a hack,
168+
but I don't have a solution yet. */
169+
s->busdev.parent_obj.gpios.lh_first->out[pin],
162170
(s->GPIOx_ODR & BIT(pin)) ? 1 : 0);
163171
}
164172
}

0 commit comments

Comments
 (0)