[edk2-devel] [PATCH 2/5] ArmPlatformPkg/PL031RealTimeClockLib: hide LibRtcVirtualNotifyEvent

Laszlo Ersek posted 5 patches 2 years, 4 months ago
[edk2-devel] [PATCH 2/5] ArmPlatformPkg/PL031RealTimeClockLib: hide LibRtcVirtualNotifyEvent
Posted by Laszlo Ersek 2 years, 4 months ago
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.

Build- and boot-tested with ArmVirtQemu.

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4564
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
 ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c b/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c
index ec7feaeedcf8..9e852696d2fd 100644
--- a/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c
+++ b/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c
@@ -274,9 +274,10 @@ LibSetWakeupTime (
   @param[in]    Event   The Event that is being processed
   @param[in]    Context Event Context
 **/
+STATIC
 VOID
 EFIAPI
-LibRtcVirtualNotifyEvent (
+VirtualNotifyEvent (
   IN EFI_EVENT  Event,
   IN VOID       *Context
   )
@@ -346,7 +347,7 @@ LibRtcInitialize (
   Status = gBS->CreateEventEx (
                   EVT_NOTIFY_SIGNAL,
                   TPL_NOTIFY,
-                  LibRtcVirtualNotifyEvent,
+                  VirtualNotifyEvent,
                   NULL,
                   &gEfiEventVirtualAddressChangeGuid,
                   &mRtcVirtualAddrChangeEvent



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109564): https://edk2.groups.io/g/devel/message/109564
Mute This Topic: https://groups.io/mt/101914679/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/3901457/1787277/102458076/xyzzy [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH 2/5] ArmPlatformPkg/PL031RealTimeClockLib: hide LibRtcVirtualNotifyEvent
Posted by Sami Mujawar 2 years, 4 months ago
Hi Laszlo,

Thank you for this patch. 
These changes look good to me.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>

Regards,

Sami Mujawar

On 12/10/2023, 10:27, "devel@edk2.groups.io <mailto:devel@edk2.groups.io> on behalf of Laszlo Ersek via groups.io" <devel@edk2.groups.io <mailto:devel@edk2.groups.io> on behalf of lersek=redhat.com@groups.io <mailto:redhat.com@groups.io>> wrote:


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.


Build- and boot-tested with ArmVirtQemu.


Cc: Ard Biesheuvel <ardb+tianocore@kernel.org <mailto:ardb+tianocore@kernel.org>>
Cc: Leif Lindholm <quic_llindhol@quicinc.com <mailto:quic_llindhol@quicinc.com>>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4564 <https://bugzilla.tianocore.org/show_bug.cgi?id=4564>
Signed-off-by: Laszlo Ersek <lersek@redhat.com <mailto:lersek@redhat.com>>
---
ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)


diff --git a/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c b/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c
index ec7feaeedcf8..9e852696d2fd 100644
--- a/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c
+++ b/ArmPlatformPkg/Library/PL031RealTimeClockLib/PL031RealTimeClockLib.c
@@ -274,9 +274,10 @@ LibSetWakeupTime (
@param[in] Event The Event that is being processed
@param[in] Context Event Context
**/
+STATIC
VOID
EFIAPI
-LibRtcVirtualNotifyEvent (
+VirtualNotifyEvent (
IN EFI_EVENT Event,
IN VOID *Context
)
@@ -346,7 +347,7 @@ LibRtcInitialize (
Status = gBS->CreateEventEx (
EVT_NOTIFY_SIGNAL,
TPL_NOTIFY,
- LibRtcVirtualNotifyEvent,
+ VirtualNotifyEvent,
NULL,
&gEfiEventVirtualAddressChangeGuid,
&mRtcVirtualAddrChangeEvent
















-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109572): https://edk2.groups.io/g/devel/message/109572
Mute This Topic: https://groups.io/mt/101914679/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-