summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Core/Dxe
diff options
context:
space:
mode:
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2008-02-26 08:38:29 +0000
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2008-02-26 08:38:29 +0000
commitba39e316c957ed69301693606e17e6891985607a (patch)
treebc7f37a7b0d3847b88632b32db229cff37b7a523 /MdeModulePkg/Core/Dxe
parent77442a5a27a290287ee2d263323610c4485365b0 (diff)
downloadedk2-ba39e316c957ed69301693606e17e6891985607a.tar.gz
edk2-ba39e316c957ed69301693606e17e6891985607a.tar.bz2
edk2-ba39e316c957ed69301693606e17e6891985607a.zip
1. Add EFI LOADED IMAGE DEVICE PATH Protocol in LoadImage() service, per UEFI 2.1b.
2. Update comments for DHCP.transmitreceive(). 2. Update UefiPxeBcDxe.inf and PxeBcDxe.inf to assign correct protocol usages. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4758 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Core/Dxe')
-rw-r--r--MdeModulePkg/Core/Dxe/DxeMain.inf1
-rw-r--r--MdeModulePkg/Core/Dxe/Image.h2
-rw-r--r--MdeModulePkg/Core/Dxe/Image/Image.c34
3 files changed, 32 insertions, 5 deletions
diff --git a/MdeModulePkg/Core/Dxe/DxeMain.inf b/MdeModulePkg/Core/Dxe/DxeMain.inf
index 8f8a22f92c..595c3d2554 100644
--- a/MdeModulePkg/Core/Dxe/DxeMain.inf
+++ b/MdeModulePkg/Core/Dxe/DxeMain.inf
@@ -134,6 +134,7 @@
gEfiLoadedImageProtocolGuid # PROTOCOL ALWAYS_PRODUCED
gEfiEbcProtocolGuid # PROTOCOL SOMETIMES_CONSUMED
gEfiTcgPlatformProtocolGuid
+ gEfiLoadedImageDevicePathProtocolGuid # PROTOCOL ALWAYS_PRODUCED
[FixedPcd.common]
gEfiMdePkgTokenSpaceGuid.PcdStatusCodeValueDxeCoreEntry | 0x3041000 # EFI_SOFTWARE_DXE_CORE | EFI_SW_DXE_CORE_PC_ENTRY_POINT
diff --git a/MdeModulePkg/Core/Dxe/Image.h b/MdeModulePkg/Core/Dxe/Image.h
index 8ad1f9b72e..eeeb3ab717 100644
--- a/MdeModulePkg/Core/Dxe/Image.h
+++ b/MdeModulePkg/Core/Dxe/Image.h
@@ -55,7 +55,7 @@ typedef struct {
EFI_RUNTIME_IMAGE_ENTRY *RuntimeData; // Runtime image list
- EFI_DEVICE_PATH_PROTOCOL *DeviceHandleDevicePath;
+ EFI_DEVICE_PATH_PROTOCOL *LoadedImageDevicePath; // Pointer to Loaded Image Device Path Protocl
PE_COFF_LOADER_IMAGE_CONTEXT ImageContext; // PeCoffLoader ImageContext
diff --git a/MdeModulePkg/Core/Dxe/Image/Image.c b/MdeModulePkg/Core/Dxe/Image/Image.c
index 56c5fe5ea2..125134dea7 100644
--- a/MdeModulePkg/Core/Dxe/Image/Image.c
+++ b/MdeModulePkg/Core/Dxe/Image/Image.c
@@ -74,7 +74,7 @@ LOADED_IMAGE_PRIVATE_DATA mCorePrivateImage = {
0, // Machine
NULL, // Ebc
NULL, // RuntimeData
- NULL, // DeviceHandleDevicePath
+ NULL // LoadedImageDevicePath
};
@@ -714,7 +714,6 @@ Returns:
if (!EFI_ERROR (Status)) {
FilePathSize = CoreDevicePathSize (HandleFilePath) - sizeof(EFI_DEVICE_PATH_PROTOCOL);
FilePath = (EFI_DEVICE_PATH_PROTOCOL *) ( ((UINT8 *)FilePath) + FilePathSize );
- Image->DeviceHandleDevicePath = CoreDuplicateDevicePath (HandleFilePath);
}
//
@@ -782,6 +781,26 @@ Returns:
goto Done;
}
+ //
+ // If DevicePath parameter to the LoadImage() is not NULL, then make a copy of DevicePath,
+ // otherwise Loaded Image Device Path Protocol is installed with a NULL interface pointer.
+ //
+ if (OriginalFilePath != NULL) {
+ Image->LoadedImageDevicePath = CoreDuplicateDevicePath (OriginalFilePath);
+ }
+
+ //
+ // Install Loaded Image Device Path Protocol onto the image handle of a PE/COFE image
+ //
+ Status = CoreInstallProtocolInterface (
+ &Image->Handle,
+ &gEfiLoadedImageDevicePathProtocolGuid,
+ EFI_NATIVE_INTERFACE,
+ Image->LoadedImageDevicePath
+ );
+ if (EFI_ERROR (Status)) {
+ goto Done;
+ }
//
// Success. Return the image handle
@@ -1210,9 +1229,16 @@ Returns:
Status = CoreUninstallProtocolInterface (
Image->Handle,
+ &gEfiLoadedImageDevicePathProtocolGuid,
+ Image->LoadedImageDevicePath
+ );
+
+ Status = CoreUninstallProtocolInterface (
+ Image->Handle,
&gEfiLoadedImageProtocolGuid,
&Image->Info
);
+
}
if (Image->RuntimeData != NULL) {
@@ -1239,8 +1265,8 @@ Returns:
CoreFreePool (Image->Info.FilePath);
}
- if (Image->DeviceHandleDevicePath != NULL) {
- CoreFreePool (Image->DeviceHandleDevicePath);
+ if (Image->LoadedImageDevicePath != NULL) {
+ CoreFreePool (Image->LoadedImageDevicePath);
}
if (Image->FixupData != NULL) {