diff mbox series

[02/10] hw/isa: Add the ISA_IRQ_KBD_DEFAULT definition

Message ID 20201011193229.3210774-3-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 keyboard uses IRQ #1 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/sparc64/sun4u.c   | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h
index 2a052ffa025..e139b88c992 100644
--- a/include/hw/isa/isa.h
+++ b/include/hw/isa/isa.h
@@ -9,6 +9,7 @@ 
 #include "qom/object.h"
 
 enum IsaIrqNumber {
+    ISA_IRQ_KBD_DEFAULT =  1,
     ISA_NUM_IRQS        = 16
 };
 
diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
index ad5ca2472a4..d4c39490cd9 100644
--- a/hw/sparc64/sun4u.c
+++ b/hw/sparc64/sun4u.c
@@ -615,7 +615,7 @@  static void sun4uv_init(MemoryRegion *address_space_mem,
         qdev_get_gpio_in_named(DEVICE(sabre), "pbm-irq", OBIO_LPT_IRQ));
     qdev_connect_gpio_out_named(DEVICE(ebus), "isa-irq", 6,
         qdev_get_gpio_in_named(DEVICE(sabre), "pbm-irq", OBIO_FDD_IRQ));
-    qdev_connect_gpio_out_named(DEVICE(ebus), "isa-irq", 1,
+    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_get_gpio_in_named(DEVICE(sabre), "pbm-irq", OBIO_MSE_IRQ));