]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
main: Enable rdtsc support on NetBSD
authorMichał Górny <mgorny@NetBSD.org>
Thu, 11 Nov 2021 04:24:38 +0000 (05:24 +0100)
committerKevin Harwell <kharwell@digium.com>
Wed, 19 Jan 2022 22:25:37 +0000 (16:25 -0600)
Enable the Linux rdtsc implementation on NetBSD as well.  The assembly
works correctly there.

ASTERISK-29851

Change-Id: I460ad9b4d971913420ecb84186f5ba5ab03f6f37

main/asterisk.c

index 1e377830522a7aaffe8c4270d5774394f3ffabda..b9bb3e220b160f18c1d434b062dae8b547deb74e 100644 (file)
@@ -807,10 +807,10 @@ int64_t ast_profile(int i, int64_t delta)
 /* The RDTSC instruction was introduced on the Pentium processor and is not
  * implemented on certain clones, like the Cyrix 586. Hence, the previous
  * expectation of __i386__ was in error. */
-#if defined ( __i686__) && (defined(__FreeBSD__) || defined(linux))
+#if defined ( __i686__) && (defined(__FreeBSD__) || defined(__NetBSD__) || defined(linux))
 #if defined(__FreeBSD__)
 #include <machine/cpufunc.h>
-#elif defined(linux)
+#elif defined(__NetBSD__) || defined(linux)
 static __inline uint64_t
 rdtsc(void)
 {