summaryrefslogtreecommitdiff
path: root/sys/arch/amd64/stand/efiboot/efiboot.c
diff options
context:
space:
mode:
authorYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2015-09-23 03:19:56 +0000
committerYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2015-09-23 03:19:56 +0000
commit99c8123ca7fc33c14a0c8cc9a2ae60bfd9252407 (patch)
treee0947db86cceca4f68256d1443139762c0867d23 /sys/arch/amd64/stand/efiboot/efiboot.c
parent3673fec0f06faa393553e0c3f36ceb81c478abad (diff)
efiboot used 3MB memory below the region for the kernel, but UEFI
firmware on some machines allocates larger area whose upper part overlaps the kernel region. Let the efiboot use lower area for its heap. Also change its size from 3MB to 1MB and limit it by HEAP_LIMIT. The problem is reported by Toby Slight and Brian Conway.
Diffstat (limited to 'sys/arch/amd64/stand/efiboot/efiboot.c')
-rw-r--r--sys/arch/amd64/stand/efiboot/efiboot.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/arch/amd64/stand/efiboot/efiboot.c b/sys/arch/amd64/stand/efiboot/efiboot.c
index cdb7a284963..e9921605704 100644
--- a/sys/arch/amd64/stand/efiboot/efiboot.c
+++ b/sys/arch/amd64/stand/efiboot/efiboot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: efiboot.c,v 1.3 2015/09/03 09:22:40 kettenis Exp $ */
+/* $OpenBSD: efiboot.c,v 1.4 2015/09/23 03:19:55 yasuoka Exp $ */
/*
* Copyright (c) 2015 YASUOKA Masahiko <yasuoka@yasuoka.net>
@@ -42,7 +42,7 @@ EFI_RUNTIME_SERVICES *RS;
EFI_HANDLE IH, efi_bootdp = NULL;
EFI_PHYSICAL_ADDRESS heap;
EFI_LOADED_IMAGE *loadedImage;
-UINTN heapsiz = 3 * 1024 * 1024;
+UINTN heapsiz = 1 * 1024 * 1024;
UINTN mmap_key;
static EFI_GUID imgdp_guid = { 0xbc62157e, 0x3e33, 0x4fec,
{ 0x99, 0x20, 0x2d, 0x3b, 0x36, 0xd7, 0x50, 0xdf }};
@@ -199,7 +199,7 @@ efi_heap_init(void)
{
EFI_STATUS status;
- heap = 0x1000000; /* Below kernel base address */
+ heap = HEAP_LIMIT;
status = EFI_CALL(BS->AllocatePages, AllocateMaxAddress, EfiLoaderData,
EFI_SIZE_TO_PAGES(heapsiz), &heap);
if (status != EFI_SUCCESS)