more fun with gcc 3.2

Ronald G. Minnich rminnich at lanl.gov
Mon Dec 9 18:12:00 CET 2002


I just fixed ANOTHER PIRQ problem with gcc 3.2

Erik Hendriks has been pointing out to me that this usage of [] looks 
shaky, and my reaction was "Yeah, but I don't want to fix it" and also 
"Yeah, but it's in C99!". So I hoped not to have to fix it -- it's 
supposed to work.

Well, now I've had to. 

Gcc was generating bad code for the PIRQ table for this one case. The 
symptom was that it failed to put in the first intializer for the slots. 
Then everything else went to pieces.

So I have made the following changes to 
the pirq_routing.h file:

If IRQ_SLOT_COUNT is defined, then slots are declared as follows:
struct irq_info slots[IRQ_SLOT_COUNT];

otherwise it reverts to the original declaration for GCC 2.0:
struct irq_info slots[0];

And for 3.0 you get the C99 version:
struct irq_info slots[];

To use this, you set the IRQ_SLOT_COUNT. SO, for example, in 
the mainboard irq_tables.c for the supermicro p4dpr:
#define IRQ_SLOT_COUNT 24
#include <arch.pirq_routing.h>

Then, down below, have exactly that many struct initializations. 

Less magic, less bugs, more happy users :-)

ron
p.s. Erik and Greg, I don't want to hear it :-) Yeah, yeah, yeah, you're 
right :-) 




More information about the coreboot mailing list