/* Install the SMBIOS table as a configuration table. */
efi_status_t efi_smbios_register(void)
/* Install the SMBIOS table as a configuration table. */
efi_status_t efi_smbios_register(void)
{
	u64 dmi_addr = U32_MAX;
	efi_status_t ret;
	void *dmi;
	ret = efi_allocate_pages(EFI_ALLOCATE_MAX_ADDRESS,
				 EFI_RUNTIME_SERVICES_DATA, 1, &dmi_addr);
	if (ret != EFI_SUCCESS) {
		ret = efi_allocate_pages(EFI_ALLOCATE_ANY_PAGES,
					 EFI_RUNTIME_SERVICES_DATA, 1,
					 &dmi_addr);
		if (ret != EFI_SUCCESS)
			return ret;
	}
	assert(!(dmi_addr & 0xf));
	dmi = (void *)(uintptr_t)dmi_addr;
	write_smbios_table(map_to_sysmem(dmi));
	return efi_install_configuration_table(&smbios_guid, dmi);
}