[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 05/10] hw/isa: Add the ISA_IRQ_FDC_DEFAULT definition
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 05/10] hw/isa: Add the ISA_IRQ_FDC_DEFAULT definition |
Date: |
Sun, 11 Oct 2020 21:32:24 +0200 |
The floppy disk controller uses IRQ #6 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/block/fdc.c | 4 ++--
hw/sparc64/sun4u.c | 2 +-
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h
index e4f2aed004f..214a6730598 100644
--- a/include/hw/isa/isa.h
+++ b/include/hw/isa/isa.h
@@ -12,6 +12,7 @@ enum IsaIrqNumber {
ISA_IRQ_KBD_DEFAULT = 1,
ISA_IRQ_SER_DEFAULT = 4,
ISA_IRQ_TPM_DEFAULT = 5,
+ ISA_IRQ_FDC_DEFAULT = 6,
ISA_NUM_IRQS = 16
};
diff --git a/hw/block/fdc.c b/hw/block/fdc.c
index 4c2c35e223a..531fc4c0b72 100644
--- a/hw/block/fdc.c
+++ b/hw/block/fdc.c
@@ -2855,7 +2855,7 @@ static void fdc_isa_build_aml(ISADevice *isadev, Aml
*scope)
crs = aml_resource_template();
aml_append(crs, aml_io(AML_DECODE16, 0x03F2, 0x03F2, 0x00, 0x04));
aml_append(crs, aml_io(AML_DECODE16, 0x03F7, 0x03F7, 0x00, 0x01));
- aml_append(crs, aml_irq_no_flags(6));
+ aml_append(crs, aml_irq_no_flags(ISA_IRQ_FDC_DEFAULT));
aml_append(crs,
aml_dma(AML_COMPATIBILITY, AML_NOTBUSMASTER, AML_TRANSFER8, 2));
@@ -2889,7 +2889,7 @@ static const VMStateDescription vmstate_isa_fdc ={
static Property isa_fdc_properties[] = {
DEFINE_PROP_UINT32("iobase", FDCtrlISABus, iobase, 0x3f0),
- DEFINE_PROP_UINT32("irq", FDCtrlISABus, irq, 6),
+ DEFINE_PROP_UINT32("irq", FDCtrlISABus, irq, ISA_IRQ_FDC_DEFAULT),
DEFINE_PROP_UINT32("dma", FDCtrlISABus, dma, 2),
DEFINE_PROP_DRIVE("driveA", FDCtrlISABus, state.qdev_for_drives[0].blk),
DEFINE_PROP_DRIVE("driveB", FDCtrlISABus, state.qdev_for_drives[1].blk),
diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
index 6e42467d5cc..458dc215e6f 100644
--- a/hw/sparc64/sun4u.c
+++ b/hw/sparc64/sun4u.c
@@ -613,7 +613,7 @@ static void sun4uv_init(MemoryRegion *address_space_mem,
/* Wire up "well-known" ISA IRQs to PBM legacy obio IRQs */
qdev_connect_gpio_out_named(DEVICE(ebus), "isa-irq", 7,
qdev_get_gpio_in_named(DEVICE(sabre), "pbm-irq", OBIO_LPT_IRQ));
- qdev_connect_gpio_out_named(DEVICE(ebus), "isa-irq", 6,
+ 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));
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));
--
2.26.2
- [PATCH 01/10] hw/isa: Introduce IsaIrqNumber enum, (continued)
- [PATCH 05/10] hw/isa: Add the ISA_IRQ_FDC_DEFAULT definition,
Philippe Mathieu-Daudé <=
- [PATCH 07/10] hw/isa: Add the ISA_IRQ_RTC_DEFAULT definition, Philippe Mathieu-Daudé, 2020/10/11
- [PATCH 06/10] hw/isa: Add the ISA_IRQ_PAR_DEFAULT definition, Philippe Mathieu-Daudé, 2020/10/11
- [PATCH 08/10] hw/isa: Add the ISA_IRQ_NET_DEFAULT definition, Philippe Mathieu-Daudé, 2020/10/11
- [PATCH 09/10] hw/isa: Add the ISA_IRQ_MOU_DEFAULT definition, Philippe Mathieu-Daudé, 2020/10/11
- [PATCH 10/10] hw/isa: Add the ISA_IRQ_IDE_DEFAULT definition, Philippe Mathieu-Daudé, 2020/10/11