summaryrefslogtreecommitdiffstats
path: root/src/interface/efi/efi_init.c
diff options
context:
space:
mode:
authorMichael Brown2025-03-24 15:24:47 +0100
committerMichael Brown2025-03-24 16:43:56 +0100
commit32a9408217810498deeeae3d2564ab15468c9c39 (patch)
treee39162f48abd5a12dd664af9ba057bb6131bb626 /src/interface/efi/efi_init.c
parent[efi] Eliminate uses of HandleProtocol() (diff)
downloadipxe-32a9408217810498deeeae3d2564ab15468c9c39.tar.gz
ipxe-32a9408217810498deeeae3d2564ab15468c9c39.tar.xz
ipxe-32a9408217810498deeeae3d2564ab15468c9c39.zip
[efi] Allow use of typed pointers for efi_open() et al
Provide wrapper macros to allow efi_open() and related functions to accept a pointer to any pointer type as the "interface" argument, in order to allow a substantial amount of type adjustment boilerplate to be removed. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/interface/efi/efi_init.c')
-rw-r--r--src/interface/efi/efi_init.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/interface/efi/efi_init.c b/src/interface/efi/efi_init.c
index 03506ec5c..1ba144ee7 100644
--- a/src/interface/efi/efi_init.c
+++ b/src/interface/efi/efi_init.c
@@ -173,8 +173,7 @@ EFI_STATUS efi_init ( EFI_HANDLE image_handle,
EFI_BOOT_SERVICES *bs;
struct efi_protocol *prot;
struct efi_config_table *tab;
- void *loaded_image;
- void *device_path;
+ EFI_DEVICE_PATH_PROTOCOL *device_path;
void *device_path_copy;
size_t device_path_len;
EFI_STATUS efirc;
@@ -248,13 +247,12 @@ EFI_STATUS efi_init ( EFI_HANDLE image_handle,
*/
if ( ( rc = efi_open_unsafe ( image_handle,
&efi_loaded_image_protocol_guid,
- &loaded_image ) ) != 0 ) {
+ &efi_loaded_image ) ) != 0 ) {
DBGC ( systab, "EFI could not get loaded image protocol: %s",
strerror ( rc ) );
efirc = EFIRC ( rc );
goto err_no_loaded_image;
}
- efi_loaded_image = loaded_image;
DBGC ( systab, "EFI image base address %p\n",
efi_loaded_image->ImageBase );