2 * EFI application tables support
4 * Copyright (c) 2016 Alexander Graf
6 * SPDX-License-Identifier: GPL-2.0+
10 #include <efi_loader.h>
14 static const efi_guid_t smbios_guid = SMBIOS_TABLE_GUID;
16 void efi_smbios_register(void)
18 /* Map within the low 32 bits, to allow for 32bit SMBIOS tables */
19 uint64_t dmi = 0xffffffff;
20 /* Reserve 4kb for SMBIOS */
22 int memtype = EFI_RUNTIME_SERVICES_DATA;
24 if (efi_allocate_pages(1, memtype, pages, &dmi) != EFI_SUCCESS)
27 /* Generate SMBIOS tables */
28 write_smbios_table(dmi);
30 /* And expose them to our EFI payload */
31 efi_install_configuration_table(&smbios_guid, (void*)(uintptr_t)dmi);