]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseRngLib/BaseRngLibInternals.h
MdePkg: Apply uncrustify changes
[mirror_edk2.git] / MdePkg / Library / BaseRngLib / BaseRngLibInternals.h
1 /** @file
2
3 Architecture specific interface to RNG functionality.
4
5 Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR>
6
7 SPDX-License-Identifier: BSD-2-Clause-Patent
8
9 **/
10
11 #ifndef BASE_RNGLIB_INTERNALS_H_
12
13 /**
14 Generates a 16-bit random number.
15
16 @param[out] Rand Buffer pointer to store the 16-bit random value.
17
18 @retval TRUE Random number generated successfully.
19 @retval FALSE Failed to generate the random number.
20
21 **/
22 BOOLEAN
23 EFIAPI
24 ArchGetRandomNumber16 (
25 OUT UINT16 *Rand
26 );
27
28 /**
29 Generates a 32-bit random number.
30
31 @param[out] Rand Buffer pointer to store the 32-bit random value.
32
33 @retval TRUE Random number generated successfully.
34 @retval FALSE Failed to generate the random number.
35
36 **/
37 BOOLEAN
38 EFIAPI
39 ArchGetRandomNumber32 (
40 OUT UINT32 *Rand
41 );
42
43 /**
44 Generates a 64-bit random number.
45
46 @param[out] Rand Buffer pointer to store the 64-bit random value.
47
48 @retval TRUE Random number generated successfully.
49 @retval FALSE Failed to generate the random number.
50
51 **/
52 BOOLEAN
53 EFIAPI
54 ArchGetRandomNumber64 (
55 OUT UINT64 *Rand
56 );
57
58 /**
59 Checks whether the RNG instruction is supported.
60
61 @retval TRUE RNG instruction is supported.
62 @retval FALSE RNG instruction is not supported.
63
64 **/
65 BOOLEAN
66 EFIAPI
67 ArchIsRngSupported (
68 VOID
69 );
70
71 #if defined (MDE_CPU_AARCH64)
72
73 // RNDR, Random Number
74 #define RNDR S3_3_C2_C4_0
75
76 #endif
77
78 #endif // BASE_RNGLIB_INTERNALS_H_