Date: Mon, 17 Jun 2019 08:36:28 +0000 (UTC) From: Jan Beich <jbeich@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r504401 - in head: audio/webrtc-audio-processing/files devel/android-tools-adb/files devel/android-tools-fastboot/files devel/android-tools-simpleperf/files multimedia/gmmlib/files mult... Message-ID: <201906170836.x5H8aS6O096301@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jbeich Date: Mon Jun 17 08:36:27 2019 New Revision: 504401 URL: https://svnweb.freebsd.org/changeset/ports/504401 Log: Switch DragonFly to pthread_getthreadid_np in my ports https://github.com/DragonFlyBSD/DragonFlyBSD/commit/c0f25c26521a Modified: head/audio/webrtc-audio-processing/files/patch-webrtc_base_platform__thread.cc (contents, props changed) head/devel/android-tools-adb/files/patch-base_logging.cpp (contents, props changed) head/devel/android-tools-adb/files/patch-libcutils_threads.cpp (contents, props changed) head/devel/android-tools-fastboot/files/patch-base_logging.cpp (contents, props changed) head/devel/android-tools-simpleperf/files/patch-base_logging.cpp (contents, props changed) head/multimedia/gmmlib/files/patch-thread-id (contents, props changed) head/multimedia/libva-intel-media-driver/files/patch-thread-id (contents, props changed) head/multimedia/libva/files/patch-va_va__trace.c (contents, props changed) Modified: head/audio/webrtc-audio-processing/files/patch-webrtc_base_platform__thread.cc ============================================================================== --- head/audio/webrtc-audio-processing/files/patch-webrtc_base_platform__thread.cc Mon Jun 17 07:56:06 2019 (r504400) +++ head/audio/webrtc-audio-processing/files/patch-webrtc_base_platform__thread.cc Mon Jun 17 08:36:27 2019 (r504401) @@ -16,13 +16,11 @@ namespace rtc { PlatformThreadId CurrentThreadId() { -@@ -32,9 +38,17 @@ PlatformThreadId CurrentThreadId() { +@@ -32,9 +38,15 @@ PlatformThreadId CurrentThreadId() { ret = syscall(__NR_gettid); #elif defined(WEBRTC_ANDROID) ret = gettid(); -+#elif defined(__DragonFly__) // WEBRTC_BSD -+ ret = lwp_gettid(); -+#elif defined(__FreeBSD__) // WEBRTC_BSD ++#elif defined(__DragonFly__) || defined(__FreeBSD__) // WEBRTC_BSD + ret = pthread_getthreadid_np(); +#elif defined(__NetBSD__) // WEBRTC_BSD + ret = _lwp_self(); Modified: head/devel/android-tools-adb/files/patch-base_logging.cpp ============================================================================== --- head/devel/android-tools-adb/files/patch-base_logging.cpp Mon Jun 17 07:56:06 2019 (r504400) +++ head/devel/android-tools-adb/files/patch-base_logging.cpp Mon Jun 17 08:36:27 2019 (r504401) @@ -18,13 +18,11 @@ #include <iostream> #include <limits> #include <sstream> -@@ -71,6 +72,14 @@ +@@ -71,6 +72,12 @@ #include <unistd.h> #elif defined(_WIN32) #include <windows.h> -+#elif defined(__DragonFly__) -+#include <unistd.h> -+#elif defined(__FreeBSD__) ++#elif defined(__DragonFly__) || defined(__FreeBSD__) +#include <pthread_np.h> +#elif defined(__NetBSD__) +#include <lwp.h> @@ -33,13 +31,11 @@ #endif #if defined(_WIN32) -@@ -88,6 +97,14 @@ static thread_id GetThreadId() { +@@ -88,6 +97,12 @@ static thread_id GetThreadId() { return syscall(__NR_gettid); #elif defined(_WIN32) return GetCurrentThreadId(); -+#elif defined(__DragonFly__) -+ return lwp_gettid(); -+#elif defined(__FreeBSD__) ++#elif defined(__DragonFly__) || defined(__FreeBSD__) + return pthread_getthreadid_np(); +#elif defined(__NetBSD__) + return _lwp_self(); Modified: head/devel/android-tools-adb/files/patch-libcutils_threads.cpp ============================================================================== --- head/devel/android-tools-adb/files/patch-libcutils_threads.cpp Mon Jun 17 07:56:06 2019 (r504400) +++ head/devel/android-tools-adb/files/patch-libcutils_threads.cpp Mon Jun 17 08:36:27 2019 (r504401) @@ -1,12 +1,10 @@ --- libcutils/threads.cpp.orig 2018-07-13 19:58:45 UTC +++ libcutils/threads.cpp -@@ -24,11 +24,19 @@ +@@ -24,11 +24,17 @@ #include <sys/syscall.h> #include <sys/time.h> #include <unistd.h> -+#elif defined(__DragonFly__) -+#include <unistd.h> -+#elif defined(__FreeBSD__) ++#elif defined(__DragonFly__) || defined(__FreeBSD__) +#include <pthread_np.h> +#elif defined(__NetBSD__) +#include <lwp.h> @@ -20,13 +18,11 @@ #endif // No definition needed for Android because we'll just pick up bionic's copy. -@@ -38,10 +46,18 @@ pid_t gettid() { +@@ -38,10 +46,16 @@ pid_t gettid() { uint64_t tid; pthread_threadid_np(NULL, &tid); return tid; -+#elif defined(__DragonFly__) -+ return lwp_gettid(); -+#elif defined(__FreeBSD__) ++#elif defined(__DragonFly__) || defined(__FreeBSD__) + return pthread_getthreadid_np(); +#elif defined(__NetBSD__) + return _lwp_self(); Modified: head/devel/android-tools-fastboot/files/patch-base_logging.cpp ============================================================================== --- head/devel/android-tools-fastboot/files/patch-base_logging.cpp Mon Jun 17 07:56:06 2019 (r504400) +++ head/devel/android-tools-fastboot/files/patch-base_logging.cpp Mon Jun 17 08:36:27 2019 (r504401) @@ -18,13 +18,11 @@ #include <iostream> #include <limits> #include <sstream> -@@ -71,6 +72,14 @@ +@@ -71,6 +72,12 @@ #include <unistd.h> #elif defined(_WIN32) #include <windows.h> -+#elif defined(__DragonFly__) -+#include <unistd.h> -+#elif defined(__FreeBSD__) ++#elif defined(__DragonFly__) || defined(__FreeBSD__) +#include <pthread_np.h> +#elif defined(__NetBSD__) +#include <lwp.h> @@ -33,13 +31,11 @@ #endif #if defined(_WIN32) -@@ -88,6 +97,14 @@ static thread_id GetThreadId() { +@@ -88,6 +97,12 @@ static thread_id GetThreadId() { return syscall(__NR_gettid); #elif defined(_WIN32) return GetCurrentThreadId(); -+#elif defined(__DragonFly__) -+ return lwp_gettid(); -+#elif defined(__FreeBSD__) ++#elif defined(__DragonFly__) || defined(__FreeBSD__) + return pthread_getthreadid_np(); +#elif defined(__NetBSD__) + return _lwp_self(); Modified: head/devel/android-tools-simpleperf/files/patch-base_logging.cpp ============================================================================== --- head/devel/android-tools-simpleperf/files/patch-base_logging.cpp Mon Jun 17 07:56:06 2019 (r504400) +++ head/devel/android-tools-simpleperf/files/patch-base_logging.cpp Mon Jun 17 08:36:27 2019 (r504401) @@ -18,13 +18,11 @@ #include <iostream> #include <limits> #include <sstream> -@@ -71,6 +72,14 @@ +@@ -71,6 +72,12 @@ #include <unistd.h> #elif defined(_WIN32) #include <windows.h> -+#elif defined(__DragonFly__) -+#include <unistd.h> -+#elif defined(__FreeBSD__) ++#elif defined(__DragonFly__) || defined(__FreeBSD__) +#include <pthread_np.h> +#elif defined(__NetBSD__) +#include <lwp.h> @@ -33,15 +31,13 @@ #endif #if defined(_WIN32) -@@ -88,6 +97,14 @@ static thread_id GetThreadId() { +@@ -88,6 +97,12 @@ static thread_id GetThreadId() { return syscall(__NR_gettid); #elif defined(_WIN32) return GetCurrentThreadId(); -+#elif defined(__DragonFly__) -+ return lwp_gettid(); +#elif defined(__NetBSD__) + return _lwp_self(); -+#elif defined(__FreeBSD__) ++#elif defined(__DragonFly__) || defined(__FreeBSD__) + return pthread_getthreadid_np(); +#else + return (intptr_t) pthread_self(); Modified: head/multimedia/gmmlib/files/patch-thread-id ============================================================================== --- head/multimedia/gmmlib/files/patch-thread-id Mon Jun 17 07:56:06 2019 (r504400) +++ head/multimedia/gmmlib/files/patch-thread-id Mon Jun 17 08:36:27 2019 (r504401) @@ -2,16 +2,14 @@ Add more BSDs and update to modern way to get thread I --- Source/GmmLib/Utility/GmmLog/spdlog/details/os.h.orig 2018-09-28 18:59:39 UTC +++ Source/GmmLib/Utility/GmmLog/spdlog/details/os.h -@@ -39,9 +39,15 @@ +@@ -39,9 +39,13 @@ #include <unistd.h> #include <chrono> -#elif __FreeBSD__ -#include <sys/thr.h> //Use thr_self() syscall under FreeBSD to get thread id -+#elif defined(__DragonFly__) -+#include <unistd.h> // for lwp_gettid -+#elif defined(__FreeBSD__) ++#elif defined(__DragonFly__) || defined(__FreeBSD__) +#include <pthread_np.h> // for pthread_getthreadid_np + +#elif defined(__NetBSD__) @@ -20,7 +18,7 @@ Add more BSDs and update to modern way to get thread I #else #include <thread> -@@ -302,10 +308,12 @@ inline size_t thread_id() +@@ -302,10 +308,10 @@ inline size_t thread_id() # define SYS_gettid __NR_gettid # endif return static_cast<size_t>(syscall(SYS_gettid)); @@ -28,9 +26,7 @@ Add more BSDs and update to modern way to get thread I - long tid; - thr_self(&tid); - return static_cast<size_t>(tid); -+#elif defined(__DragonFly__) -+ return static_cast<size_t>(lwp_gettid()); -+#elif defined(__FreeBSD__) ++#elif defined(__DragonFly__) || defined(__FreeBSD__) + return static_cast<size_t>(pthread_getthreadid_np()); +#elif defined(__NetBSD__) + return static_cast<size_t>(_lwp_self()); Modified: head/multimedia/libva-intel-media-driver/files/patch-thread-id ============================================================================== --- head/multimedia/libva-intel-media-driver/files/patch-thread-id Mon Jun 17 07:56:06 2019 (r504400) +++ head/multimedia/libva-intel-media-driver/files/patch-thread-id Mon Jun 17 08:36:27 2019 (r504401) @@ -22,7 +22,7 @@ media_driver/linux/common/cm/cm_innerdef_os.h:98:37: n +#if defined(__linux__) #include <sys/types.h> #include <sys/syscall.h> -+#elif defined(__FreeBSD__) ++#elif defined(__DragonFly__) || defined(__FreeBSD__) +#include <pthread_np.h> +#elif defined(__NetBSD__) +#include <lwp.h> @@ -32,15 +32,13 @@ media_driver/linux/common/cm/cm_innerdef_os.h:98:37: n #include <unistd.h> //Require DRM VMAP patch, -@@ -95,5 +103,15 @@ inline void GetLocalTime(PSYSTEMTIME psystime) +@@ -95,5 +103,13 @@ inline void GetLocalTime(PSYSTEMTIME psystime) #endif #define CmGetCurProcessId() getpid() +#if defined(__linux__) #define CmGetCurThreadId() syscall(SYS_gettid) -+#elif defined(__DragonFly__) -+#define CmGetCurThreadId() lwp_gettid() -+#elif defined(__FreeBSD__) ++#elif defined(__DragonFly__) || defined(__FreeBSD__) +#define CmGetCurThreadId() pthread_getthreadid_np() +#elif defined(__NetBSD__) +#define CmGetCurThreadId() _lwp_self() Modified: head/multimedia/libva/files/patch-va_va__trace.c ============================================================================== --- head/multimedia/libva/files/patch-va_va__trace.c Mon Jun 17 07:56:06 2019 (r504400) +++ head/multimedia/libva/files/patch-va_va__trace.c Mon Jun 17 08:36:27 2019 (r504401) @@ -2,7 +2,7 @@ --- va/va_trace.c.orig 2018-02-12 06:32:11 UTC +++ va/va_trace.c -@@ -48,12 +48,40 @@ +@@ -48,12 +48,36 @@ #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> @@ -14,9 +14,7 @@ +#if defined(__linux__) +#include <sys/syscall.h> -+#elif defined(__DragonFly__) -+#include <sys/lwp.h> -+#elif defined(__FreeBSD__) ++#elif defined(__DragonFly__) || defined(__FreeBSD__) +#include <pthread_np.h> +#elif defined(__NetBSD__) +#include <lwp.h> @@ -29,9 +27,7 @@ +{ +#if defined(__linux__) + return syscall(__NR_gettid); -+#elif defined(__DragonFly__) -+ return lwp_gettid(); -+#elif defined(__FreeBSD__) ++#elif defined(__DragonFly__) || defined(__FreeBSD__) + return pthread_getthreadid_np(); +#elif defined(__NetBSD__) + return _lwp_self();
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201906170836.x5H8aS6O096301>