]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
MdePkg: Call CoreInitializeMemoryAttributesTable() in DXE Entrypoint.
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / DxeMain / DxeMain.c
index 015b7663300a2bc1162a6cf455220fe264984c5c..0a34711b22a4ab411aa4d08fa5e3f5c04ff87fc0 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   DXE Core Main Entry Point\r
 \r
-Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -123,6 +123,7 @@ EFI_DXE_SERVICES mDxeServices = {
   (EFI_SCHEDULE)                     CoreSchedule,                        // Schedule\r
   (EFI_TRUST)                        CoreTrust,                           // Trust\r
   (EFI_PROCESS_FIRMWARE_VOLUME)      CoreProcessFirmwareVolume,           // ProcessFirmwareVolume\r
+  (EFI_SET_MEMORY_SPACE_CAPABILITIES)CoreSetMemorySpaceCapabilities,      // SetMemorySpaceCapabilities\r
 };\r
 \r
 EFI_SYSTEM_TABLE mEfiSystemTableTemplate = {\r
@@ -268,6 +269,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
@@ -286,18 +289,12 @@ DxeMain (
   Status = CoreInitializeImageServices (HobStart);\r
   ASSERT_EFI_ERROR (Status);\r
 \r
-  //\r
-  // Call constructor for all libraries\r
-  //\r
-  ProcessLibraryConstructorList (gDxeCoreImageHandle, gDxeCoreST);\r
-  PERF_END   (NULL,"PEI", NULL, 0) ;\r
-  PERF_START (NULL,"DXE", NULL, 0) ;\r
-\r
   //\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
@@ -306,6 +303,13 @@ DxeMain (
   Status = CoreInitializeGcdServices (&HobStart, MemoryBaseAddress, MemoryLength);\r
   ASSERT_EFI_ERROR (Status);\r
 \r
+  //\r
+  // Call constructor for all libraries\r
+  //\r
+  ProcessLibraryConstructorList (gDxeCoreImageHandle, gDxeCoreST);\r
+  PERF_END   (NULL,"PEI", NULL, 0) ;\r
+  PERF_START (NULL,"DXE", NULL, 0) ;\r
+\r
   //\r
   // Install the DXE Services Table into the EFI System Tables's Configuration Table\r
   //\r
@@ -370,7 +374,7 @@ DxeMain (
       if (GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_FV2) {\r
         DEBUG ((DEBUG_INFO | DEBUG_LOAD, "FV2 Hob           0x%0lx - 0x%0lx\n", Hob.FirmwareVolume2->BaseAddress, Hob.FirmwareVolume2->BaseAddress + Hob.FirmwareVolume2->Length - 1));\r
       } else if (GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_FV) {\r
-        DEBUG ((DEBUG_INFO | DEBUG_LOAD, "FV Hob            0x%0lx - 0x%0lx\n", Hob.FirmwareVolume->BaseAddress, Hob.FirmwareVolume->BaseAddress + Hob.FirmwareVolume2->Length - 1));\r
+        DEBUG ((DEBUG_INFO | DEBUG_LOAD, "FV Hob            0x%0lx - 0x%0lx\n", Hob.FirmwareVolume->BaseAddress, Hob.FirmwareVolume->BaseAddress + Hob.FirmwareVolume->Length - 1));\r
       }\r
     }\r
   DEBUG_CODE_END ();\r
@@ -381,6 +385,11 @@ DxeMain (
   Status = CoreInitializeEventServices ();\r
   ASSERT_EFI_ERROR (Status);\r
 \r
+  MemoryProfileInstallProtocol ();\r
+\r
+  CoreInitializePropertiesTable ();\r
+  CoreInitializeMemoryAttributesTable ();\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