aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2021-01-09 20:39:19 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2021-01-10 02:42:34 +0000
commit45974de8fb23710873417f1d2ca513761da6cacc (patch)
tree88f6cf0b63ddfde079dabf699e889e85b96d0173 /sys/amd64
parent826fc3cc3d59c1d0af4caf3a08888e168bfe22b2 (diff)
downloadsrc-45974de8fb23710873417f1d2ca513761da6cacc.tar.gz
src-45974de8fb23710873417f1d2ca513761da6cacc.zip
x86: Add rdtscp32() into cpufunc.h.
Suggested by: markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27986
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/include/cpufunc.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h
index 94e9c15b5117..2bf2339c7d6e 100644
--- a/sys/amd64/include/cpufunc.h
+++ b/sys/amd64/include/cpufunc.h
@@ -412,6 +412,15 @@ rdtsc32(void)
return (rv);
}
+static __inline uint32_t
+rdtscp32(void)
+{
+ uint32_t rv;
+
+ __asm __volatile("rdtscp" : "=a" (rv) : : "ecx", "edx");
+ return (rv);
+}
+
static __inline void
wbinvd(void)
{