2
0
mirror of https://github.com/xcat2/xNBA.git synced 2024-11-22 09:31:51 +00:00

[efi] Do not try to fetch loaded image device path protocol

Some UEFI systems (observed with a Mac Pro) do not provide a loaded
image device path protocol.  We don't currently use the loaded image
device path protocol for anything beyond printing a debug message, so
simply remove the code which attempts to fetch it.

Reported-by: Matt Woodward <pxematt@woodwardcc.com>
Tested-by: Matt Woodward <pxematt@woodwardcc.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown 2014-05-19 23:08:42 +01:00
parent 81df95e8ae
commit 6cdd3bb656

View File

@ -34,9 +34,6 @@ EFI_HANDLE efi_image_handle;
/** Loaded image protocol for this image */
EFI_LOADED_IMAGE_PROTOCOL *efi_loaded_image;
/** Loaded image protocol device path for this image */
EFI_DEVICE_PATH_PROTOCOL *efi_loaded_image_path;
/** System table passed to entry point */
EFI_SYSTEM_TABLE *efi_systab;
@ -44,10 +41,6 @@ EFI_SYSTEM_TABLE *efi_systab;
static EFI_GUID efi_loaded_image_protocol_guid
= EFI_LOADED_IMAGE_PROTOCOL_GUID;
/** EFI loaded image device path protocol GUID */
static EFI_GUID efi_loaded_image_device_path_protocol_guid
= EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID;
/** Event used to signal shutdown */
static EFI_EVENT efi_shutdown_event;
@ -152,7 +145,6 @@ EFI_STATUS efi_init ( EFI_HANDLE image_handle,
struct efi_protocol *prot;
struct efi_config_table *tab;
void *loaded_image;
void *loaded_image_path;
EFI_STATUS efirc;
int rc;
@ -220,21 +212,6 @@ EFI_STATUS efi_init ( EFI_HANDLE image_handle,
DBGC ( systab, "EFI image base address %p\n",
efi_loaded_image->ImageBase );
/* Get loaded image device path protocol */
if ( ( efirc = bs->OpenProtocol ( image_handle,
&efi_loaded_image_device_path_protocol_guid,
&loaded_image_path, image_handle, NULL,
EFI_OPEN_PROTOCOL_GET_PROTOCOL ) ) != 0 ) {
rc = -EEFI ( efirc );
DBGC ( systab, "EFI could not get loaded image device path "
"protocol: %s", strerror ( rc ) );
return efirc;
}
efi_loaded_image_path = loaded_image_path;
DBGC ( systab, "EFI image device path " );
DBGC_EFI_DEVPATH ( systab, efi_loaded_image_path );
DBGC ( systab, "\n" );
/* EFI is perfectly capable of gracefully shutting down any
* loaded devices if it decides to fall back to a legacy boot.
* For no particularly comprehensible reason, it doesn't