]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseLib/BaseLibInternals.h
MdePkg/BaseLib: Add one wrapper on RdRand access for parameter check.
[mirror_edk2.git] / MdePkg / Library / BaseLib / BaseLibInternals.h
index fe416a0c38b50d552a7007c9f2c9908afeea70df..a8f712b1addedcd7fdc8bbe442a9cf9e7a684121 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Declaration of internal functions in BaseLib.\r
 \r
-  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -728,6 +728,52 @@ InternalX86DisablePaging64 (
   IN      UINT32                    NewStack\r
   );\r
 \r
+/**\r
+  Generates a 16-bit random number through RDRAND instruction.\r
+\r
+  @param[out]  Rand     Buffer pointer to store the random result.\r
+\r
+  @retval TRUE          RDRAND call was successful.\r
+  @retval FALSE         Failed attempts to call RDRAND.\r
+\r
+ **/\r
+BOOLEAN\r
+EFIAPI\r
+InternalX86RdRand16 (\r
+  OUT     UINT16                    *Rand\r
+  );\r
+\r
+/**\r
+  Generates a 32-bit random number through RDRAND instruction.\r
+\r
+  @param[out]  Rand     Buffer pointer to store the random result.\r
+\r
+  @retval TRUE          RDRAND call was successful.\r
+  @retval FALSE         Failed attempts to call RDRAND.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+InternalX86RdRand32 (\r
+  OUT     UINT32                    *Rand\r
+  );\r
+\r
+/**\r
+  Generates a 64-bit random number through RDRAND instruction.\r
+\r
+\r
+  @param[out]  Rand     Buffer pointer to store the random result.\r
+\r
+  @retval TRUE          RDRAND call was successful.\r
+  @retval FALSE         Failed attempts to call RDRAND.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+InternalX86RdRand64  (\r
+  OUT     UINT64                    *Rand\r
+  );\r
+\r
 \r
 #elif defined (MDE_CPU_IPF)\r
 //\r