qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 10/10] hw/isa: Add the ISA_IRQ_IDE_DEFAULT definition


From: John Snow
Subject: Re: [PATCH 10/10] hw/isa: Add the ISA_IRQ_IDE_DEFAULT definition
Date: Mon, 12 Oct 2020 10:16:07 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0

On 10/11/20 3:32 PM, Philippe Mathieu-Daudé wrote:
The IDE controller uses IRQ #14 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/ide/isa.c         | 2 +-
  2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h
index 43cdc3c47b6..05622ee11e2 100644
--- a/include/hw/isa/isa.h
+++ b/include/hw/isa/isa.h
@@ -17,6 +17,7 @@ enum IsaIrqNumber {
      ISA_IRQ_RTC_DEFAULT =  8,
      ISA_IRQ_NET_DEFAULT =  9,
      ISA_IRQ_MOU_DEFAULT = 12,
+    ISA_IRQ_IDE_DEFAULT = 14,
      ISA_NUM_IRQS        = 16
  };
diff --git a/hw/ide/isa.c b/hw/ide/isa.c
index 6bc19de2265..2412d568937 100644
--- a/hw/ide/isa.c
+++ b/hw/ide/isa.c
@@ -108,7 +108,7 @@ ISADevice *isa_ide_init(ISABus *bus, int iobase, int 
iobase2, int isairq,
  static Property isa_ide_properties[] = {
      DEFINE_PROP_UINT32("iobase",  ISAIDEState, iobase,  0x1f0),
      DEFINE_PROP_UINT32("iobase2", ISAIDEState, iobase2, 0x3f6),
-    DEFINE_PROP_UINT32("irq",    ISAIDEState, isairq,  14),
+    DEFINE_PROP_UINT32("irq", ISAIDEState, isairq, ISA_IRQ_IDE_DEFAULT),
      DEFINE_PROP_END_OF_LIST(),
  };

Acked-by: John Snow <jsnow@redhat.com>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]