git: f4ea84cea23f - main - krping: Use get_cyclecount for get_cycles.

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Wed, 08 Mar 2023 23:12:40 UTC
The branch main has been updated by jhb:

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

commit f4ea84cea23fa8e6094f629cc3e4b1c39bd7bf34
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2023-03-08 23:06:59 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2023-03-08 23:06:59 +0000

    krping: Use get_cyclecount for get_cycles.
    
    This avoids having to duplicate identical MD code.
    
    Reviewed by:    np, emaste
    Differential Revision:  https://reviews.freebsd.org/D38971
---
 sys/contrib/rdma/krping/krping.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/sys/contrib/rdma/krping/krping.c b/sys/contrib/rdma/krping/krping.c
index 98f129597464..fe8ff9ed9243 100644
--- a/sys/contrib/rdma/krping/krping.c
+++ b/sys/contrib/rdma/krping/krping.c
@@ -69,13 +69,7 @@ MODULE_DEPEND(krping, linuxkpi, 1, 1, 1);
 static __inline uint64_t
 get_cycles(void)
 {
-#if defined(__amd64__) || defined(__i386__)
-	uint32_t low, high;
-	__asm __volatile("rdtsc" : "=a" (low), "=d" (high));
-	return (low | ((u_int64_t)high << 32));
-#elif defined(__powerpc64__)
-	return __builtin_readcyclecounter();
-#endif
+	return (get_cyclecount());
 }
 
 typedef uint64_t cycles_t;