The branch main has been updated by kib:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=45974de8fb23710873417f1d2ca513761da6cacc

commit 45974de8fb23710873417f1d2ca513761da6cacc
Author:     Konstantin Belousov <[email protected]>
AuthorDate: 2021-01-09 20:39:19 +0000
Commit:     Konstantin Belousov <[email protected]>
CommitDate: 2021-01-10 02:42:34 +0000

    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
---
 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 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)
 {
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)
 {
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to