summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2007-09-29 03:16:49 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2007-09-29 03:16:49 +0000
commita0ae8996bcb6e715840a811e863621b04989db5f (patch)
tree26000d2960bf1f3ebd905c8190cc40ee72b9a126
parentc62a593c903d92cf3e1330fb84170e32bad5b646 (diff)
downloadedk2-a0ae8996bcb6e715840a811e863621b04989db5f.zip
edk2-a0ae8996bcb6e715840a811e863621b04989db5f.tar.gz
edk2-a0ae8996bcb6e715840a811e863621b04989db5f.tar.bz2
Update DxeCore to set efi memory type for the different image to be loaded.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3977 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--MdeModulePkg/ChangeLog.txt30
-rw-r--r--MdeModulePkg/Core/Dxe/Image/Image.c23
2 files changed, 37 insertions, 16 deletions
diff --git a/MdeModulePkg/ChangeLog.txt b/MdeModulePkg/ChangeLog.txt
index dbad47f..d9bc990 100644
--- a/MdeModulePkg/ChangeLog.txt
+++ b/MdeModulePkg/ChangeLog.txt
@@ -39,7 +39,21 @@ EDK_0000: Compatible: owner
##########################################################################################
==========================================================================================
-EDK_39331: Non-Compatible: klu2
+EDK_3967: Non-Compatible: lgao4
+
+ Class_Library: Remove PeCoffLoader library class and its instances.
+
+ Code Change :
+ 1) Remove MdeModulePkg/Include/Library/PeCoffLoaderLib.h
+ 2) Remove MdeModulePkg/Library/DxePeCoffLoaderFromHobLib and PeiDxePeCoffLoaderLib instance
+ 3) Modify PeiCore, DxeIpl and DxeCore to use PeCoffLib in place of PeCoffLoaderLib.
+
+ Possible Impacts:
+ 1) All modules don't use PeCoffloader library class any longer to load PeImage.
+ If necessary, they should use PeCoffLib of MdePkg to load PeImage.
+
+==========================================================================================
+EDK_3931: Non-Compatible: klu2
Class_PIEnable[5]: New library class for S3Resume and Recovery for DxeIpl PEIM.
@@ -147,17 +161,3 @@ EDK_3773: Non-Compatible: qwang12
3) The gEfiFirmwareVolumeProtocolGuid in [Depex] section of INF file should updated.
And the package dependency should also be changed if needed due to this protocol
GUID change.
-
-==========================================================================================
-EDK_3967: Non-Compatible: lgao4
-
- Class_Library: Remove PeCoffLoader library class and its instances.
-
- Code Change :
- 1) Remove MdeModulePkg/Include/Library/PeCoffLoaderLib.h
- 2) Remove MdeModulePkg/Library/DxePeCoffLoaderFromHobLib and PeiDxePeCoffLoaderLib instance
- 3) Modify PeiCore, DxeIpl and DxeCore to use PeCoffLib in place of PeCoffLoaderLib.
-
- Possible Impacts:
- 1) All modules don't use PeCoffloader library class any longer to load PeImage.
- If necessary, they should use PeCoffLib of MdePkg to load PeImage.
diff --git a/MdeModulePkg/Core/Dxe/Image/Image.c b/MdeModulePkg/Core/Dxe/Image/Image.c
index 9232cab..31b1445 100644
--- a/MdeModulePkg/Core/Dxe/Image/Image.c
+++ b/MdeModulePkg/Core/Dxe/Image/Image.c
@@ -225,7 +225,28 @@ Returns:
//
return EFI_UNSUPPORTED;
}
-
+
+ //
+ // Set EFI memory type based on ImageType
+ //
+ switch (Image->ImageContext.ImageType) {
+ case EFI_IMAGE_SUBSYSTEM_EFI_APPLICATION:
+ Image->ImageContext.ImageCodeMemoryType = EfiLoaderCode;
+ Image->ImageContext.ImageDataMemoryType = EfiLoaderData;
+ break;
+ case EFI_IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER:
+ Image->ImageContext.ImageCodeMemoryType = EfiBootServicesCode;
+ Image->ImageContext.ImageDataMemoryType = EfiBootServicesData;
+ break;
+ case EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER:
+ case EFI_IMAGE_SUBSYSTEM_SAL_RUNTIME_DRIVER:
+ Image->ImageContext.ImageCodeMemoryType = EfiRuntimeServicesCode;
+ Image->ImageContext.ImageDataMemoryType = EfiRuntimeServicesData;
+ break;
+ default:
+ Image->ImageContext.ImageError = IMAGE_ERROR_INVALID_SUBSYSTEM;
+ return EFI_UNSUPPORTED;
+ }
//
// Allocate memory of the correct memory type aligned on the required image boundry