aboutsummaryrefslogtreecommitdiff
path: root/lib/efi_loader/efi_console.c
diff options
context:
space:
mode:
authorIlias Apalodimas <ilias.apalodimas@linaro.org>2022-10-06 16:08:46 +0300
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2022-10-06 22:54:58 +0200
commit05c4c9e21ae6f45ba1091917fc55f3ebc3916909 (patch)
tree8087cfd25c3ea958447dde7f96a0d8ac96460140 /lib/efi_loader/efi_console.c
parent1af680d5bc2e659a9bd532cf5c0009dd6d5bbdc3 (diff)
efi_loader: define internal implementations of install/uninstallmultiple
A following patch is cleaning up the core EFI code trying to remove sequences of efi_create_handle, efi_add_protocol. Although this works fine there's a problem with the latter since it is usually combined with efi_delete_handle() which blindly removes all protocols on a handle and deletes the handle. We should try to adhere to the EFI spec which only deletes a handle if the last instance of a protocol has been removed. Another problem is that efi_delete_handle() never checks for opened protocols, but the EFI spec defines that the caller is responsible for ensuring that there are no references to a protocol interface that is going to be removed. So let's fix this by replacing all callsites of efi_create_handle(), efi_add_protocol() , efi_delete_handle() with Install/UninstallMultipleProtocol. In order to do that redefine functions that can be used by the U-Boot proper internally and add '_ext' variants that will be used from the EFI API Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'lib/efi_loader/efi_console.c')
-rw-r--r--lib/efi_loader/efi_console.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c
index cf9fbd9cb5..3354b217a9 100644
--- a/lib/efi_loader/efi_console.c
+++ b/lib/efi_loader/efi_console.c
@@ -1278,12 +1278,14 @@ efi_status_t efi_console_register(void)
struct efi_device_path *dp;
/* Install protocols on root node */
- r = EFI_CALL(efi_install_multiple_protocol_interfaces
- (&efi_root,
- &efi_guid_text_output_protocol, &efi_con_out,
- &efi_guid_text_input_protocol, &efi_con_in,
- &efi_guid_text_input_ex_protocol, &efi_con_in_ex,
- NULL));
+ r = efi_install_multiple_protocol_interfaces(&efi_root,
+ &efi_guid_text_output_protocol,
+ &efi_con_out,
+ &efi_guid_text_input_protocol,
+ &efi_con_in,
+ &efi_guid_text_input_ex_protocol,
+ &efi_con_in_ex,
+ NULL);
/* Create console node and install device path protocols */
if (CONFIG_IS_ENABLED(DM_SERIAL)) {