[Asterisk-code-review] main: Enable rdtsc support on NetBSD (asterisk[16])

Kevin Harwell asteriskteam at digium.com
Wed Jan 19 16:25:40 CST 2022


Kevin Harwell has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/17903 )

Change subject: main: Enable rdtsc support on NetBSD
......................................................................

main: Enable rdtsc support on NetBSD

Enable the Linux rdtsc implementation on NetBSD as well.  The assembly
works correctly there.

ASTERISK-29851

Change-Id: I460ad9b4d971913420ecb84186f5ba5ab03f6f37
---
M main/asterisk.c
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Sean Bright: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved
  Kevin Harwell: Approved for Submit



diff --git a/main/asterisk.c b/main/asterisk.c
index 1e37783..b9bb3e2 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -807,10 +807,10 @@
 /* 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)
 {

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/17903
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I460ad9b4d971913420ecb84186f5ba5ab03f6f37
Gerrit-Change-Number: 17903
Gerrit-PatchSet: 2
Gerrit-Owner: Sean Bright <sean at seanbright.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Sean Bright <sean at seanbright.com>
Gerrit-CC: Michał Górny <mgorny at NetBSD.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220119/79b47324/attachment.html>


More information about the asterisk-code-review mailing list