diff mbox series

[06/10] hw/isa: Add the ISA_IRQ_PAR_DEFAULT definition

Message ID 20201011193229.3210774-7-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 parallel port uses IRQ #7 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/char/parallel.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 214a6730598..081fa446152 100644
--- a/include/hw/isa/isa.h
+++ b/include/hw/isa/isa.h
@@ -13,6 +13,7 @@  enum IsaIrqNumber {
     ISA_IRQ_SER_DEFAULT =  4,
     ISA_IRQ_TPM_DEFAULT =  5,
     ISA_IRQ_FDC_DEFAULT =  6,
+    ISA_IRQ_PAR_DEFAULT =  7,
     ISA_NUM_IRQS        = 16
 };
 
diff --git a/hw/char/parallel.c b/hw/char/parallel.c
index 8b418abf719..9e0d80ec0d0 100644
--- a/hw/char/parallel.c
+++ b/hw/char/parallel.c
@@ -636,7 +636,7 @@  bool parallel_mm_init(MemoryRegion *address_space,
 static Property parallel_isa_properties[] = {
     DEFINE_PROP_UINT32("index", ISAParallelState, index,   -1),
     DEFINE_PROP_UINT32("iobase", ISAParallelState, iobase,  -1),
-    DEFINE_PROP_UINT32("irq",   ISAParallelState, isairq,  7),
+    DEFINE_PROP_UINT32("irq",   ISAParallelState, isairq,  ISA_IRQ_PAR_DEFAULT),
     DEFINE_PROP_CHR("chardev",  ISAParallelState, state.chr),
     DEFINE_PROP_END_OF_LIST(),
 };
diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
index 458dc215e6f..c5b3e838ac2 100644
--- a/hw/sparc64/sun4u.c
+++ b/hw/sparc64/sun4u.c
@@ -611,7 +611,7 @@  static void sun4uv_init(MemoryRegion *address_space_mem,
     pci_realize_and_unref(ebus, pci_busA, &error_fatal);
 
     /* Wire up "well-known" ISA IRQs to PBM legacy obio IRQs */
-    qdev_connect_gpio_out_named(DEVICE(ebus), "isa-irq", 7,
+    qdev_connect_gpio_out_named(DEVICE(ebus), "isa-irq", ISA_IRQ_PAR_DEFAULT,
         qdev_get_gpio_in_named(DEVICE(sabre), "pbm-irq", OBIO_LPT_IRQ));
     qdev_connect_gpio_out_named(DEVICE(ebus), "isa-irq", ISA_IRQ_FDC_DEFAULT,
         qdev_get_gpio_in_named(DEVICE(sabre), "pbm-irq", OBIO_FDD_IRQ));