Fix x86 subarch breakage by the patch to allow more APIC irq sources
The problem with this patch was that it defined a new quantity NR_IRQ_VECTORS. However, the definition of NR_IRQ_VECTORS is only in mach-default/irq_vectors.h. Every subarch which defines it's own irq_vectors.h (that's voyager, visws and pc9800) now won't compile.
I think the best fix is the attached (although you could clean up mach-default/irq_vectors.h with this too).
James
===== include/asm-i386/irq.h 1.9 vs edited =====
include/asm-i386/irq.h +4 -0
@@ -15,6 +15,10 @@/* include comes from machine specific directory */ #include "irq_vectors.h" +#ifndef NR_IRQ_VECTORS +#define NR_IRQ_VECTORS NR_IRQS +#endif +static __inline__int irq_canonicalize (int irq) {return ((irq ==2 ) ?9 : irq);
Quoted 3 lines · James Bottomley
I think the best fix is the attached (although you could clean up
mach-default/irq_vectors.hwith this too).
I'd much rather do this the other way: I _detest_ "generic" values that architectures can override, when just defining the value in the architecture directly is smaller than the test for the generic value.
So I'd rather just see the sub-architectures add their own #defines, like the appended.
That way there is a direct and clear causal relationship, not some kind of "if this value doesn't exist, then we use that other value" indirection.
Linus
----
===== include/asm-i386/mach-pc9800/irq_vectors.h 1.1 vs edited =====
include/asm-i386/mach-pc9800/irq_vectors.h +5 -0
@@ -18,6 +18,9 @@* The total number of interrupt vectors (including all the * architecture specific interrupts) needed. * +* NR_IRQ_VECTORS: +* The total number of IO APIC vector inputs +* */ #ifndef _ASM_IRQ_VECTORS_H#define _ASM_IRQ_VECTORS_H
@@ -81,6 +84,8 @@#else #define NR_IRQS 16#endif + +#define NR_IRQ_VECTORS NR_IRQS#define FPU_IRQ 8
===== include/asm-i386/mach-visws/irq_vectors.h 1.5 vs edited =====
include/asm-i386/mach-visws/irq_vectors.h +1 -0
@@ -50,6 +50,7 @@* */ #define NR_IRQS 224 +#define NR_IRQ_VECTORS NR_IRQS#define FPU_IRQ 13
===== include/asm-i386/mach-voyager/irq_vectors.h 1.3 vs edited =====
include/asm-i386/mach-voyager/irq_vectors.h +1 -0
@@ -56,6 +56,7 @@#define VIC_CPU_BOOT_ERRATA_CPI (VIC_CPI_LEVEL0 + 8)#define NR_IRQS 224 +#define NR_IRQ_VECTORS NR_IRQS#define FPU_IRQ 13
Quoted 3 lines · Linus Torvalds
I'd much rather do this the other way: I _detest_ "generic" values that architectures can override, when just defining the value in the architecture directly is smaller than the test for the generic value.
That's fine by me...I was originally going to do it that way until I saw that two other subarchs had the same problem.
James
Oops! You're right. Sorry, for some reason I thought all the sub-arches would inherit the default definition. Obviously that wasn't the case.
And, I like Linus' solution to it.
Quoted 24 lines · James Bottomley
The problem with this patch was that it defined a new quantity
NR_IRQ_VECTORS. However, the definition ofNR_IRQ_VECTORSis only inmach-default/irq_vectors.h. Every subarch which defines it's ownirq_vectors.h(that's voyager, visws and pc9800) now won't compile.I think the best fix is the attached (although you could clean up
mach-default/irq_vectors.hwith this too).James
=====
include/asm-i386/irq.h1.9 vs edited =====include/asm-i386/irq.h +4
-0@@ -15,6 +15,10 @@/* include comes from machine specific directory */ #include "irq_vectors.h" +#ifndef NR_IRQ_VECTORS +#define NR_IRQ_VECTORS NR_IRQS +#endif +static __inline__int irq_canonicalize (int irq) {return ((irq ==2 ) ?9 : irq);
Signature · 3 lines
James Cleverdon
IBM xSeries Linux Solutions
{jamesclv(Unix, preferred), cleverdj(Notes)} at us dot ibm dot comm