Changeset View
Changeset View
Standalone View
Standalone View
stand/efi/loader/main.c
Show First 20 Lines • Show All 1,154 Lines • ▼ Show 20 Lines | #endif | ||||
if (find_currdev(uefi_boot_mgr, is_last, boot_info, bisz) != 0) | if (find_currdev(uefi_boot_mgr, is_last, boot_info, bisz) != 0) | ||||
if (uefi_boot_mgr && | if (uefi_boot_mgr && | ||||
!interactive_interrupt("Failed to find bootable partition")) | !interactive_interrupt("Failed to find bootable partition")) | ||||
return (EFI_NOT_FOUND); | return (EFI_NOT_FOUND); | ||||
autoload_font(false); /* Set up the font list for console. */ | autoload_font(false); /* Set up the font list for console. */ | ||||
efi_init_environment(); | efi_init_environment(); | ||||
#if !defined(__arm__) | #if !defined(__arm__) | ||||
for (k = 0; k < ST->NumberOfTableEntries; k++) { | void *smbios_ep, *smbios3_ep; | ||||
scottph: because smbios_detect() "locks in" on the first smbios entry point it's given, doing… | |||||
Not Done Inline ActionsDoing both memcmp here and do another one after doesn't seems the best things to do. manu: Doing both memcmp here and do another one after doesn't seems the best things to do. | |||||
Not Done Inline Actionswe wouldn't want to set hint.smbios.0.mem to the address of the smbios3 entry point, as it's a different format. scottph: we wouldn't want to set hint.smbios.0.mem to the address of the smbios3 entry point, as it's a… | |||||
guid = &ST->ConfigurationTable[k].VendorGuid; | |||||
if (!memcmp(guid, &smbios, sizeof(EFI_GUID))) { | smbios_ep = efi_get_table(&smbios); | ||||
smbios_ep3 = efi_get_table(&smbios3); | |||||
if (smbios3_ep != NULL) { | |||||
char buf[40]; | char buf[40]; | ||||
snprintf(buf, sizeof(buf), "%p", | snprintf(buf, sizeof(buf), "%p", smbios3_ep); | ||||
ST->ConfigurationTable[k].VendorTable); | setenv("hint.smbios3.0.mem", buf, 1); | ||||
setenv("hint.smbios.0.mem", buf, 1); | smbios_detect(smbios3_ep); | ||||
smbios_detect(ST->ConfigurationTable[k].VendorTable); | |||||
break; | |||||
} | } | ||||
if (smbios_ep != NULL) { | |||||
char buf[40]; | |||||
snprintf(buf, sizeof(buf), "%p", smbios_ep); | |||||
setenv("hint.smbios.0.mem", buf, 1); | |||||
smbios_detect(smbios_ep); | |||||
} | } | ||||
#endif | #endif | ||||
interact(); /* doesn't return */ | interact(); /* doesn't return */ | ||||
return (EFI_SUCCESS); /* keep compiler happy */ | return (EFI_SUCCESS); /* keep compiler happy */ | ||||
} | } | ||||
▲ Show 20 Lines • Show All 452 Lines • Show Last 20 Lines |
because smbios_detect() "locks in" on the first smbios entry point it's given, doing smbios_detect as either table type is found prefers the earlier table, and not smbios3 over smbios. Maybe this whole loop could be dropped for: