mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-24 22:36:05 +00:00
efi_loader: implement ReinstallProtocolInterface
The ReinstallProtocolInterface boot time service is implemented. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
1f470e1790
commit
e861a120e7
1 changed files with 43 additions and 23 deletions
|
@ -1021,29 +1021,6 @@ out:
|
||||||
return EFI_EXIT(r);
|
return EFI_EXIT(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Reinstall protocol interface.
|
|
||||||
*
|
|
||||||
* This function implements the ReinstallProtocolInterface service.
|
|
||||||
* See the Unified Extensible Firmware Interface (UEFI) specification
|
|
||||||
* for details.
|
|
||||||
*
|
|
||||||
* @handle handle on which the protocol shall be
|
|
||||||
* reinstalled
|
|
||||||
* @protocol GUID of the protocol to be installed
|
|
||||||
* @old_interface interface to be removed
|
|
||||||
* @new_interface interface to be installed
|
|
||||||
* @return status code
|
|
||||||
*/
|
|
||||||
static efi_status_t EFIAPI efi_reinstall_protocol_interface(
|
|
||||||
efi_handle_t handle, const efi_guid_t *protocol,
|
|
||||||
void *old_interface, void *new_interface)
|
|
||||||
{
|
|
||||||
EFI_ENTRY("%p, %pUl, %p, %p", handle, protocol, old_interface,
|
|
||||||
new_interface);
|
|
||||||
return EFI_EXIT(EFI_ACCESS_DENIED);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get all drivers associated to a controller.
|
* Get all drivers associated to a controller.
|
||||||
* The allocated buffer has to be freed with free().
|
* The allocated buffer has to be freed with free().
|
||||||
|
@ -2774,6 +2751,49 @@ out:
|
||||||
return EFI_EXIT(ret);
|
return EFI_EXIT(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Reinstall protocol interface.
|
||||||
|
*
|
||||||
|
* This function implements the ReinstallProtocolInterface service.
|
||||||
|
* See the Unified Extensible Firmware Interface (UEFI) specification
|
||||||
|
* for details.
|
||||||
|
*
|
||||||
|
* The old interface is uninstalled. The new interface is installed.
|
||||||
|
* Drivers are connected.
|
||||||
|
*
|
||||||
|
* @handle handle on which the protocol shall be
|
||||||
|
* reinstalled
|
||||||
|
* @protocol GUID of the protocol to be installed
|
||||||
|
* @old_interface interface to be removed
|
||||||
|
* @new_interface interface to be installed
|
||||||
|
* @return status code
|
||||||
|
*/
|
||||||
|
static efi_status_t EFIAPI efi_reinstall_protocol_interface(
|
||||||
|
efi_handle_t handle, const efi_guid_t *protocol,
|
||||||
|
void *old_interface, void *new_interface)
|
||||||
|
{
|
||||||
|
efi_status_t ret;
|
||||||
|
|
||||||
|
EFI_ENTRY("%p, %pUl, %p, %p", handle, protocol, old_interface,
|
||||||
|
new_interface);
|
||||||
|
ret = EFI_CALL(efi_uninstall_protocol_interface(handle, protocol,
|
||||||
|
old_interface));
|
||||||
|
if (ret != EFI_SUCCESS)
|
||||||
|
goto out;
|
||||||
|
ret = EFI_CALL(efi_install_protocol_interface(&handle, protocol,
|
||||||
|
EFI_NATIVE_INTERFACE,
|
||||||
|
new_interface));
|
||||||
|
if (ret != EFI_SUCCESS)
|
||||||
|
goto out;
|
||||||
|
/*
|
||||||
|
* The returned status code has to be ignored.
|
||||||
|
* Do not create an error if no suitable driver for the handle exists.
|
||||||
|
*/
|
||||||
|
EFI_CALL(efi_connect_controller(handle, NULL, NULL, true));
|
||||||
|
out:
|
||||||
|
return EFI_EXIT(ret);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get all child controllers associated to a driver.
|
* Get all child controllers associated to a driver.
|
||||||
* The allocated buffer has to be freed with free().
|
* The allocated buffer has to be freed with free().
|
||||||
|
|
Loading…
Add table
Reference in a new issue