diff options
author | Pierre Gondois <pierre.gondois@arm.com> | 2023-08-11 16:33:03 +0200 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2023-09-08 09:48:55 +0000 |
commit | e93468442b7da7bc80e00014e854c0c8a0a7184b (patch) | |
tree | f690aeb092000d243bd6981fe5860e8336d04ea3 | |
parent | 2f981bddcbd6adde5f682caf0d3812ba92bc0f73 (diff) | |
download | edk2-e93468442b7da7bc80e00014e854c0c8a0a7184b.tar.gz |
MdePkg: Add deprecated warning to BaseRngLibTimer
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4504
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 <pierre.gondois@arm.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Tested-by: Kun Qin <kun.qin@microsoft.com>
-rw-r--r-- | MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf | 1 | ||||
-rw-r--r-- | MdePkg/Library/BaseRngLibTimerLib/RngLibTimer.c | 22 |
2 files changed, 23 insertions, 0 deletions
diff --git a/MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf b/MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf index f857290e82..96c90db63f 100644 --- a/MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf +++ b/MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf @@ -23,6 +23,7 @@ MODULE_TYPE = BASE
VERSION_STRING = 1.0
LIBRARY_CLASS = RngLib
+ CONSTRUCTOR = BaseRngLibTimerConstructor
[Sources]
RngLibTimer.c
diff --git a/MdePkg/Library/BaseRngLibTimerLib/RngLibTimer.c b/MdePkg/Library/BaseRngLibTimerLib/RngLibTimer.c index 980854d67b..c4fdd1df68 100644 --- a/MdePkg/Library/BaseRngLibTimerLib/RngLibTimer.c +++ b/MdePkg/Library/BaseRngLibTimerLib/RngLibTimer.c @@ -14,6 +14,28 @@ #define DEFAULT_DELAY_TIME_IN_MICROSECONDS 10
/**
+ 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.
|