]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
Enable the Load Module At fixed Address feature
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / DxeMain / DxeMain.c
index 52f9437b9e47194eb44b3e286a004864deb82d1e..5d1d6df20293a63c31f05bed08905c2364717669 100644 (file)
@@ -210,6 +210,11 @@ EFI_DECOMPRESS_PROTOCOL  gEfiDecompress = {
 };\r
 \r
 //\r
+// For Loading modules at fixed address feature, the configuration table is to cache the top address below which to load \r
+// Runtime code&boot time code \r
+//\r
+GLOBAL_REMOVE_IF_UNREFERENCED EFI_LOAD_FIXED_ADDRESS_CONFIGURATION_TABLE    gLoadModuleAtFixAddressConfigurationTable;\r
+\r
 // Main entry point to the DXE Core\r
 //\r
 \r
@@ -284,7 +289,16 @@ DxeMain (
   //\r
   Status = CoreInstallConfigurationTable (&gEfiMemoryTypeInformationGuid, &gMemoryTypeInformation);\r
   ASSERT_EFI_ERROR (Status);\r
-\r
+  \r
+  //\r
+  // If Loading modules At fixed address feature is enabled, install Load moduels at fixed address \r
+  // Configuration Table so that user could easily to retrieve the top address to load Dxe and PEI\r
+  // Code and Tseg base to load SMM driver. \r
+  //\r
+  if (FixedPcdGet64(PcdLoadModuleAtFixAddressEnable) != 0) {\r
+    Status = CoreInstallConfigurationTable (&gLoadFixedAddressConfigurationTableGuid, &gLoadModuleAtFixAddressConfigurationTable);\r
+    ASSERT_EFI_ERROR (Status);\r
+  }\r
   //\r
   // Report Status Code here for DXE_ENTRY_POINT once it is available\r
   //\r