diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2008-06-21 19:46:43 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2008-06-21 19:46:43 -0400 |
commit | e10e6f849d328a47ca878b8d4428751f25508341 (patch) | |
tree | ba2aa35dd69da92dbf615a15461cc2cf0eb46bc7 /src/coreboot.c | |
parent | d703c001ffe3f42740a4d3c4b885d26f1ab16d5c (diff) | |
download | seabios-e10e6f849d328a47ca878b8d4428751f25508341.tar.gz |
Scan for and relocate mptable when using coreboot.
Diffstat (limited to 'src/coreboot.c')
-rw-r--r-- | src/coreboot.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/coreboot.c b/src/coreboot.c index 635c2f68..534a3c04 100644 --- a/src/coreboot.c +++ b/src/coreboot.c @@ -37,7 +37,27 @@ copy_pir(void *pos) bios_table_cur_addr += p->size; } -#define RSDP_SIGNATURE 0x2052545020445352LL // "RSD PTR " +static void +copy_mptable(void *pos) +{ + struct mptable_floating_s *p = pos; + if (p->signature != MPTABLE_SIGNAURE) + return; + if (!p->physaddr) + return; + if (checksum(pos, sizeof(*p)) != 0) + 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) { + dprintf(1, "No room to copy MPTABLE!\n"); + return; + } + dprintf(1, "Copying MPTABLE from %p to %x\n", pos, bios_table_cur_addr); + memcpy((void*)bios_table_cur_addr, pos, length); + SET_EBDA(pir_loc, bios_table_cur_addr); + bios_table_cur_addr += length; +} static void copy_acpi_rsdp(void *pos) @@ -72,6 +92,7 @@ scan_tables(u32 start, u32 size) void *end = (void*)start + size; for (; p<end; p += 16) { copy_pir(p); + copy_mptable(p); copy_acpi_rsdp(p); } } |