Date: Sun, 17 Jan 2021 05:10:38 GMT From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: b9f6bda16b27 - stable/12 - x86: Add rdtscp32() into cpufunc.h. Message-ID: <202101170510.10H5AcYf046094@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b9f6bda16b274b2b090db39781f7eb315b80c126 commit b9f6bda16b274b2b090db39781f7eb315b80c126 Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2021-01-09 20:39:19 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2021-01-17 04:44:18 +0000 x86: Add rdtscp32() into cpufunc.h. (cherry picked from commit 45974de8fb23710873417f1d2ca513761da6cacc) --- sys/amd64/include/cpufunc.h | 9 +++++++++ sys/i386/include/cpufunc.h | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h index 2a03d9b61941..85e6c60a4ffd 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) { diff --git a/sys/i386/include/cpufunc.h b/sys/i386/include/cpufunc.h index 3feeef02499c..9646590a6a40 100644 --- a/sys/i386/include/cpufunc.h +++ b/sys/i386/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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202101170510.10H5AcYf046094>