From nobody Mon Feb 9 09:24:46 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+109841+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109841+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1697804365; cv=none; d=zohomail.com; s=zohoarc; b=dHXkwbVC0lIzFtyXVk3qh42joJRNJlgnIF7aizAAYZcgDG1vxjv/uQSWgzQZUVwVUtmDLygCmOTv+L990VfNAglaQd9EWJclw52rkb5RmcmHKg38rXvIXn6H6Yl9JB/2T2a4BQVGeAwP4KyhwYDriCLj2GbTQB59pH8j6KIYzM8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697804365; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=sUHEubcCGNA4JLbOKl9Zk24z9uTu25blXQPOBnSO9Cg=; b=IT4DLNudOVmtyhPIsLBQXkKbBKwWM1sb16TkoBIypYna2wPqhzbSeoX6fxUM43j6o4h8Fx5R6gj2xXEHqx7fgpflxrhVsY0C+QpUp69A7d8AugHfH2TlWnsSr+Nt8qwUqIIesyPUtyLJN1dbRR5T6/u6Z2MB1TDXa0n6GGPUPoQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+109841+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1697804365502397.69913267636946; Fri, 20 Oct 2023 05:19:25 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=sUHEubcCGNA4JLbOKl9Zk24z9uTu25blXQPOBnSO9Cg=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1697804365; v=1; b=V/kktuTV/IjKq/WorHy9JoyiuPoNhL431Cesz9tdS2MaFXqLYGkWXw30H6KUGDTe2N5m790K 7HVSPzD+HrJSrMDCIhvTRRupC4XMRwA2RMkJqOloZYuppjX8Lo25+40MA8YBFBCQ82WhZyLCk3Q 2K+1ULOX7FKksQo6gUvdPFBM= X-Received: by 127.0.0.2 with SMTP id hnyBYY1788612xLaluc9CSi7; Fri, 20 Oct 2023 05:19:25 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web11.52935.1697804364521721074 for ; Fri, 20 Oct 2023 05:19:24 -0700 X-Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-74-pP1_j6JdPXySGose5-xGcw-1; Fri, 20 Oct 2023 08:19:17 -0400 X-MC-Unique: pP1_j6JdPXySGose5-xGcw-1 X-Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0598A3C1492C; Fri, 20 Oct 2023 12:19:17 +0000 (UTC) X-Received: from lacos-laptop-9.usersys.redhat.com (unknown [10.39.194.108]) by smtp.corp.redhat.com (Postfix) with ESMTP id 448658CEF; Fri, 20 Oct 2023 12:19:16 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm Subject: [edk2-devel] [edk2-platforms PATCH 7/7] Omap35xxPkg/RealTimeClockLib: remove superfluous instance init steps Date: Fri, 20 Oct 2023 14:19:03 +0200 Message-Id: <20231020121903.44986-8-lersek@redhat.com> In-Reply-To: <20231020121903.44986-1-lersek@redhat.com> References: <20231020121903.44986-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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,lersek@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 6umK8r1vjgIA0zsH11E6mfzkx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1697804366389100023 Content-Type: text/plain; charset="utf-8"; x-default="true" RealTimeClockLib instances are consumed by edk2's EmbeddedPkg/RealTimeClockRuntimeDxe driver. In its entry point function InitializeRealTimeClock(), the driver: (1) calls LibRtcInitialize(), (2) sets the GetTime(), SetTime(), GetWakeupTime() and SetWakeupTime() runtime services to its own similarly-named functions -- where those functions wrap the corresponding RealTimeClockLib APIs, (3) installs EFI_REAL_TIME_CLOCK_ARCH_PROTOCOL with a NULL protocol interface. Steps (2) and (3) conform to PI v1.8 sections II-9.7.2.4 through II-9.7.2.7. However, this means that LibRtcInitialize() (of any RealTimeClockLib instance) should not itself (a) set the GetTime(), SetTime(), GetWakeupTime() and SetWakeupTime() runtime services, nor (b) install EFI_REAL_TIME_CLOCK_ARCH_PROTOCOL. The runtime service pointers will be overwritten in step (2) anyway, and step (3) will uselessly install a second (NULL-interface) EFI_REAL_TIME_CLOCK_ARCH_PROTOCOL instance in the protocol database. (The protocol only serves to notify the DXE Foundation about said runtime services being available.) Clean up Omap35xxPkg/RealTimeClockLib accordingly. (Note that the lib instance INF file already does not list UefiRuntimeServicesTableLib and gEfiRealTimeClockArchProtocolGuid.) Build-tested only (with "BeagleBoardPkg.dsc"). Cc: Ard Biesheuvel Cc: Leif Lindholm Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4565 Signed-off-by: Laszlo Ersek --- Silicon/TexasInstruments/Omap35xxPkg/Library/RealTimeClockLib/RealTimeCloc= kLib.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/Silicon/TexasInstruments/Omap35xxPkg/Library/RealTimeClockLib/= RealTimeClockLib.c b/Silicon/TexasInstruments/Omap35xxPkg/Library/RealTimeC= lockLib/RealTimeClockLib.c index 10920a13786b..24fcaaf125c4 100644 --- a/Silicon/TexasInstruments/Omap35xxPkg/Library/RealTimeClockLib/RealTim= eClockLib.c +++ b/Silicon/TexasInstruments/Omap35xxPkg/Library/RealTimeClockLib/RealTim= eClockLib.c @@ -10,11 +10,9 @@ =20 #include #include -#include #include #include =20 -#include #include =20 #include @@ -242,7 +240,6 @@ LibRtcInitialize ( ) { EFI_STATUS Status; - EFI_HANDLE Handle; UINT8 Data; EFI_TPL OldTpl; =20 @@ -255,19 +252,5 @@ LibRtcInitialize ( ASSERT_EFI_ERROR(Status); gBS->RestoreTPL(OldTpl); =20 - // Setup the setters and getters - gRT->GetTime =3D LibGetTime; - gRT->SetTime =3D LibSetTime; - gRT->GetWakeupTime =3D LibGetWakeupTime; - gRT->SetWakeupTime =3D LibSetWakeupTime; - - // Install the protocol - Handle =3D NULL; - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &Handle, - &gEfiRealTimeClockArchProtocolGuid, NULL, - NULL - ); - - return Status; + return EFI_SUCCESS; } -=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 (#109841): https://edk2.groups.io/g/devel/message/109841 Mute This Topic: https://groups.io/mt/102079660/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/3901457/1787277/102458076= /xyzzy [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-