From 3bd2dc6d5c2a3cec5a28e660b0ece699a0e94c0b Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Mon, 7 Apr 2014 16:35:18 -0400 Subject: Use biostables.c for copying bios tables even when generating them. Use the biostables.c copy_pir(), copy_smbios(), copy_acpi_rsdp(), and copy_mptable() code even when using the legacy bios table generation code. This unifies the final bios table deployment code between qemu, coreboot, and csm. Signed-off-by: Kevin O'Connor --- src/fw/mptable.c | 33 +++++++++------------------------ 1 file changed, 9 insertions(+), 24 deletions(-) (limited to 'src/fw/mptable.c') diff --git a/src/fw/mptable.c b/src/fw/mptable.c index b453469..59c2a3e 100644 --- a/src/fw/mptable.c +++ b/src/fw/mptable.c @@ -182,29 +182,14 @@ mptable_setup(void) config->length = length; config->checksum -= checksum(config, length); - // Allocate final memory locations. (In theory the config - // structure can go in high memory, but Linux kernels before - // v2.6.30 crash with that.) - struct mptable_config_s *finalconfig = malloc_fseg(length); - struct mptable_floating_s *floating = malloc_fseg(sizeof(*floating)); - if (!finalconfig || !floating) { - warn_noalloc(); - free(config); - free(finalconfig); - free(floating); - return; - } - memcpy(finalconfig, config, length); + // floating pointer structure + struct mptable_floating_s floating; + memset(&floating, 0, sizeof(floating)); + floating.signature = MPTABLE_SIGNATURE; + floating.physaddr = (u32)config; + floating.length = 1; + floating.spec_rev = 4; + floating.checksum -= checksum(&floating, sizeof(floating)); + copy_mptable(&floating); free(config); - - /* floating pointer structure */ - memset(floating, 0, sizeof(*floating)); - floating->signature = MPTABLE_SIGNATURE; - floating->physaddr = (u32)finalconfig; - floating->length = 1; - floating->spec_rev = 4; - floating->checksum -= checksum(floating, sizeof(*floating)); - - dprintf(1, "MP table addr=%p MPC table addr=%p size=%d\n", - floating, finalconfig, length); } -- cgit v1.1