Changeset View
Changeset View
Standalone View
Standalone View
stand/efi/loader/efi_main.c
Show First 20 Lines • Show All 88 Lines • ▼ Show 20 Lines | status = BS->LocateProtocol(&console_control_protocol, NULL, | ||||
(VOID **)&console_control); | (VOID **)&console_control); | ||||
if (status == EFI_SUCCESS) | if (status == EFI_SUCCESS) | ||||
(void)console_control->SetMode(console_control, | (void)console_control->SetMode(console_control, | ||||
EfiConsoleControlScreenText); | EfiConsoleControlScreenText); | ||||
heapsize = 64 * 1024 * 1024; | heapsize = 64 * 1024 * 1024; | ||||
status = BS->AllocatePages(AllocateAnyPages, EfiLoaderData, | status = BS->AllocatePages(AllocateAnyPages, EfiLoaderData, | ||||
EFI_SIZE_TO_PAGES(heapsize), &heap); | EFI_SIZE_TO_PAGES(heapsize), &heap); | ||||
if (status != EFI_SUCCESS) | if (status != EFI_SUCCESS) { | ||||
ST->ConOut->OutputString(ST->ConOut, L"Failed to allocate memory for heap.\r\n"); | |||||
eadler: perhaps include the size in the error message. I've found that kind of thing useful before. | |||||
impUnsubmitted Done Inline ActionsI'd include the size here. I don't know if printf is up and running until before or after the setheap call, which is the only wrinkle I can see. imp: I'd include the size here. I don't know if printf is up and running until before or after the… | |||||
BS->Exit(IH, status, 0, NULL); | BS->Exit(IH, status, 0, NULL); | ||||
} | |||||
setheap((void *)(uintptr_t)heap, (void *)(uintptr_t)(heap + heapsize)); | setheap((void *)(uintptr_t)heap, (void *)(uintptr_t)(heap + heapsize)); | ||||
/* Use efi_exit() from here on... */ | /* Use efi_exit() from here on... */ | ||||
status = BS->HandleProtocol(IH, &image_protocol, (VOID**)&img); | status = BS->HandleProtocol(IH, &image_protocol, (VOID**)&img); | ||||
if (status != EFI_SUCCESS) | if (status != EFI_SUCCESS) | ||||
efi_exit(status); | efi_exit(status); | ||||
▲ Show 20 Lines • Show All 82 Lines • Show Last 20 Lines |
perhaps include the size in the error message. I've found that kind of thing useful before.