summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Kubacki <michael.kubacki@microsoft.com>2024-05-31 11:49:17 -0400
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2025-02-06 20:29:15 +0000
commitde5c1198c1c8ded24f546d1da42ad5c139f2e9d8 (patch)
tree46853ee07556d68054846527fffdc7a60fe62d62
parent7518b93f7715cf427f17025b809597fd2b3b436f (diff)
downloadedk2-de5c1198c1c8ded24f546d1da42ad5c139f2e9d8.tar.gz
MdePkg: Add Random Number Generator (RNG) PPI
REF:https://github.com/tianocore/edk2/issues/10529 Adds a new PPI that serves the same purpose as EFI_RNG_PROTOCOL in DXE. This PPI can be produced by a PEIM to provide a dynamic interface to RNG services in PEI. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
-rw-r--r--MdePkg/Include/Ppi/Rng.h27
-rw-r--r--MdePkg/MdePkg.dec3
2 files changed, 30 insertions, 0 deletions
diff --git a/MdePkg/Include/Ppi/Rng.h b/MdePkg/Include/Ppi/Rng.h
new file mode 100644
index 0000000000..93f45c1ada
--- /dev/null
+++ b/MdePkg/Include/Ppi/Rng.h
@@ -0,0 +1,27 @@
+/** @file
+ The Random Number Generator (RNG) PPI is used to provide random bits for use
+ in PEIMs, or entropy for seeding other random number generators. The PPI was
+ introduced in the PI 1.9 Specification.
+
+ Copyright (c) Microsoft Corporation.
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#ifndef RNG_PPI_H_
+#define RNG_PPI_H_
+
+#include <Guid/Rng.h>
+
+///
+/// Global ID for the Random Number Generator PPI
+///
+#define RNG_PPI_GUID \
+ { \
+ 0xeaed0a7e, 0x1a70, 0x4c2b, { 0x85, 0x58, 0x37, 0x17, 0x74, 0x56, 0xd8, 0x06 } \
+ }
+
+typedef EFI_RNG_INTERFACE RNG_PPI;
+
+extern EFI_GUID gEfiRngPpiGuid;
+
+#endif
diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
index f1a25b66ae..fc53cf5f1e 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -1086,6 +1086,9 @@
## Include/Ppi/DelayedDispatch.h
gEfiPeiDelayedDispatchPpiGuid = { 0x869c711d, 0x649c, 0x44fe, { 0x8b, 0x9e, 0x2c, 0xbb, 0x29, 0x11, 0xc3, 0xe6 }}
+ ## Include/Ppi/Rng.h
+ gEfiRngPpiGuid = { 0xeaed0a7e, 0x1a70, 0x4c2b, { 0x85, 0x58, 0x37, 0x17, 0x74, 0x56, 0xd8, 0x06 }}
+
[Protocols]
## Include/Protocol/MemoryAccept.h
gEdkiiMemoryAcceptProtocolGuid = { 0x38c74800, 0x5590, 0x4db4, { 0xa0, 0xf3, 0x67, 0x5d, 0x9b, 0x8e, 0x80, 0x26 }}