Changeset View
Changeset View
Standalone View
Standalone View
stand/efi/loader/main.c
Show First 20 Lines • Show All 924 Lines • ▼ Show 20 Lines | main(int argc, CHAR16 *argv[]) | ||||
archsw.arch_copyin = efi_copyin; | archsw.arch_copyin = efi_copyin; | ||||
archsw.arch_copyout = efi_copyout; | archsw.arch_copyout = efi_copyout; | ||||
#ifdef __amd64__ | #ifdef __amd64__ | ||||
archsw.arch_hypervisor = x86_hypervisor; | archsw.arch_hypervisor = x86_hypervisor; | ||||
#endif | #endif | ||||
archsw.arch_readin = efi_readin; | archsw.arch_readin = efi_readin; | ||||
archsw.arch_zfs_probe = efi_zfs_probe; | archsw.arch_zfs_probe = efi_zfs_probe; | ||||
#if !defined(__arm__) | |||||
for (k = 0; k < ST->NumberOfTableEntries; k++) { | |||||
guid = &ST->ConfigurationTable[k].VendorGuid; | |||||
if (!memcmp(guid, &smbios, sizeof(EFI_GUID)) || | |||||
!memcmp(guid, &smbios3, sizeof(EFI_GUID))) { | |||||
char buf[40]; | |||||
snprintf(buf, sizeof(buf), "%p", | |||||
ST->ConfigurationTable[k].VendorTable); | |||||
setenv("hint.smbios.0.mem", buf, 1); | |||||
smbios_detect(ST->ConfigurationTable[k].VendorTable); | |||||
break; | |||||
} | |||||
} | |||||
#endif | |||||
/* Get our loaded image protocol interface structure. */ | /* Get our loaded image protocol interface structure. */ | ||||
(void) OpenProtocolByHandle(IH, &imgid, (void **)&boot_img); | (void) OpenProtocolByHandle(IH, &imgid, (void **)&boot_img); | ||||
/* | /* | ||||
* Chicken-and-egg problem; we want to have console output early, but | * Chicken-and-egg problem; we want to have console output early, but | ||||
* some console attributes may depend on reading from eg. the boot | * some console attributes may depend on reading from eg. the boot | ||||
* device, which we can't do yet. We can use printf() etc. once this is | * device, which we can't do yet. We can use printf() etc. once this is | ||||
* done. So, we set it to the efi console, then call console init. This | * done. So, we set it to the efi console, then call console init. This | ||||
▲ Show 20 Lines • Show All 234 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__) | |||||
for (k = 0; k < ST->NumberOfTableEntries; k++) { | |||||
guid = &ST->ConfigurationTable[k].VendorGuid; | |||||
if (!memcmp(guid, &smbios, sizeof(EFI_GUID)) || | |||||
!memcmp(guid, &smbios3, sizeof(EFI_GUID))) { | |||||
char buf[40]; | |||||
snprintf(buf, sizeof(buf), "%p", | |||||
ST->ConfigurationTable[k].VendorTable); | |||||
setenv("hint.smbios.0.mem", buf, 1); | |||||
smbios_detect(ST->ConfigurationTable[k].VendorTable); | |||||
break; | |||||
} | |||||
} | |||||
#endif | |||||
interact(); /* doesn't return */ | interact(); /* doesn't return */ | ||||
return (EFI_SUCCESS); /* keep compiler happy */ | return (EFI_SUCCESS); /* keep compiler happy */ | ||||
} | } | ||||
COMMAND_SET(efi_seed_entropy, "efi-seed-entropy", "try to get entropy from the EFI RNG", command_seed_entropy); | COMMAND_SET(efi_seed_entropy, "efi-seed-entropy", "try to get entropy from the EFI RNG", command_seed_entropy); | ||||
▲ Show 20 Lines • Show All 506 Lines • Show Last 20 Lines |