efiboot: don't call WaitForSingleEvent after ExitBootServices is called.

This commit is contained in:
nonaka 2017-02-11 10:15:55 +00:00
parent 990bc068a4
commit 167dd5f117
3 changed files with 8 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: efiboot.c,v 1.2 2017/02/11 10:13:46 nonaka Exp $ */
/* $NetBSD: efiboot.c,v 1.3 2017/02/11 10:15:55 nonaka Exp $ */
/*-
* Copyright (c) 2016 Kimihiro Nonaka <nonaka@netbsd.org>
@ -35,6 +35,7 @@ EFI_HANDLE IH;
EFI_DEVICE_PATH *efi_bootdp;
EFI_LOADED_IMAGE *efi_li;
uintptr_t efi_main_sp;
bool efi_cleanuped;
static EFI_PHYSICAL_ADDRESS heap_start = EFI_ALLOCATE_MAX_ADDRESS;
static UINTN heap_size = 1 * 1024 * 1024; /* 1MB */
@ -121,6 +122,7 @@ efi_cleanup(void)
if (EFI_ERROR(status))
Panic(L"ExitBootServices failed");
}
efi_cleanuped = true;
allocsz = sizeof(struct btinfo_efimemmap) - 1
+ NoEntries * DescriptorSize;

View File

@ -1,4 +1,4 @@
/* $NetBSD: efiboot.h,v 1.2 2017/02/11 10:13:46 nonaka Exp $ */
/* $NetBSD: efiboot.h,v 1.3 2017/02/11 10:15:55 nonaka Exp $ */
/*-
* Copyright (c) 2016 Kimihiro Nonaka <nonaka@netbsd.org>
@ -48,6 +48,7 @@ extern EFI_HANDLE IH;
extern EFI_DEVICE_PATH *efi_bootdp;
extern EFI_LOADED_IMAGE *efi_li;
extern uintptr_t efi_main_sp;
extern bool efi_cleanuped;
void efi_cleanup(void);
/* eficons.c */

View File

@ -1,4 +1,4 @@
/* $NetBSD: panic.c,v 1.3 2017/02/05 10:13:43 joerg Exp $ */
/* $NetBSD: panic.c,v 1.4 2017/02/11 10:15:55 nonaka Exp $ */
/*-
* Copyright (c) 2016 Kimihiro Nonaka <nonaka@netbsd.org>
@ -54,7 +54,8 @@ __dead void
reboot(void)
{
WaitForSingleEvent(ST->ConIn->WaitForKey, 0);
if (!efi_cleanuped)
WaitForSingleEvent(ST->ConIn->WaitForKey, 0);
uefi_call_wrapper(RT->ResetSystem, 4, EfiResetCold, EFI_SUCCESS,
0, NULL);