artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
eaef53c
)
add rdtsc() to match amd64
author
jmatthew
<jmatthew@openbsd.org>
Sat, 17 Jun 2017 09:32:26 +0000
(09:32 +0000)
committer
jmatthew
<jmatthew@openbsd.org>
Sat, 17 Jun 2017 09:32:26 +0000
(09:32 +0000)
ok mikeb@ mlarkin@
sys/arch/i386/include/cpufunc.h
patch
|
blob
|
history
diff --git
a/sys/arch/i386/include/cpufunc.h
b/sys/arch/i386/include/cpufunc.h
index
8ae5382
..
fb745da
100644
(file)
--- a/
sys/arch/i386/include/cpufunc.h
+++ b/
sys/arch/i386/include/cpufunc.h
@@
-1,4
+1,4
@@
-/* $OpenBSD: cpufunc.h,v 1.2
5 2017/05/27 12:21:50 tedu Exp $
*/
+/* $OpenBSD: cpufunc.h,v 1.2
6 2017/06/17 09:32:26 jmatthew Exp $
*/
/* $NetBSD: cpufunc.h,v 1.8 1994/10/27 04:15:59 cgd Exp $ */
/*
@@
-217,6
+217,15
@@
mfence(void)
__asm volatile("mfence" : : : "memory");
}
+static __inline u_int64_t
+rdtsc(void)
+{
+ uint64_t tsc;
+
+ __asm volatile("rdtsc" : "=A" (tsc));
+ return (tsc);
+}
+
static __inline void
wrmsr(u_int msr, u_int64_t newval)
{