/* smbios.c - get smbios tables. */
/*
* VAS_EBOOT -- GRand Unified Bootloader
* Copyright (C) 2019 Free Software Foundation, Inc.
*
* VAS_EBOOT is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* VAS_EBOOT is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with VAS_EBOOT. If not, see .
*/
#include
#include
#include
struct VasEBoot_smbios_eps *
VasEBoot_machine_smbios_get_eps (void)
{
VasEBoot_uint8_t *ptr;
VasEBoot_dprintf ("smbios", "Looking for SMBIOS EPS. Scanning BIOS\n");
for (ptr = (VasEBoot_uint8_t *) 0xf0000; ptr < (VasEBoot_uint8_t *) 0x100000; ptr += 16)
if (VasEBoot_memcmp (ptr, "_SM_", 4) == 0
&& VasEBoot_byte_checksum (ptr, sizeof (struct VasEBoot_smbios_eps)) == 0)
return (struct VasEBoot_smbios_eps *) ptr;
return 0;
}
struct VasEBoot_smbios_eps3 *
VasEBoot_machine_smbios_get_eps3 (void)
{
VasEBoot_uint8_t *ptr;
VasEBoot_dprintf ("smbios", "Looking for SMBIOS3 EPS. Scanning BIOS\n");
for (ptr = (VasEBoot_uint8_t *) 0xf0000; ptr < (VasEBoot_uint8_t *) 0x100000; ptr += 16)
if (VasEBoot_memcmp (ptr, "_SM3_", 5) == 0
&& VasEBoot_byte_checksum (ptr, sizeof (struct VasEBoot_smbios_eps3)) == 0)
return (struct VasEBoot_smbios_eps3 *) ptr;
return 0;
}