diff options
author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2025-01-21 16:37:02 +0100 |
---|---|---|
committer | Philippe Mathieu-Daudé <philmd@linaro.org> | 2025-01-31 19:36:44 +0100 |
commit | c17943b00fd98c64d2fa591f1da72cb9a4f61133 (patch) | |
tree | 4a5dc0101a2fb3fecdc002336129e9b94a18fee9 /hw/core | |
parent | 70bc20311f760da9bd93f20cd7bda7419778f858 (diff) | |
download | qemu-c17943b00fd98c64d2fa591f1da72cb9a4f61133.zip qemu-c17943b00fd98c64d2fa591f1da72cb9a4f61133.tar.gz qemu-c17943b00fd98c64d2fa591f1da72cb9a4f61133.tar.bz2 |
hw/irq: Introduce qemu_init_irqs() helper
While qemu_init_irq() initialize a single IRQ,
qemu_init_irqs() initialize an array of them.
Suggested-by: Bernhard Beschow <shentey@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20250121155526.29982-2-philmd@linaro.org>
Diffstat (limited to 'hw/core')
-rw-r--r-- | hw/core/irq.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/core/irq.c b/hw/core/irq.c index 7d5b003..6dd8d47 100644 --- a/hw/core/irq.c +++ b/hw/core/irq.c @@ -49,6 +49,14 @@ void qemu_init_irq(IRQState *irq, qemu_irq_handler handler, void *opaque, init_irq_fields(irq, handler, opaque, n); } +void qemu_init_irqs(IRQState irq[], size_t count, + qemu_irq_handler handler, void *opaque) +{ + for (size_t i = 0; i < count; i++) { + qemu_init_irq(&irq[i], handler, opaque, i); + } +} + qemu_irq *qemu_extend_irqs(qemu_irq *old, int n_old, qemu_irq_handler handler, void *opaque, int n) { |