[coreboot] romcc segfaults; serious help needed

Keith Hui buurin at gmail.com
Thu Mar 11 04:25:43 CET 2010


Hi guys,

I posted a new 440BX RAM init code a few days ago that was segfaulting
romcc, and I didn't get any response.

In the meantime I have narrowed the cause to this code fragment, with enough
wrapper added so it can be fed to romcc on its own:

void romcc_fail(void) {
int dimm03 = 0;
int dimm47 = 0;
char mbsc[5];
char mbfs[3];
/* begin actual fragment */
        if (dimm03 > 2) {
                mbsc[4] |= 0x80;
                mbsc[1] |= 0x28;
                mbfs[2] |= 0x40;
                mbfs[0] |= 0x60;
        } else {
                mbsc[4] |= 0xc0;
                mbsc[1] |= 0x3c;
        }
        if ((dimm03 + dimm47) > 4) {
                mbsc[4]  = 0xba;
                mbsc[0]  = 0x30;
                mbfs[0] |= 0x02;
        } else {
                mbsc[0]  = 0x2c;
        }
        if (dimm47 > 2) {
                mbsc[4] |= 0x20;
                mbsc[1] |= 0x02;
                mbsc[0] |= 0x80;
                mbfs[2] |= 0x20;
                mbfs[0] |= 0x18;
        } else {
                mbsc[4] |= 0x30;
                mbsc[1] |= 0x03;
                mbsc[0] |= 0xc0;
        }
/* end actual fragment */
}

There are three similar constructs, any one of them is enough to cause a
segfault.

mbfs and mbsc are meant to be an array of bytes that make up the MBFS and
MBSC registers in the 440BX, to be written out to it once they're all set.

Thanks for all help
Keith
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20100310/b0020ead/attachment.html>


More information about the coreboot mailing list