diff mbox series

[03/10] hw/isa: Add the ISA_IRQ_SER_DEFAULT definition

Message ID 20201011193229.3210774-4-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 first serial port uses IRQ #4 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(-)

Comments

Gerd Hoffmann Oct. 13, 2020, 7:14 a.m. UTC | #1
On Sun, Oct 11, 2020 at 09:32:22PM +0200, Philippe Mathieu-Daudé wrote:
> The first serial port uses IRQ #4 by default. Add this

      ^^^^^
> +    ISA_IRQ_SER_DEFAULT =  4,


... so name this SER1 maybe?  And add SER2 = 3?

take care,
  Gerd
diff mbox series

Patch

diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h
index e139b88c992..519296d5823 100644
--- a/include/hw/isa/isa.h
+++ b/include/hw/isa/isa.h
@@ -10,6 +10,7 @@ 
 
 enum IsaIrqNumber {
     ISA_IRQ_KBD_DEFAULT =  1,
+    ISA_IRQ_SER_DEFAULT =  4,
     ISA_NUM_IRQS        = 16
 };
 
diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
index d4c39490cd9..6e42467d5cc 100644
--- a/hw/sparc64/sun4u.c
+++ b/hw/sparc64/sun4u.c
@@ -619,7 +619,7 @@  static void sun4uv_init(MemoryRegion *address_space_mem,
         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));
-    qdev_connect_gpio_out_named(DEVICE(ebus), "isa-irq", 4,
+    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));
 
     switch (vga_interface_type) {