From 9bfbf7832dd379a4a006d236fbeda27be7e13928 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Mon, 21 Sep 2009 03:48:30 +0000 Subject: Make `cpuid' do the same thing for every sandglass_get_tsc() call. --- src/x86/tsc-x86.s | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/x86') diff --git a/src/x86/tsc-x86.s b/src/x86/tsc-x86.s index 46013bb..09e0e32 100644 --- a/src/x86/tsc-x86.s +++ b/src/x86/tsc-x86.s @@ -29,9 +29,11 @@ sandglass_get_tsc: pushl %ebx /* Callee-save register, clobbered by cpuid */ pushl %esi + xorl %eax, %eax /* Make cpuid do a consistent operation */ cpuid /* Serialize */ rdtsc /* Read time stamp counter */ movl %eax, %esi /* Store tsc */ + xorl %eax, %eax cpuid /* Serialize again */ movl %esi, %eax popl %esi -- cgit v1.2.3