X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=src%2Fbiostables.c;fp=src%2Fbiostables.c;h=761b2608f4d20f28f743738dfe84ce31aa553519;hb=74c78786719b202557d4f177bd290ddd98e979fe;hp=21b85734bb3c5a1d9b85c3da3481802e5da9545f;hpb=1442c31529b951d4a2b90bdcf1adbd32d1ceffa8;p=seabios.git diff --git a/src/biostables.c b/src/biostables.c index 21b8573..761b260 100644 --- a/src/biostables.c +++ b/src/biostables.c @@ -9,6 +9,7 @@ #include "pci.h" // struct pir_header #include "acpi.h" // struct rsdp_descriptor #include "mptable.h" // MPTABLE_SIGNATURE +#include "smbios.h" // struct smbios_entry_point void copy_pir(void *pos) @@ -81,3 +82,24 @@ copy_acpi_rsdp(void *pos) memcpy(newpos, pos, length); RsdpAddr = newpos; } + +void +copy_smbios(void *pos) +{ + struct smbios_entry_point *p = pos; + if (memcmp(p->anchor_string, "_SM_", 4)) + return; + if (checksum(pos, 0x10) != 0) + return; + if (memcmp(p->intermediate_anchor_string, "_DMI_", 5)) + return; + if (checksum(pos+0x10, p->length-0x10) != 0) + return; + struct smbios_entry_point *newpos = malloc_fseg(sizeof(p->length)); + if (!newpos) { + warn_noalloc(); + return; + } + dprintf(1, "Copying SMBIOS entry point from %p to %p\n", pos, newpos); + memcpy(newpos, pos, p->length); +}