diff mbox series

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

Message ID 20201011193229.3210774-11-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 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(-)

Comments

John Snow Oct. 12, 2020, 2:16 p.m. UTC | #1
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>
Gerd Hoffmann Oct. 13, 2020, 7:25 a.m. UTC | #2
On Sun, Oct 11, 2020 at 09:32:29PM +0200, Philippe Mathieu-Daudé wrote:
> The IDE controller uses IRQ #14 by default. Add this

> default definition to the IsaIrqNumber enum.


primary, while secondary uses IRQ 15.

take care,
  Gerd
diff mbox series

Patch

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