Re: [patch 4/6] x86: irqinit - merge native_init_IRQ

From: Ingo Molnar
Date: Wed Apr 01 2009 - 12:23:26 EST



* Cyrill Gorcunov <gorcunov@xxxxxxxxx> wrote:

> [Ingo Molnar - Wed, Apr 01, 2009 at 04:53:28PM +0200]
> ...
> | > Index: linux-2.6.git/arch/x86/kernel/setup.c
> | > ===================================================================
> | > --- linux-2.6.git.orig/arch/x86/kernel/setup.c
> | > +++ linux-2.6.git/arch/x86/kernel/setup.c
> | > @@ -1087,3 +1087,11 @@ void __init x86_quirk_time_init(void)
> | > setup_irq(0, &irq0);
> | > }
> | > #endif /* CONFIG_X86_32 */
> | > +
> | > +#ifdef CONFIG_X86_64
> | > +void x86_quirk_pre_intr_init(void)
> | > +{
> | > + init_ISA_irqs();
> | > +}
> | > +void x86_quirk_intr_init(void) { }
> | > +#endif
> |
> | Hm, wouldnt it be cleaner to add it as a new quirk function vector
> | in struct x86_quirks? See arch/x86/include/asm/setup.h.
> |
> | Ingo
> |
>
> I just remember -- I thought about that and since
> x86_quirk_pre_intr_init described as external BUT implemented for
> x86-32 only I needed to indroduce new x86-64 versions for this
> (and since I know that there no need to do anything else except
> calling init_ISA_irqs I desided to have separate wrapper for
> that).
>
> And btw x86-32 already has init_ISA_irqs call and quirks are used
> in x86-32 mode only so for 64bit it will be just a not needed
> check. Which means - I could just use original
> x86_quirk_pre_intr_init function which will call all I need.
>
> Or you meant something else?

The typical solution there is to make the entry NULL in the 64-bit
case. All the quirk handlers are conditional like this:

arch/x86/kernel/mpparse.c: if (x86_quirks->mpc_apic_id)
arch/x86/kernel/mpparse.c: apicid = x86_quirks->mpc_apic_id(m);

or am i missing something?

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/