aboutsummaryrefslogtreecommitdiff
path: root/include
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 /include
parent1af680d5bc2e659a9bd532cf5c0009dd6d5bbdc3 (diff)
downloadu-boot-05c4c9e21ae6f45ba1091917fc55f3ebc3916909.zip
u-boot-05c4c9e21ae6f45ba1091917fc55f3ebc3916909.tar.gz
u-boot-05c4c9e21ae6f45ba1091917fc55f3ebc3916909.tar.bz2
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 'include')
-rw-r--r--include/efi.h2
-rw-r--r--include/efi_loader.h6
2 files changed, 6 insertions, 2 deletions
diff --git a/include/efi.h b/include/efi.h
index 6159f34..42f4e58 100644
--- a/include/efi.h
+++ b/include/efi.h
@@ -37,12 +37,14 @@
#define EFIAPI __attribute__((ms_abi))
#define efi_va_list __builtin_ms_va_list
#define efi_va_start __builtin_ms_va_start
+#define efi_va_copy __builtin_ms_va_copy
#define efi_va_arg __builtin_va_arg
#define efi_va_end __builtin_ms_va_end
#else
#define EFIAPI asmlinkage
#define efi_va_list va_list
#define efi_va_start va_start
+#define efi_va_copy va_copy
#define efi_va_arg va_arg
#define efi_va_end va_end
#endif /* __x86_64__ */
diff --git a/include/efi_loader.h b/include/efi_loader.h
index 15e7680..69d6d00 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -654,8 +654,10 @@ efi_status_t efi_remove_protocol(const efi_handle_t handle,
/* Delete all protocols from a handle */
efi_status_t efi_remove_all_protocols(const efi_handle_t handle);
/* Install multiple protocol interfaces */
-efi_status_t EFIAPI efi_install_multiple_protocol_interfaces
- (efi_handle_t *handle, ...);
+efi_status_t EFIAPI
+efi_install_multiple_protocol_interfaces(efi_handle_t *handle, ...);
+efi_status_t EFIAPI
+efi_uninstall_multiple_protocol_interfaces(efi_handle_t handle, ...);
/* Get handles that support a given protocol */
efi_status_t EFIAPI efi_locate_handle_buffer(
enum efi_locate_search_type search_type,