VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Library/BaseLib/X86RdRand.c@ 107675

最後變更 在這個檔案從107675是 99404,由 vboxsync 提交於 2 年 前

Devices/EFI/FirmwareNew: Update to edk2-stable202302 and make it build, bugref:4643

  • 屬性 svn:eol-style 設為 native
檔案大小: 1.4 KB
 
1/** @file
2 IA-32/x64 AsmRdRandxx()
3 Generates random number through CPU RdRand instruction.
4
5 Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8**/
9
10#include "BaseLibInternals.h"
11
12/**
13 Generates a 16-bit random number through RDRAND instruction.
14
15 if Rand is NULL, then ASSERT().
16
17 @param[out] Rand Buffer pointer to store the random result.
18
19 @retval TRUE RDRAND call was successful.
20 @retval FALSE Failed attempts to call RDRAND.
21
22 **/
23BOOLEAN
24EFIAPI
25AsmRdRand16 (
26 OUT UINT16 *Rand
27 )
28{
29 ASSERT (Rand != NULL);
30 return InternalX86RdRand16 (Rand);
31}
32
33/**
34 Generates a 32-bit random number through RDRAND instruction.
35
36 if Rand is NULL, then ASSERT().
37
38 @param[out] Rand Buffer pointer to store the random result.
39
40 @retval TRUE RDRAND call was successful.
41 @retval FALSE Failed attempts to call RDRAND.
42
43**/
44BOOLEAN
45EFIAPI
46AsmRdRand32 (
47 OUT UINT32 *Rand
48 )
49{
50 ASSERT (Rand != NULL);
51 return InternalX86RdRand32 (Rand);
52}
53
54/**
55 Generates a 64-bit random number through RDRAND instruction.
56
57 if Rand is NULL, then ASSERT().
58
59 @param[out] Rand Buffer pointer to store the random result.
60
61 @retval TRUE RDRAND call was successful.
62 @retval FALSE Failed attempts to call RDRAND.
63
64**/
65BOOLEAN
66EFIAPI
67AsmRdRand64 (
68 OUT UINT64 *Rand
69 )
70{
71 ASSERT (Rand != NULL);
72 return InternalX86RdRand64 (Rand);
73}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette