diff options
| author | Warner Losh <imp@FreeBSD.org> | 2017-10-12 15:16:16 +0000 |
|---|---|---|
| committer | Warner Losh <imp@FreeBSD.org> | 2017-10-12 15:16:16 +0000 |
| commit | 1461c26d38fb9eb8583e4fd60cbea795330e3e99 (patch) | |
| tree | 192aa57a7a8a3d919ef8553535150e6700788527 | |
| parent | 9576e1ee54c081885977d53ef7b96674323dc8ff (diff) | |
Notes
| -rw-r--r-- | sys/boot/efi/include/efilib.h | 2 | ||||
| -rw-r--r-- | sys/boot/efi/loader/arch/i386/exec.c | 6 | ||||
| -rw-r--r-- | sys/boot/efi/loader/efi_main.c | 15 |
3 files changed, 12 insertions, 11 deletions
diff --git a/sys/boot/efi/include/efilib.h b/sys/boot/efi/include/efilib.h index 72752c575ac1..eaaae613dca0 100644 --- a/sys/boot/efi/include/efilib.h +++ b/sys/boot/efi/include/efilib.h @@ -95,7 +95,7 @@ void efi_time_fini(void); EFI_STATUS efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE* Xsystab); EFI_STATUS main(int argc, CHAR16 *argv[]); -void exit(EFI_STATUS status) __dead2; +void efi_exit(EFI_STATUS status) __dead2; void delay(int usecs); /* EFI environment initialization. */ diff --git a/sys/boot/efi/loader/arch/i386/exec.c b/sys/boot/efi/loader/arch/i386/exec.c index 12a367cda5c2..579f5593b24b 100644 --- a/sys/boot/efi/loader/arch/i386/exec.c +++ b/sys/boot/efi/loader/arch/i386/exec.c @@ -36,12 +36,6 @@ __FBSDID("$FreeBSD$"); uint32_t __base; struct __v86 __v86; -/* XXX - Needed a definition here to implicitly define exit(); do not remove. */ -static void -exit(int x) -{ -} - void __v86int() { diff --git a/sys/boot/efi/loader/efi_main.c b/sys/boot/efi/loader/efi_main.c index 045ee9bc2f7a..e424d89666ec 100644 --- a/sys/boot/efi/loader/efi_main.c +++ b/sys/boot/efi/loader/efi_main.c @@ -36,13 +36,20 @@ static EFI_PHYSICAL_ADDRESS heap; static UINTN heapsize; void -exit(EFI_STATUS exit_code) +efi_exit(EFI_STATUS exit_code) { BS->FreePages(heap, EFI_SIZE_TO_PAGES(heapsize)); BS->Exit(IH, exit_code, 0, NULL); } +void +exit(int status) +{ + + efi_exit(EFI_LOAD_ERROR); +} + static CHAR16 * arg_skipsep(CHAR16 *argp) { @@ -92,11 +99,11 @@ efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *system_table) setheap((void *)(uintptr_t)heap, (void *)(uintptr_t)(heap + heapsize)); - /* Use exit() from here on... */ + /* Use efi_exit() from here on... */ status = BS->HandleProtocol(IH, &image_protocol, (VOID**)&img); if (status != EFI_SUCCESS) - exit(status); + efi_exit(status); /* * Pre-process the (optional) load options. If the option string @@ -176,6 +183,6 @@ efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *system_table) argv[argc] = NULL; status = main(argc, argv); - exit(status); + efi_exit(status); return (status); } |
