Take skew into account for cpu_counter().

This commit is contained in:
ad 2008-05-10 16:21:41 +00:00
parent 75ada79f33
commit feb38f6706
2 changed files with 8 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpufunc.S,v 1.11 2008/05/10 16:12:32 ad Exp $ */
/* $NetBSD: cpufunc.S,v 1.12 2008/05/10 16:21:41 ad Exp $ */
/*-
* Copyright (c) 1998, 2007, 2008 The NetBSD Foundation, Inc.
@ -221,10 +221,12 @@ NENTRY(cpu_counter)
rdtsc
shlq $32, %rdx
orq %rdx, %rax
addq CPUVAR(CC_SKEW), %rax
ret
NENTRY(cpu_counter32)
rdtsc
addl CPUVAR(CC_SKEW), %eax
ret
NENTRY(rdpmc)

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpufunc.S,v 1.10 2008/05/10 16:12:32 ad Exp $ */
/* $NetBSD: cpufunc.S,v 1.11 2008/05/10 16:21:41 ad Exp $ */
/*-
* Copyright (c) 1998, 2007 The NetBSD Foundation, Inc.
@ -36,7 +36,7 @@
*/
#include <machine/asm.h>
__KERNEL_RCSID(0, "$NetBSD: cpufunc.S,v 1.10 2008/05/10 16:12:32 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: cpufunc.S,v 1.11 2008/05/10 16:21:41 ad Exp $");
#include "opt_xen.h"
@ -143,11 +143,14 @@ END(wrmsr_locked)
ENTRY(cpu_counter)
rdtsc
addl CPUVAR(CC_SKEW), %eax
adcl CPUVAR(CC_SKEW+4), %edx
ret
END(cpu_counter)
ENTRY(cpu_counter32)
rdtsc
addl CPUVAR(CC_SKEW), %eax
ret
END(cpu_counter32)