@@ -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
};
@@ -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(),
};
@@ -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));
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(-)