@@ -16,6 +16,7 @@ enum IsaIrqNumber {
ISA_IRQ_PAR_DEFAULT = 7,
ISA_IRQ_RTC_DEFAULT = 8,
ISA_IRQ_NET_DEFAULT = 9,
+ ISA_IRQ_MOU_DEFAULT = 12,
ISA_NUM_IRQS = 16
};
@@ -577,7 +577,7 @@ static void i8042_build_aml(ISADevice *isadev, Aml *scope)
aml_append(kbd, aml_name_decl("_CRS", crs));
crs = aml_resource_template();
- aml_append(crs, aml_irq_no_flags(12));
+ aml_append(crs, aml_irq_no_flags(ISA_IRQ_MOU_DEFAULT));
mou = aml_device("MOU");
aml_append(mou, aml_name_decl("_HID", aml_eisaid("PNP0F13")));
@@ -617,7 +617,7 @@ static void sun4uv_init(MemoryRegion *address_space_mem,
qdev_get_gpio_in_named(DEVICE(sabre), "pbm-irq", OBIO_FDD_IRQ));
qdev_connect_gpio_out_named(DEVICE(ebus), "isa-irq", ISA_IRQ_KBD_DEFAULT,
qdev_get_gpio_in_named(DEVICE(sabre), "pbm-irq", OBIO_KBD_IRQ));
- qdev_connect_gpio_out_named(DEVICE(ebus), "isa-irq", 12,
+ qdev_connect_gpio_out_named(DEVICE(ebus), "isa-irq", ISA_IRQ_MOU_DEFAULT,
qdev_get_gpio_in_named(DEVICE(sabre), "pbm-irq", OBIO_MSE_IRQ));
qdev_connect_gpio_out_named(DEVICE(ebus), "isa-irq", ISA_IRQ_SER_DEFAULT,
qdev_get_gpio_in_named(DEVICE(sabre), "pbm-irq", OBIO_SER_IRQ));
The PS2 mouse uses IRQ #12 by default. Add this default definition to the IsaIrqNumber enum. Avoid magic values in the code, replace them by the newly introduced definition. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> --- include/hw/isa/isa.h | 1 + hw/input/pckbd.c | 2 +- hw/sparc64/sun4u.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-)