summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmatthew <jmatthew@openbsd.org>2017-06-17 09:32:26 +0000
committerjmatthew <jmatthew@openbsd.org>2017-06-17 09:32:26 +0000
commite4fade54070a8d98d2cc1d88be1343c3a8f2770e (patch)
tree16f38315b60554edd1678c421b6a7bd1dc0fbce9
parentInvalidate remote TLB entries by address range. This reduces (diff)
downloadwireguard-openbsd-e4fade54070a8d98d2cc1d88be1343c3a8f2770e.tar.xz
wireguard-openbsd-e4fade54070a8d98d2cc1d88be1343c3a8f2770e.zip
add rdtsc() to match amd64
ok mikeb@ mlarkin@
-rw-r--r--sys/arch/i386/include/cpufunc.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/arch/i386/include/cpufunc.h b/sys/arch/i386/include/cpufunc.h
index 8ae5382d828..fb745da8edb 100644
--- a/sys/arch/i386/include/cpufunc.h
+++ b/sys/arch/i386/include/cpufunc.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpufunc.h,v 1.25 2017/05/27 12:21:50 tedu Exp $ */
+/* $OpenBSD: cpufunc.h,v 1.26 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)
{