summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRegina König2021-04-21 02:06:12 +0200
committerRegina König2021-04-21 02:06:12 +0200
commit36f9935934a8edc6581dc809162d26f337b7861d (patch)
treea22e76001b479b5f21df815005d1db08b19eb666
parentTry modified version for cpuspeed which gives the correct result (diff)
downloadmemtest86-36f9935934a8edc6581dc809162d26f337b7861d.tar.gz
memtest86-36f9935934a8edc6581dc809162d26f337b7861d.tar.xz
memtest86-36f9935934a8edc6581dc809162d26f337b7861d.zip
Fix assembly code. Now the correct CLK value is computed
-rw-r--r--efi_memtest/memtest86+/efi/init.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/efi_memtest/memtest86+/efi/init.c b/efi_memtest/memtest86+/efi/init.c
index 2756838..cc7f57d 100644
--- a/efi_memtest/memtest86+/efi/init.c
+++ b/efi_memtest/memtest86+/efi/init.c
@@ -1240,18 +1240,18 @@ static int cpuspeed(void)
:"=a" (end_low), "=d" (end_high)
);*/
- /*asm __volatile__ (
+ asm __volatile__ (
"rdtsc\n\t" \
- "subl %0, %%eax\n\t" \
- "sbbl %1, %%edx\n\t" \
+ "subl %2, %%eax\n\t" \
+ "sbbl %3, %%edx\n\t" \
:"=a" (end_low), "=d" (end_high)
:"r" (stlow), "r" (sthigh)
- );*/
+ );
- asm __volatile__ (
+ /*asm __volatile__ (
"rdtsc"
:"=a" (end_low), "=d" (end_high)
- );
+ );*/
if (logflag) {
char log[28] = "stlow = ";
@@ -1281,7 +1281,7 @@ static int cpuspeed(void)
print_log(log, length);
}
- end_low -= stlow; // TODO remember the carry flag
+ //end_low -= stlow; // TODO remember the carry flag
/* Make sure we have a credible result */
if (loops < 4 || end_low < 50000) {