OptionRomPkg BltLibSample: Fix build for IPF architecture

Use AsmReadItc for IPF and AsmReadTsc for IA32 & X64.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11580 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jljusten 2011-04-22 22:21:53 +00:00
parent 4da9ccc9e2
commit 437dfba25b
1 changed files with 17 additions and 3 deletions

View File

@ -20,6 +20,20 @@
#include <Library/UefiBootServicesTableLib.h> #include <Library/UefiBootServicesTableLib.h>
UINT64
ReadTimestamp (
VOID
)
{
#if defined (MDE_CPU_IA32) || defined (MDE_CPU_X64)
return AsmReadTsc ();
#elif defined (MDE_CPU_IPF)
return AsmReadItc ();
#else
#error ReadTimestamp not supported for this architecture!
#endif
}
UINT32 UINT32
Rand32 ( Rand32 (
VOID VOID
@ -34,10 +48,10 @@ Rand32 (
R32 = 0; R32 = 0;
Found = 0; Found = 0;
Tsc1 = AsmReadTsc (); Tsc1 = ReadTimestamp ();
Tsc2 = AsmReadTsc (); Tsc2 = ReadTimestamp ();
do { do {
Tsc2 = AsmReadTsc (); Tsc2 = ReadTimestamp ();
TscBits = Tsc2 ^ Tsc1; TscBits = Tsc2 ^ Tsc1;
Bits = HighBitSet64 (TscBits); Bits = HighBitSet64 (TscBits);
if (Bits > 0) { if (Bits > 0) {