From nobody Mon Feb 9 09:09:10 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+109842+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+109842+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1697804366; cv=none; d=zohomail.com; s=zohoarc; b=bboSo4kK2JUzFw71omBxJomtqoXdghcfQ+zHq5cCaYMD2em7qmklyfi3x87GZcfeJ8l+SuIEBl/Cu6WSzdwF5W/EvpeJ0eRY7jFht9XIAizwY+whweXedhfBZxODvWGVoruCHQgnDAOmbdiwjpJ+KxFO/znuLI8NMoYI93vYXTg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697804366; 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=Y2ImJVdIW6jGwB3XEtUPzn7RoAkApog17K2uqY6j9es=; b=aiaQSgJwbT9Ls9/EHU+cQZWtqmaZSSNnb/yoPvois3Fn6sS8kLLYDEFs3Uz+4rIHd243rD5qQ1KuhCwsO/ib996vnqe1IgyfYNSE2RabUTJJrSnNpO43Z755ziem4d2QGsHB6abIaA/nGirlUf5W2e6jAjMOGp+Uo+kEGNBud7U= 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+109842+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 1697804366528568.2132527914623; Fri, 20 Oct 2023 05:19:26 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=Y2ImJVdIW6jGwB3XEtUPzn7RoAkApog17K2uqY6j9es=; 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=1697804366; v=1; b=FJrypdyu7XbIaXbwjKN71HhJzcIhVfbSlbXoZslnZkTzfDVYYlpGmxzZ1g2wapJJM5KRV3+Z lQvID6tapGZ2HAECO7ptwf70An7sQxPyqSuAhjb82JOIUAvCBKV8JHfUYDzV6xTq5dCfD8zH66M WnDiCt1voeMFzKAGVCTYuor8= X-Received: by 127.0.0.2 with SMTP id K4OXYY1788612xSYIvZByA5D; Fri, 20 Oct 2023 05:19:26 -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.web10.52785.1697804365571973374 for ; Fri, 20 Oct 2023 05:19:25 -0700 X-Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-490-H7YmKm56NUG_IWXHApTVAA-1; Fri, 20 Oct 2023 08:19:16 -0400 X-MC-Unique: H7YmKm56NUG_IWXHApTVAA-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 0115B8115B1; Fri, 20 Oct 2023 12:19:16 +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 E90F2503C; Fri, 20 Oct 2023 12:19:14 +0000 (UTC) From: "Laszlo Ersek" To: devel@edk2.groups.io Cc: Leif Lindholm , Ling Jia , Peng Xie , Yiqi Shu Subject: [edk2-devel] [edk2-platforms PATCH 6/7] FT2000-4Pkg/RealTimeClockLib: remove superfluous instance init steps Date: Fri, 20 Oct 2023 14:19:02 +0200 Message-Id: <20231020121903.44986-7-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: cpt0TkNeBQ3zRuLsc6WnlAyJx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1697804368424100029 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 FT2000-4Pkg/RealTimeClockLib accordingly (it only has code that's redundant for step (3); it does not try to set "gRT" fields). (Note that the lib instance INF file already does not list gEfiRealTimeClockArchProtocolGuid.) Build-tested only (with "DurianPkg.dsc"). Cc: Leif Lindholm Cc: Ling Jia Cc: Peng Xie Cc: Yiqi Shu Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4565 Signed-off-by: Laszlo Ersek --- Silicon/Phytium/FT2000-4Pkg/Library/RealTimeClockLib/RealTimeClockLib.c | = 13 ------------- 1 file changed, 13 deletions(-) diff --git a/Silicon/Phytium/FT2000-4Pkg/Library/RealTimeClockLib/RealTimeC= lockLib.c b/Silicon/Phytium/FT2000-4Pkg/Library/RealTimeClockLib/RealTimeCl= ockLib.c index 5c3d0cdccff8..26fbd7a3552a 100644 --- a/Silicon/Phytium/FT2000-4Pkg/Library/RealTimeClockLib/RealTimeClockLib= .c +++ b/Silicon/Phytium/FT2000-4Pkg/Library/RealTimeClockLib/RealTimeClockLib= .c @@ -15,7 +15,6 @@ #include #include #include -#include #include "RealTimeClockLib.h" =20 STATIC EFI_EVENT mRtcVirtualAddrChangeEvent; @@ -344,7 +343,6 @@ LibRtcInitialize ( ) { EFI_STATUS Status; - EFI_HANDLE Handle; INT16 TimeZone; UINTN Size; EFI_TIME Time; @@ -437,17 +435,6 @@ LibRtcInitialize ( return Status; } // - // Install the protocol - // - Handle =3D NULL; - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &Handle, - &gEfiRealTimeClockArchProtocolGuid, - NULL, - NULL - ); - ASSERT_EFI_ERROR (Status); - // // Register for the virtual address change event // Status =3D gBS->CreateEventEx ( -=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 (#109842): https://edk2.groups.io/g/devel/message/109842 Mute This Topic: https://groups.io/mt/102079661/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-