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
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
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
+ InvalidateInstructionCacheRange ((VOID *)(UINTN)RuntimeImage->ImageBase, (UINTN)RuntimeImage->ImageSize);\r
}\r
}\r
//\r