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 CD0D69417A3 for ; Tue, 18 Jul 2023 11:52:38 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=vISjAo9LWVGdvVR2c4yynJhUyKvLp7ujwt6bGE0C9bM=; c=relaxed/simple; d=groups.io; h=X-Received:X-Received:X-Received:X-Received:From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Unsubscribe:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:X-Gm-Message-State:Content-Transfer-Encoding; s=20140610; t=1689681157; v=1; b=JGuoXH3uiWpxNMblH15W/NkSjHCtYtI8nORMRm6yWcSiU/v3ZsF8G0MbR0/ay/CXzw/xbvye wpvv/GApLWTd4QwiLSgBg8R4JcbieFOkDnMaskwMBiB3EU7+MADuiHtQDc2xrfQ9OMKf2NPW/LB 7ZM5I514j8BOGHQVq8p4E2O4= X-Received: by 127.0.0.2 with SMTP id WX6WYY7687511xBF011gW7mJ; Tue, 18 Jul 2023 04:52:37 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.5677.1689681156672296133 for ; Tue, 18 Jul 2023 04:52:36 -0700 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B807EFEC; Tue, 18 Jul 2023 04:53:19 -0700 (PDT) X-Received: from e126645.arm.com (e126645.nice.arm.com [10.34.100.101]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id B6F6B3F6C4; Tue, 18 Jul 2023 04:52:34 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io Cc: Michael D Kinney , Liming Gao , Zhiguang Liu , Jiewen Yao , Jian J Wang , Ard Biesheuvel , Sami Mujawar , Jose Marinho , Kun Qin Subject: [edk2-devel] [PATCH v5 2/9] MdePkg: Add deprecated warning to BaseRngLibTimer Date: Tue, 18 Jul 2023 13:51:49 +0200 Message-Id: <20230718115156.1224842-3-pierre.gondois@arm.com> In-Reply-To: <20230718115156.1224842-1-pierre.gondois@arm.com> References: <20230718115156.1224842-1-pierre.gondois@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,pierre.gondois@arm.com X-Gm-Message-State: 8aTJ49E7rzKB4tLpcztG4lQ7x7686176AA= 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=JGuoXH3u; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.com (policy=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 From: Pierre Gondois BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4504 To keep the MdePkg self-contained and avoid dependencies on GUIDs defined in other packages, the BaseRngLibTimer was moved to the MdePkg. Add a constructor to warn and request to use the MdeModulePkg implementation. Signed-off-by: Pierre Gondois --- .../BaseRngLibTimerLib/BaseRngLibTimerLib.inf | 1 + .../Library/BaseRngLibTimerLib/RngLibTimer.c | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf b/M= dePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf index f857290e823b..96c90db63f6f 100644 --- a/MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf +++ b/MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf @@ -23,6 +23,7 @@ [Defines] MODULE_TYPE =3D BASE VERSION_STRING =3D 1.0 LIBRARY_CLASS =3D RngLib + CONSTRUCTOR =3D BaseRngLibTimerConstructor =20 [Sources] RngLibTimer.c diff --git a/MdePkg/Library/BaseRngLibTimerLib/RngLibTimer.c b/MdePkg/Lib= rary/BaseRngLibTimerLib/RngLibTimer.c index 980854d67b72..c4fdd1df68d3 100644 --- a/MdePkg/Library/BaseRngLibTimerLib/RngLibTimer.c +++ b/MdePkg/Library/BaseRngLibTimerLib/RngLibTimer.c @@ -13,6 +13,28 @@ =20 #define DEFAULT_DELAY_TIME_IN_MICROSECONDS 10 =20 +/** + This implementation is to be replaced by its MdeModulePkg copy. + The cause being that some GUIDs (gEdkiiRngAlgorithmUnSafe) cannot + be defined in the MdePkg. + + @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS. +**/ +RETURN_STATUS +EFIAPI +BaseRngLibTimerConstructor ( + VOID + ) +{ + DEBUG (( + DEBUG_WARN, + "Warning: This BaseRngTimerLib implementation will be deprecated. " + "Please use the MdeModulePkg implementation equivalent.\n" + )); + + return RETURN_SUCCESS; +} + /** Using the TimerLib GetPerformanceCounterProperties() we delay for enough time for the PerformanceCounter to increment. --=20 2.25.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#107009): https://edk2.groups.io/g/devel/message/107009 Mute This Topic: https://groups.io/mt/100213729/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-