2002-01-28 00:27:00

by Brian Gerst

[permalink] [raw]
Subject: [PATCH] Fix NR_IRQS when no IO apic

diff -urN linux-2.5.3-pre5/include/asm-i386/irq.h linux/include/asm-i386/irq.h
--- linux-2.5.3-pre5/include/asm-i386/irq.h Fri Jan 25 02:25:47 2002
+++ linux/include/asm-i386/irq.h Fri Jan 25 11:30:44 2002
@@ -23,7 +23,11 @@
* Since vectors 0x00-0x1f are used/reserved for the CPU,
* the usable vector space is 0x20-0xff (224 vectors)
*/
+#ifdef CONFIG_X86_IO_APIC
#define NR_IRQS 224
+#else
+#define NR_IRQS 16
+#endif

static __inline__ int irq_cannonicalize(int irq)
{


Attachments:
nrirqs-1 (483.00 B)

2002-01-28 00:42:34

by Jeff Garzik

[permalink] [raw]
Subject: Re: [PATCH] Fix NR_IRQS when no IO apic

Brian Gerst wrote:
>
> NR_IRQS should be 16 when the IO apic is not configured, as the 8259 PIC
> cannot generate any more interrupts. It also fixes a bug where the IDT
> gets populated with random addresses, since only 16 entry stubs are
> created.

> +#ifdef CONFIG_X86_IO_APIC
> #define NR_IRQS 224
> +#else
> +#define NR_IRQS 16
> +#endif

What about when ioapic is configured but not present?

Jeff



--
Jeff Garzik | "I went through my candy like hot oatmeal
Building 1024 | through an internally-buttered weasel."
MandrakeSoft | - goats.com

2002-01-28 00:51:07

by Brian Gerst

[permalink] [raw]
Subject: Re: [PATCH] Fix NR_IRQS when no IO apic

Jeff Garzik wrote:
>
> Brian Gerst wrote:
> >
> > NR_IRQS should be 16 when the IO apic is not configured, as the 8259 PIC
> > cannot generate any more interrupts. It also fixes a bug where the IDT
> > gets populated with random addresses, since only 16 entry stubs are
> > created.
>
> > +#ifdef CONFIG_X86_IO_APIC
> > #define NR_IRQS 224
> > +#else
> > +#define NR_IRQS 16
> > +#endif
>
> What about when ioapic is configured but not present?

No problem, just wasted memory. With CONFIG_X86_IO_APIC, all 224 entry
stubs are created. See arch/i386/kernel/i8259.c

--

Brian Gerst

2002-01-28 01:02:49

by Robert Love

[permalink] [raw]
Subject: Re: [PATCH] Fix NR_IRQS when no IO apic

On Sun, 2002-01-27 at 19:42, Jeff Garzik wrote:

> What about when ioapic is configured but not present?

Then we are back where we started? Which, unless I am missing
something, is just a waste of memory?

I see this as a no-change if CONFIG_X86_IO_APIC is set, but a proper
setting of NR_IRQS (which doesn't hurt anything but make our
arrays/loops/etc off if not set) for the case of non-IOAPIC.

Robert Love