diff mbox series

[09/10] hw/isa: Add the ISA_IRQ_MOU_DEFAULT definition

Message ID 20201011193229.3210774-10-f4bug@amsat.org
State New
Headers show
Series hw/isa: Introduce definitions for default IRQ values | expand

Commit Message

Philippe Mathieu-Daudé Oct. 11, 2020, 7:32 p.m. UTC
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(-)
diff mbox series

Patch

diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h
index 11166592246..43cdc3c47b6 100644
--- a/include/hw/isa/isa.h
+++ b/include/hw/isa/isa.h
@@ -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
 };
 
diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c
index dde85ba6c68..140c992b03b 100644
--- a/hw/input/pckbd.c
+++ b/hw/input/pckbd.c
@@ -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")));
diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
index c5b3e838ac2..ddd51c7cbbe 100644
--- a/hw/sparc64/sun4u.c
+++ b/hw/sparc64/sun4u.c
@@ -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));