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_64/tsc-x86_64.s | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/x86_64') diff --git a/src/x86_64/tsc-x86_64.s b/src/x86_64/tsc-x86_64.s index 52f02c2..e710891 100644 --- a/src/x86_64/tsc-x86_64.s +++ b/src/x86_64/tsc-x86_64.s @@ -28,11 +28,13 @@ .type sandglass_get_tsc, @function sandglass_get_tsc: movq %rbx, %rdi /* Callee-save register, clobbered by cpuid */ + xorl %eax, %eax /* Make cpuid do a consistent operation */ cpuid /* Serialize */ rdtsc /* Read time stamp counter */ shlq $32, %rdx orq %rdx, %rax movq %rax, %rsi + xorl %eax, %eax cpuid /* Serialize again */ movq %rsi, %rax movq %rdi, %rbx -- cgit v1.2.3