22STATIC BOOLEAN mRndrSupported;
47 Isar0 = ArmReadIdAA64Isar0Reg ();
48 mRndrSupported = !!((Isar0 >> ARM_ID_AA64ISAR0_EL1_RNDR_SHIFT) & ARM_ID_AA64ISAR0_EL1_RNDR_MASK);
71 *
Rand = Rand64 & MAX_UINT16;
96 *
Rand = Rand64 & MAX_UINT32;
134 return mRndrSupported;
155 if (RngGuid ==
NULL) {
156 return EFI_INVALID_PARAMETER;
159 if (!mRndrSupported) {
160 return EFI_UNSUPPORTED;
167 RngLibGuid =
PcdGetPtr (PcdCpuRngSupportedAlgorithm);
169 CopyMem (RngGuid, RngLibGuid,
sizeof (*RngGuid));
171 CopyMem (RngGuid, &gEfiRngAlgorithmArmRndr,
sizeof (*RngGuid));
BOOLEAN EFIAPI ArmRndr(OUT UINT64 *Rand)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
BOOLEAN EFIAPI IsZeroGuid(IN CONST GUID *Guid)
#define PcdGetPtr(TokenName)
BOOLEAN EFIAPI ArchGetRandomNumber16(OUT UINT16 *Rand)
EFI_STATUS EFIAPI BaseRngLibConstructor(VOID)
BOOLEAN EFIAPI ArchGetRandomNumber64(OUT UINT64 *Rand)
BOOLEAN EFIAPI ArchGetRandomNumber32(OUT UINT32 *Rand)
EFI_STATUS EFIAPI GetRngGuid(GUID *RngGuid)
BOOLEAN EFIAPI ArchIsRngSupported(VOID)