MdeModulePkg: Duplicate BaseRngLibTimerLib to MdeModulePkg

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4504

The BaseRngLibTimerLib allows to generate number based on a timer.
This mechanism allows to have a basic non-secure implementation
for non-production platforms.
To bind and identify Random Number Generators implementations with
a GUID, an unsafe GUID should be added. This GUID cannot be added
to the MdePkg unless it is also added to a specification.

To keep the MdePkg self-contained, copy the BaseRngLibTimerLib to
the MdeModulePkg. This will allow to define an unsafe Rng GUID
in a later patch in the MdeModulePkg.

The MdePkg implementation will be removed later. This allows to give
some time to platform owners to switch to the MdeModulePkg
implementation.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Tested-by: Kun Qin <kun.qin@microsoft.com>
This commit is contained in:
Pierre Gondois
2023-08-11 16:33:02 +02:00
committed by mergify[bot]
parent 2ce5ae43c2
commit 2f981bddcb
19 changed files with 262 additions and 18 deletions

View File

@@ -0,0 +1,15 @@
// @file
// Instance of RNG (Random Number Generator) Library.
//
// RngLib that uses TimerLib's performance counter to provide random numbers.
//
// Copyright (c) Microsoft Corporation.
//
// SPDX-License-Identifier: BSD-2-Clause-Patent
//
#string STR_MODULE_ABSTRACT #language en-US "Instance of RNG Library"
#string STR_MODULE_DESCRIPTION #language en-US "BaseRng Library that uses the TimerLib to provide low-entropy random numbers"