void
copy_smbios(void *pos)
{
+ if (SMBiosAddr)
+ return;
struct smbios_entry_point *p = pos;
if (memcmp(p->anchor_string, "_SM_", 4))
return;
}
dprintf(1, "Copying SMBIOS entry point from %p to %p\n", pos, newpos);
memcpy(newpos, pos, p->length);
+ SMBiosAddr = newpos;
}
copy_pir(p);
copy_mptable(p);
copy_acpi_rsdp(p);
+ copy_smbios(p);
}
}
scan_tables(m->start, m->size);
}
- // XXX - just create dummy smbios table for now - should detect if
- // smbios/dmi table is found from coreboot and use that instead.
- smbios_init();
+ // XXX - create a dummy smbios table for now.
+ if (!SMBiosAddr)
+ smbios_init();
}
#include "paravirt.h" // qemu_cfg_smbios_load_field
#include "smbios.h" // struct smbios_entry_point
+struct smbios_entry_point *SMBiosAddr;
+
static void
smbios_entry_point_init(u16 max_structure_size,
u16 structure_table_length,
ep->intermediate_checksum -= checksum((void*)ep + 0x10, ep->length - 0x10);
+ SMBiosAddr = ep;
dprintf(1, "SMBIOS ptr=%p table=%p size=%d\n"
, ep, finaltable, structure_table_length);
}
u8 smbios_bcd_revision;
} PACKED;
+extern struct smbios_entry_point *SMBiosAddr;
+
/* This goes at the beginning of every SMBIOS structure. */
struct smbios_structure_header {
u8 type;