From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id E6809AC1392 for ; Thu, 12 Oct 2023 14:32:42 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=y47V9rR2U5d7DP3KdS5sgRA8vGMew3l7DCstWgG0rcM=; c=relaxed/simple; d=groups.io; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:To:Cc:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding; s=20140610; t=1697121161; v=1; b=q11PmcqiHxkxDzHSGglCGnatY5y3Q4KBHeVY8g8y0qJTWWmI9YHR1Z5IxnekFpXRE+YSF/qj r4iQz7GZJATcnxneK1s5OzAU/hE6tvhQ/NOLUfw+MFOoQsjG3Kl7lQjYTC054oiYythTY5bwf8a 8BXTxpThDG8n23lXEaKBr6bE= X-Received: by 127.0.0.2 with SMTP id DageYY7687511xyzkGbLbcZc; Thu, 12 Oct 2023 07:32:41 -0700 X-Received: from mail-ot1-f51.google.com (mail-ot1-f51.google.com [209.85.210.51]) by mx.groups.io with SMTP id smtpd.web10.13319.1697121160702661264 for ; Thu, 12 Oct 2023 07:32:40 -0700 X-Received: by mail-ot1-f51.google.com with SMTP id 46e09a7af769-6c62cb79b02so634911a34.2 for ; Thu, 12 Oct 2023 07:32:40 -0700 (PDT) X-Gm-Message-State: lNjGJYZi4hqfQMdZtIsFbrk0x7686176AA= X-Google-Smtp-Source: AGHT+IHIl/rj0up2SF5KJnXbMC2Dt5BvwZm0X+oIhi7SJmxeTTCzToUefEpLxR5T0eP765zflcz0A1iGujV88DOOSXc= X-Received: by 2002:a05:6808:df3:b0:3a4:2204:e9e6 with SMTP id g51-20020a0568080df300b003a42204e9e6mr25428525oic.21.1697121159885; Thu, 12 Oct 2023 07:32:39 -0700 (PDT) MIME-Version: 1.0 References: <687bbaf5-3c2b-6d27-44a5-d19541ce97bd@redhat.com> <20231012090950.108577-1-lersek@redhat.com> <20231012090950.108577-17-lersek@redhat.com> In-Reply-To: <20231012090950.108577-17-lersek@redhat.com> From: "Marcin Wojtas via groups.io" Date: Thu, 12 Oct 2023 16:32:28 +0200 Message-ID: Subject: Re: [edk2-devel] [edk2-platforms PATCH 16/19] Armada7k8k/RealTimeClockLib: hide LibRtcVirtualNotifyEvent To: Laszlo Ersek Cc: edk2-devel-groups-io , Leif Lindholm Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,mw@semihalf.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=q11Pmcqi; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Hi, czw., 12 pa=C5=BA 2023 o 11:10 Laszlo Ersek napisa=C5= =82(a): > > 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 the following platforms: > > - Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc > - Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc > - Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc > - Platform/SolidRun/Cn913xCEx7Eval/Cn913xCEx7Eval.dsc > > ("Platform/Marvell/Cn913xDb/Cn913xDbA.dsc" fails to build regardless: > "build" complains that > "Silicon/Marvell/OcteonTx/DeviceTree/T91/$(PLATFORM_NAME).inf" is missing= , > and as far as I can see, not even the > "Silicon/Marvell/OcteonTx/DeviceTree" directory exists.) > > Cc: Leif Lindholm > Cc: Marcin Wojtas > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4564 > Signed-off-by: Laszlo Ersek > --- > Silicon/Marvell/Armada7k8k/Library/RealTimeClockLib/RealTimeClockLib.c |= 52 ++++++++++---------- > 1 file changed, 26 insertions(+), 26 deletions(-) > > diff --git a/Silicon/Marvell/Armada7k8k/Library/RealTimeClockLib/RealTime= ClockLib.c b/Silicon/Marvell/Armada7k8k/Library/RealTimeClockLib/RealTimeCl= ockLib.c > index 49c9385d53d6..d538b030b111 100644 > --- a/Silicon/Marvell/Armada7k8k/Library/RealTimeClockLib/RealTimeClockLi= b.c > +++ b/Silicon/Marvell/Armada7k8k/Library/RealTimeClockLib/RealTimeClockLi= b.c > @@ -205,6 +205,31 @@ LibSetWakeupTime ( > return EFI_SUCCESS; > } > > +/** > + 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 function= s in virtual mode. > + // You will need to call EfiConvertPointer (). To convert any stored p= hysical 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**)&mArmadaRtcBase); > +} > + > /** > This is the declaration of an EFI image entry point. This can be the e= ntry point to an application > written to this specification, an EFI boot service driver, or an EFI r= untime driver. > @@ -285,7 +310,7 @@ LibRtcInitialize ( > Status =3D gBS->CreateEventEx ( > EVT_NOTIFY_SIGNAL, > TPL_NOTIFY, > - LibRtcVirtualNotifyEvent, > + VirtualNotifyEvent, > NULL, > &gEfiEventVirtualAddressChangeGuid, > &mRtcVirtualAddrChangeEvent > @@ -304,28 +329,3 @@ ErrSetMem: > > 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 function= s in virtual mode. > - // You will need to call EfiConvertPointer (). To convert any stored p= hysical 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**)&mArmadaRtcBase); > -} > Reviewed-by: Marcin Wojtas Thanks, Marcin -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109574): https://edk2.groups.io/g/devel/message/109574 Mute This Topic: https://groups.io/mt/101914670/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-