void
copy_smbios(void *pos)
{
+ if (SMBiosAddr)
+ return;
struct smbios_entry_point *p = pos;
if (memcmp(p->anchor_string, "_SM_", 4))
return;
return;
if (checksum(pos+0x10, p->length-0x10) != 0)
return;
- struct smbios_entry_point *newpos = malloc_fseg(sizeof(p->length));
+ struct smbios_entry_point *newpos = malloc_fseg(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);
+ SMBiosAddr = newpos;
}