The RealTimeClockLib class header in edk2 mistakenly declares a function
called LibRtcVirtualNotifyEvent(). No component ever calls this function
crossing module boundaries; all RealTimeClockLib instances in edk2 and
edk2-platforms are supposed to register (and do register) their
SetVirtualAddressMap() notification functions.

Rename LibRtcVirtualNotifyEvent() to VirtualNotifyEvent(), and make it
static, in preparation for removing the LibRtcVirtualNotifyEvent()
declaration from the lib class header later. Also hoist the function
definition above the reference.

Build-tested only (with "OverdriveBoard.dsc", "CelloBoard.dsc",
"Overdrive1000Board.dsc").

Cc: Ard Biesheuvel <ardb+tianoc...@kernel.org>
Cc: Leif Lindholm <quic_llind...@quicinc.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4564
Signed-off-by: Laszlo Ersek <ler...@redhat.com>
---
 Silicon/AMD/Styx/Library/RealTimeClockLib/RealTimeClockLib.c | 55 
+++++++++-----------
 1 file changed, 26 insertions(+), 29 deletions(-)

diff --git a/Silicon/AMD/Styx/Library/RealTimeClockLib/RealTimeClockLib.c 
b/Silicon/AMD/Styx/Library/RealTimeClockLib/RealTimeClockLib.c
index d15fcf031afa..052359f60b44 100644
--- a/Silicon/AMD/Styx/Library/RealTimeClockLib/RealTimeClockLib.c
+++ b/Silicon/AMD/Styx/Library/RealTimeClockLib/RealTimeClockLib.c
@@ -179,6 +179,31 @@ LibSetWakeupTime (
 }
 
 
+/**
+  Fixup internal data so that EFI can be call in virtual mode.
+  Call the passed in Child Notify event and convert any pointers in
+  lib to virtual mode.
+
+  @param[in]    Event   The Event that is being processed
+  @param[in]    Context Event Context
+**/
+STATIC
+VOID
+EFIAPI
+VirtualNotifyEvent (
+  IN EFI_EVENT        Event,
+  IN VOID             *Context
+  )
+{
+  //
+  // Only needed if you are going to support the OS calling RTC functions in 
virtual mode.
+  // You will need to call EfiConvertPointer (). To convert any stored 
physical addresses
+  // to virtual address. After the OS transistions to calling in virtual mode, 
all future
+  // runtime calls will be made in virtual mode.
+  //
+  EfiConvertPointer (0x0, (VOID**)&mRtcIscpDxeProtocol);
+}
+
 
 /**
   This is the declaration of an EFI image entry point. This can be the entry 
point to an application
@@ -218,7 +243,7 @@ LibRtcInitialize (
   Status = gBS->CreateEventEx (
                   EVT_NOTIFY_SIGNAL,
                   TPL_NOTIFY,
-                  LibRtcVirtualNotifyEvent,
+                  VirtualNotifyEvent,
                   NULL,
                   &gEfiEventVirtualAddressChangeGuid,
                   &mRtcVirtualAddrChangeEvent
@@ -227,31 +252,3 @@ LibRtcInitialize (
 
   return Status;
 }
-
-
-/**
-  Fixup internal data so that EFI can be call in virtual mode.
-  Call the passed in Child Notify event and convert any pointers in
-  lib to virtual mode.
-
-  @param[in]    Event   The Event that is being processed
-  @param[in]    Context Event Context
-**/
-VOID
-EFIAPI
-LibRtcVirtualNotifyEvent (
-  IN EFI_EVENT        Event,
-  IN VOID             *Context
-  )
-{
-  //
-  // Only needed if you are going to support the OS calling RTC functions in 
virtual mode.
-  // You will need to call EfiConvertPointer (). To convert any stored 
physical addresses
-  // to virtual address. After the OS transistions to calling in virtual mode, 
all future
-  // runtime calls will be made in virtual mode.
-  //
-  EfiConvertPointer (0x0, (VOID**)&mRtcIscpDxeProtocol);
-}
-
-
-



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109552): https://edk2.groups.io/g/devel/message/109552
Mute This Topic: https://groups.io/mt/101914661/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to