]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/RuntimeDxe/Runtime.c
MdeModulePkg: document workaround for EFI_RUNTIME_EVENT_ENTRY PI spec bug
[mirror_edk2.git] / MdeModulePkg / Core / RuntimeDxe / Runtime.c
index c52b2b7ecf68e0840dde8ebd981afd4ef1378d25..f7220a205d1e48b77ebcc6f88d54ead9c53bf5b8 100644 (file)
@@ -285,8 +285,16 @@ RuntimeDriverSetVirtualAddressMap (
   for (Link = mRuntime.EventHead.ForwardLink; Link != &mRuntime.EventHead; Link = Link->ForwardLink) {\r
     RuntimeEvent = BASE_CR (Link, EFI_RUNTIME_EVENT_ENTRY, Link);\r
     if ((RuntimeEvent->Type & EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE) == EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE) {\r
+      //\r
+      // Work around the bug in the Platform Init specification (v1.7),\r
+      // reported as Mantis#2017: "EFI_RUNTIME_EVENT_ENTRY.Event" should have\r
+      // type EFI_EVENT, not (EFI_EVENT*). The PI spec documents the field\r
+      // correctly as "The EFI_EVENT returned by CreateEvent()", but the type\r
+      // of the field doesn't match the natural language description. Therefore\r
+      // we need an explicit cast here.\r
+      //\r
       RuntimeEvent->NotifyFunction (\r
-                      RuntimeEvent->Event,\r
+                      (EFI_EVENT) RuntimeEvent->Event,\r
                       RuntimeEvent->NotifyContext\r
                       );\r
     }\r