]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Universal/Runtime/RuntimeDxe/Runtime.c
Removed cross references from PciCf8Lib and PciExpressLib class to PciLib class.
[mirror_edk2.git] / EdkModulePkg / Universal / Runtime / RuntimeDxe / Runtime.c
index d2428ea1b61060fb3c11407401c498c75bf4cc22..f3899bc8e19e03a767ad6cc286c8c103e5dfc4f3 100644 (file)
@@ -352,6 +352,7 @@ RuntimeDriverSetVirtualAddressMap (
   IN EFI_MEMORY_DESCRIPTOR  *VirtualMap\r
   )\r
 {\r
+  EFI_STATUS                    Status;\r
   RUNTIME_NOTIFY_EVENT_DATA     *RuntimeEvent;\r
   RUNTIME_IMAGE_RELOCATION_DATA *RuntimeImage;\r
   LIST_ENTRY                    *Link;\r
@@ -359,6 +360,7 @@ RuntimeDriverSetVirtualAddressMap (
   UINTN                         Index1;\r
   EFI_DRIVER_OS_HANDOFF_HEADER  *DriverOsHandoffHeader;\r
   EFI_DRIVER_OS_HANDOFF         *DriverOsHandoff;\r
+  EFI_PHYSICAL_ADDRESS          VirtImageBase;\r
 #if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
   EFI_CAPSULE_TABLE             *CapsuleTable; \r
 #endif\r
@@ -454,7 +456,19 @@ RuntimeDriverSetVirtualAddressMap (
   for (Link = mRelocationList.ForwardLink; Link != &mRelocationList; Link = Link->ForwardLink) {\r
     RuntimeImage = _CR (Link, RUNTIME_IMAGE_RELOCATION_DATA, Link);\r
     if (RuntimeImage->Valid) {\r
-      RelocatePeImageForRuntime (RuntimeImage);\r
+\r
+      VirtImageBase = RuntimeImage->ImageBase;\r
+      Status  = RuntimeDriverConvertPointer (0, (VOID **) &VirtImageBase);\r
+      ASSERT_EFI_ERROR (Status);\r
+\r
+      PeCoffLoaderRelocateImageForRuntime (\r
+        RuntimeImage->ImageBase,\r
+        VirtImageBase,\r
+        RuntimeImage->ImageSize,\r
+        RuntimeImage->RelocationData\r
+        );\r
+      \r
+      FlushCpuCache (RuntimeImage->ImageBase, (UINT64)RuntimeImage->ImageSize);\r
     }\r
   }\r
   //\r