diff mbox series

[08/10] hw/isa: Add the ISA_IRQ_NET_DEFAULT definition

Message ID 20201011193229.3210774-9-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 network devices use IRQ #9 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/net/ne2000-isa.c  | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

Comments

Gerd Hoffmann Oct. 13, 2020, 7:23 a.m. UTC | #1
On Sun, Oct 11, 2020 at 09:32:27PM +0200, Philippe Mathieu-Daudé wrote:
> The network devices use IRQ #9 by default. Add this

> default definition to the IsaIrqNumber enum.


IRQ #9 seems to be sort-of standard for acpi.  Not sure whenever that is
actually written down somewhere.  IIRC in pre-ACPI days it was free
like irq #5.

take care,
  Gerd
Philippe Mathieu-Daudé Oct. 13, 2020, 8:27 a.m. UTC | #2
On 10/13/20 9:23 AM, Gerd Hoffmann wrote:
> On Sun, Oct 11, 2020 at 09:32:27PM +0200, Philippe Mathieu-Daudé wrote:

>> The network devices use IRQ #9 by default. Add this

>> default definition to the IsaIrqNumber enum.

> 

> IRQ #9 seems to be sort-of standard for acpi.  Not sure whenever that is

> actually written down somewhere.  IIRC in pre-ACPI days it was free

> like irq #5.


OK, I'll drop this patch.

Thanks,

Phil.
Stefan Berger Oct. 13, 2020, 2:20 p.m. UTC | #3
On 10/13/20 3:23 AM, Gerd Hoffmann wrote:
> On Sun, Oct 11, 2020 at 09:32:27PM +0200, Philippe Mathieu-Daudé wrote:

>> The network devices use IRQ #9 by default. Add this

>> default definition to the IsaIrqNumber enum.

> IRQ #9 seems to be sort-of standard for acpi.  Not sure whenever that is

> actually written down somewhere.  IIRC in pre-ACPI days it was free

> like irq #5.


Best docu I could find was this one:

https://en.wikipedia.org/wiki/Interrupt_request_(PC_architecture)#Master_PIC


>

> take care,

>    Gerd

>
diff mbox series

Patch

diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h
index 9f78ff11246..11166592246 100644
--- a/include/hw/isa/isa.h
+++ b/include/hw/isa/isa.h
@@ -15,6 +15,7 @@  enum IsaIrqNumber {
     ISA_IRQ_FDC_DEFAULT =  6,
     ISA_IRQ_PAR_DEFAULT =  7,
     ISA_IRQ_RTC_DEFAULT =  8,
+    ISA_IRQ_NET_DEFAULT =  9,
     ISA_NUM_IRQS        = 16
 };
 
diff --git a/hw/net/ne2000-isa.c b/hw/net/ne2000-isa.c
index dd6f6e34d3c..e31e86c14af 100644
--- a/hw/net/ne2000-isa.c
+++ b/hw/net/ne2000-isa.c
@@ -80,7 +80,7 @@  static void isa_ne2000_realizefn(DeviceState *dev, Error **errp)
 
 static Property ne2000_isa_properties[] = {
     DEFINE_PROP_UINT32("iobase", ISANE2000State, iobase, 0x300),
-    DEFINE_PROP_UINT32("irq",   ISANE2000State, isairq, 9),
+    DEFINE_PROP_UINT32("irq", ISANE2000State, isairq, ISA_IRQ_NET_DEFAULT),
     DEFINE_NIC_PROPERTIES(ISANE2000State, ne2000.c),
     DEFINE_PROP_END_OF_LIST(),
 };