loader: abstract boot services exiting to libefi function
Move direct call of ExitBootServices to efi_exit_boot_services. This function sets boot_services_active to false so callers don't have to do it everywhere (though currently only loader/bootinfo.c is affected). Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D32226
This commit is contained in:
parent
a8935083b5
commit
77e3db0789
@ -69,9 +69,21 @@ pdinfo_t *efiblk_get_pdinfo(struct devdesc *dev);
|
|||||||
pdinfo_t *efiblk_get_pdinfo_by_handle(EFI_HANDLE h);
|
pdinfo_t *efiblk_get_pdinfo_by_handle(EFI_HANDLE h);
|
||||||
pdinfo_t *efiblk_get_pdinfo_by_device_path(EFI_DEVICE_PATH *path);
|
pdinfo_t *efiblk_get_pdinfo_by_device_path(EFI_DEVICE_PATH *path);
|
||||||
|
|
||||||
|
/* libefi.c */
|
||||||
void *efi_get_table(EFI_GUID *tbl);
|
void *efi_get_table(EFI_GUID *tbl);
|
||||||
EFI_STATUS OpenProtocolByHandle(EFI_HANDLE, EFI_GUID *, void **);
|
EFI_STATUS OpenProtocolByHandle(EFI_HANDLE, EFI_GUID *, void **);
|
||||||
|
|
||||||
|
static inline EFI_STATUS
|
||||||
|
efi_exit_boot_services(UINTN key)
|
||||||
|
{
|
||||||
|
EFI_STATUS status;
|
||||||
|
|
||||||
|
status = BS->ExitBootServices(IH, key);
|
||||||
|
if (!EFI_ERROR(status))
|
||||||
|
boot_services_active = false;
|
||||||
|
return (status);
|
||||||
|
}
|
||||||
|
|
||||||
int efi_getdev(void **vdev, const char *devspec, const char **path);
|
int efi_getdev(void **vdev, const char *devspec, const char **path);
|
||||||
char *efi_fmtdev(void *vdev);
|
char *efi_fmtdev(void *vdev);
|
||||||
int efi_setcurrdev(struct env_var *ev, int flags, const void *value);
|
int efi_setcurrdev(struct env_var *ev, int flags, const void *value);
|
||||||
|
@ -393,11 +393,9 @@ bi_load_efi_data(struct preloaded_file *kfp, bool exit_bs)
|
|||||||
|
|
||||||
if (!exit_bs)
|
if (!exit_bs)
|
||||||
break;
|
break;
|
||||||
status = BS->ExitBootServices(IH, efi_mapkey);
|
status = efi_exit_boot_services(efi_mapkey);
|
||||||
if (!EFI_ERROR(status)) {
|
if (!EFI_ERROR(status))
|
||||||
boot_services_active = false;
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (retry == 0) {
|
if (retry == 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user