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

Friendly Automation asteriskteam at digium.com
Wed Jan 19 11:16:50 CST 2022


Friendly Automation has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/17905 )

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
  Friendly Automation: Approved for Submit



diff --git a/main/asterisk.c b/main/asterisk.c
index eaf2d7d..4520318 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -810,10 +810,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/+/17905
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 19
Gerrit-Change-Id: I460ad9b4d971913420ecb84186f5ba5ab03f6f37
Gerrit-Change-Number: 17905
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: 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/4fa0b6dd/attachment-0001.html>


More information about the asterisk-code-review mailing list