diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2014-04-07 16:35:18 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2014-04-07 16:37:52 -0400 |
commit | 3bd2dc6d5c2a3cec5a28e660b0ece699a0e94c0b (patch) | |
tree | 0fe0caf86869d1d8526a7692a8a9aeddf7be6b0c /src/fw/mptable.c | |
parent | 19646a4b51d41e44df17db6807cb7206c70629e3 (diff) | |
download | seabios-3bd2dc6d5c2a3cec5a28e660b0ece699a0e94c0b.zip seabios-3bd2dc6d5c2a3cec5a28e660b0ece699a0e94c0b.tar.gz seabios-3bd2dc6d5c2a3cec5a28e660b0ece699a0e94c0b.tar.bz2 |
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 <kevin@koconnor.net>
Diffstat (limited to 'src/fw/mptable.c')
-rw-r--r-- | src/fw/mptable.c | 33 |
1 files changed, 9 insertions, 24 deletions
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); } |