summaryrefslogtreecommitdiffstats
path: root/OptionRomPkg
diff options
context:
space:
mode:
authorjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>2011-04-22 22:21:53 +0000
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>2011-04-22 22:21:53 +0000
commit437dfba25bb023f1a9ae351438c14204e950c1f2 (patch)
tree31957d2b3b0868b8fdff91ac025984602123fca9 /OptionRomPkg
parent4da9ccc9e26c7e74d10425b46eae005dc0ecbf24 (diff)
downloadedk2-437dfba25bb023f1a9ae351438c14204e950c1f2.tar.gz
edk2-437dfba25bb023f1a9ae351438c14204e950c1f2.tar.bz2
edk2-437dfba25bb023f1a9ae351438c14204e950c1f2.zip
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
Diffstat (limited to 'OptionRomPkg')
-rw-r--r--OptionRomPkg/Application/BltLibSample/BltLibSample.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/OptionRomPkg/Application/BltLibSample/BltLibSample.c b/OptionRomPkg/Application/BltLibSample/BltLibSample.c
index fd2b2ce345..300b9ee117 100644
--- a/OptionRomPkg/Application/BltLibSample/BltLibSample.c
+++ b/OptionRomPkg/Application/BltLibSample/BltLibSample.c
@@ -20,6 +20,20 @@
#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
Rand32 (
VOID
@@ -34,10 +48,10 @@ Rand32 (
R32 = 0;
Found = 0;
- Tsc1 = AsmReadTsc ();
- Tsc2 = AsmReadTsc ();
+ Tsc1 = ReadTimestamp ();
+ Tsc2 = ReadTimestamp ();
do {
- Tsc2 = AsmReadTsc ();
+ Tsc2 = ReadTimestamp ();
TscBits = Tsc2 ^ Tsc1;
Bits = HighBitSet64 (TscBits);
if (Bits > 0) {