diff options
author | qwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-08-29 01:53:37 +0000 |
---|---|---|
committer | qwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-08-29 01:53:37 +0000 |
commit | 138f2f82d8196c39635d0bfd68d87c65153a7c54 (patch) | |
tree | a7b3a47f742890583c07942faaef3c76d1338355 /EdkCompatibilityPkg | |
parent | 21a54a4d0b552fe62e6aed6f68ef55a2aa9253e4 (diff) | |
download | edk2-138f2f82d8196c39635d0bfd68d87c65153a7c54.zip edk2-138f2f82d8196c39635d0bfd68d87c65153a7c54.tar.gz edk2-138f2f82d8196c39635d0bfd68d87c65153a7c54.tar.bz2 |
GetNextMonotonicCount may not be available when GenerateRandomGuid is called. Add a static variable as a seed.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5752 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkCompatibilityPkg')
-rw-r--r-- | EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/Package.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/Package.c b/EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/Package.c index a867689..6e2c9df 100644 --- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/Package.c +++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/Package.c @@ -184,19 +184,13 @@ GenerateRandomGuid ( OUT EFI_GUID * Guid
)
{
- EFI_STATUS Status;
- static EFI_GUID GuidBase = { 0x14f95e01, 0xd562, 0x432e, { 0x84, 0x4a, 0x95, 0xa4, 0x39, 0x5, 0x10, 0x7e }};
- UINT64 MonotonicCount;
+ EFI_GUID GuidBase = { 0x14f95e01, 0xd562, 0x432e, { 0x84, 0x4a, 0x95, 0xa4, 0x39, 0x5, 0x10, 0x7e }};
+ static UINT64 Count = 0;
CopyGuid (Guid, &GuidBase);
-
- Status = gBS->GetNextMonotonicCount (&MonotonicCount);
- ASSERT_EFI_ERROR (Status);
-
- //
- // Use Monotonic Count as a psedo random number generator.
- //
- *((UINT64 *) Guid) = *((UINT64 *) Guid) + MonotonicCount;
+
+ Count++;
+ *((UINT64 *) Guid) = *((UINT64 *) Guid) + Count;
}
EFI_STATUS
|