hw/ipack: Remove legacy qemu_allocate_irqs() use

No need to dynamically allocate IRQ when we know before hands
how many we'll use. Declare the 2 of them in IPackDevice state
and initialize them in the DeviceRealize handler.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20250121155526.29982-4-philmd@linaro.org>
This commit is contained in:
Philippe Mathieu-Daudé 2025-01-21 08:34:55 +01:00
parent 29df910401
commit d50280af1b
4 changed files with 8 additions and 14 deletions

View file

@ -12,6 +12,7 @@
#define QEMU_IPACK_H
#include "hw/qdev-core.h"
#include "hw/irq.h"
#include "qom/object.h"
@ -19,10 +20,8 @@
OBJECT_DECLARE_SIMPLE_TYPE(IPackBus, IPACK_BUS)
struct IPackBus {
/*< private >*/
BusState parent_obj;
/* All fields are private */
uint8_t n_slots;
uint8_t free_slot;
qemu_irq_handler set_irq;
@ -58,13 +57,11 @@ struct IPackDeviceClass {
};
struct IPackDevice {
/*< private >*/
DeviceState parent_obj;
/*< public >*/
int32_t slot;
/* IRQ objects for the IndustryPack INT0# and INT1# */
qemu_irq *irq;
IRQState irq[2];
};
extern const VMStateDescription vmstate_ipack_device;