From: Kevin O'Connor Date: Sat, 28 Feb 2009 02:04:09 +0000 (-0500) Subject: Copy mptable floater and config tables when on coreboot. X-Git-Tag: rel-0.4.1~129 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=47e2093f6a1b7151abd5bdc911b57687bdcc47d7;p=seabios.git Copy mptable floater and config tables when on coreboot. Linux kernels don't like the mp config table being in high memory - so copy it to low memory during scan. --- diff --git a/src/coreboot.c b/src/coreboot.c index 62f8ff6..7b8c86f 100644 --- a/src/coreboot.c +++ b/src/coreboot.c @@ -51,13 +51,20 @@ copy_mptable(void *pos) return; u32 length = p->length * 16; bios_table_cur_addr = ALIGN(bios_table_cur_addr, 16); - if (bios_table_cur_addr + length > bios_table_end_addr) { + u16 mpclength = ((struct mptable_config_s *)p->physaddr)->length; + if (bios_table_cur_addr + length + mpclength > bios_table_end_addr) { dprintf(1, "No room to copy MPTABLE!\n"); return; } - dprintf(1, "Copying MPTABLE from %p to %x\n", pos, bios_table_cur_addr); + dprintf(1, "Copying MPTABLE from %p/%x to %x\n" + , pos, p->physaddr, bios_table_cur_addr); memcpy((void*)bios_table_cur_addr, pos, length); - bios_table_cur_addr += length; + struct mptable_floating_s *newp = (void*)bios_table_cur_addr; + newp->physaddr = bios_table_cur_addr + length; + newp->checksum = 0; + newp->checksum = -checksum(newp, sizeof(*newp)); + memcpy((void*)bios_table_cur_addr + length, (void*)p->physaddr, mpclength); + bios_table_cur_addr += length + mpclength; } static void