]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
MdeModulePkg DxeCore/PiSmmCore: Add UEFI memory and SMRAM profile support.
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / DxeMain / DxeMain.c
index 015b7663300a2bc1162a6cf455220fe264984c5c..1ac5cc17212d590479723f9216e85e3f69852fe3 100644 (file)
@@ -268,6 +268,8 @@ DxeMain (
   //\r
   CoreInitializeMemoryServices (&HobStart, &MemoryBaseAddress, &MemoryLength);\r
 \r
+  MemoryProfileInit (HobStart);\r
+\r
   //\r
   // Allocate the EFI System Table and EFI Runtime Service Table from EfiRuntimeServicesData\r
   // Use the templates to initialize the contents of the EFI System Table and EFI Runtime Services Table\r
@@ -296,8 +298,9 @@ DxeMain (
   //\r
   // Report DXE Core image information to the PE/COFF Extra Action Library\r
   //\r
+  ZeroMem (&ImageContext, sizeof (ImageContext));\r
   ImageContext.ImageAddress = (EFI_PHYSICAL_ADDRESS)(UINTN)gDxeCoreLoadedImage->ImageBase;\r
-  ImageContext.PdbPointer = PeCoffLoaderGetPdbPointer ((VOID*) (UINTN) ImageContext.ImageAddress);\r
+  ImageContext.PdbPointer   = PeCoffLoaderGetPdbPointer ((VOID*) (UINTN) ImageContext.ImageAddress);\r
   PeCoffLoaderRelocateImageExtraAction (&ImageContext);\r
 \r
   //\r
@@ -381,6 +384,8 @@ DxeMain (
   Status = CoreInitializeEventServices ();\r
   ASSERT_EFI_ERROR (Status);\r
 \r
+  MemoryProfileInstallProtocol ();\r
+\r
   //\r
   // Get persisted vector hand-off info from GUIDeed HOB again due to HobStart may be updated,\r
   // and install configuration table\r