Changeset View
Changeset View
Standalone View
Standalone View
head/stand/efi/loader/bootinfo.c
Show First 20 Lines • Show All 357 Lines • ▼ Show 20 Lines | if (EFI_ERROR(status)) { | ||||
return (ENOMEM); | return (ENOMEM); | ||||
} | } | ||||
/* | /* | ||||
* Read the memory map and stash it after bootinfo. Align the | * Read the memory map and stash it after bootinfo. Align the | ||||
* memory map on a 16-byte boundary (the bootinfo block is page | * memory map on a 16-byte boundary (the bootinfo block is page | ||||
* aligned). | * aligned). | ||||
*/ | */ | ||||
efihdr = (struct efi_map_header *)addr; | efihdr = (struct efi_map_header *)(uintptr_t)addr; | ||||
mm = (void *)((uint8_t *)efihdr + efisz); | mm = (void *)((uint8_t *)efihdr + efisz); | ||||
sz = (EFI_PAGE_SIZE * pages) - efisz; | sz = (EFI_PAGE_SIZE * pages) - efisz; | ||||
status = BS->GetMemoryMap(&sz, mm, &efi_mapkey, &mmsz, &mmver); | status = BS->GetMemoryMap(&sz, mm, &efi_mapkey, &mmsz, &mmver); | ||||
if (EFI_ERROR(status)) { | if (EFI_ERROR(status)) { | ||||
printf("%s: GetMemoryMap error %lu\n", __func__, | printf("%s: GetMemoryMap error %lu\n", __func__, | ||||
EFI_ERROR_CODE(status)); | EFI_ERROR_CODE(status)); | ||||
return (EINVAL); | return (EINVAL); | ||||
▲ Show 20 Lines • Show All 160 Lines • Show Last 20 Lines |