Message ID | 20201011193229.3210774-9-f4bug@amsat.org |
---|---|
State | New |
Headers | show |
Series | hw/isa: Introduce definitions for default IRQ values | expand |
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
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.
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 --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(), };
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(-)