From a0ae8996bcb6e715840a811e863621b04989db5f Mon Sep 17 00:00:00 2001 From: lgao4 Date: Sat, 29 Sep 2007 03:16:49 +0000 Subject: 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 --- MdeModulePkg/ChangeLog.txt | 30 +++++++++++++++--------------- MdeModulePkg/Core/Dxe/Image/Image.c | 23 ++++++++++++++++++++++- 2 files changed, 37 insertions(+), 16 deletions(-) (limited to 'MdeModulePkg') 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 -- cgit v1.1