svn commit: r342054 - head/stand/efi/loader

Rebecca Cran bcran at FreeBSD.org
Thu Dec 13 23:20:59 UTC 2018


Author: bcran
Date: Thu Dec 13 23:20:58 2018
New Revision: 342054
URL: https://svnweb.freebsd.org/changeset/base/342054

Log:
  Print an error message in efi_main.c if we can't allocate memory for the heap
  
  With the default Qemu parameters, only 128MB RAM gets given to a VM. This causes
  the loader to be unable to allocate the 64MB it needs for the heap. This change
  makes the cause of the error more obvious.
  
  Differential Revision:	https://reviews.freebsd.org/D17958

Modified:
  head/stand/efi/loader/efi_main.c

Modified: head/stand/efi/loader/efi_main.c
==============================================================================
--- head/stand/efi/loader/efi_main.c	Thu Dec 13 20:09:38 2018	(r342053)
+++ head/stand/efi/loader/efi_main.c	Thu Dec 13 23:20:58 2018	(r342054)
@@ -94,8 +94,10 @@ efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *sy
 	heapsize = 64 * 1024 * 1024;
 	status = BS->AllocatePages(AllocateAnyPages, EfiLoaderData,
 	    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");
 		BS->Exit(IH, status, 0, NULL);
+	}
 
 	setheap((void *)(uintptr_t)heap, (void *)(uintptr_t)(heap + heapsize));
 


More information about the svn-src-all mailing list