pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

coreclr-git: Handle NetBSD specific pthread_setschedparam(3)



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Sat Feb 20 15:48:16 2016 +0100
Changeset:	822ba66d0491efc4470402b3c988ae859fd00410

Modified Files:
	coreclr-git/distinfo
Added Files:
	coreclr-git/patches/patch-src_pal_src_config.h.in
	coreclr-git/patches/patch-src_pal_src_configure.cmake
	coreclr-git/patches/patch-src_pal_src_thread_thread.cpp

Log Message:
coreclr-git: Handle NetBSD specific pthread_setschedparam(3)

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=822ba66d0491efc4470402b3c988ae859fd00410

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 coreclr-git/distinfo                               |  3 ++
 coreclr-git/patches/patch-src_pal_src_config.h.in  | 12 +++++++
 .../patches/patch-src_pal_src_configure.cmake      | 37 ++++++++++++++++++++++
 .../patches/patch-src_pal_src_thread_thread.cpp    | 31 ++++++++++++++++++
 4 files changed, 83 insertions(+)

diffs:
diff --git a/coreclr-git/distinfo b/coreclr-git/distinfo
index 620d25a..15adf16 100644
--- a/coreclr-git/distinfo
+++ b/coreclr-git/distinfo
@@ -2,6 +2,9 @@ $NetBSD$
 
 SHA1 (patch-src_debug_debug-pal_CMakeLists.txt) = 01708a12e46df84f9bf3005f6e4fd7b7e5a11004
 SHA1 (patch-src_pal_inc_pal.h) = 7d3ef148af8b1b24067ba4cb5efc12581ebc6881
+SHA1 (patch-src_pal_src_config.h.in) = caffbb0ded11239c5cbac01d81635a3280ff497d
+SHA1 (patch-src_pal_src_configure.cmake) = fa8d7c94a0d37af694de245717c7e45227dbecbb
 SHA1 (patch-src_pal_src_cruntime_printf.cpp) = 8a86c57e1fe3953d158e1860f04bd19d7df1fe08
 SHA1 (patch-src_pal_src_cruntime_printfcpp.cpp) = 4d1ba5fea45402259c67428506f39d9c3128ecbd
 SHA1 (patch-src_pal_src_cruntime_silent__printf.cpp) = 0922321ad05a90cc3b87b1e2663ff4d0b2e4717e
+SHA1 (patch-src_pal_src_thread_thread.cpp) = d8fa1339933446dd7d5640e6ea73a0e60cfdd82a
diff --git a/coreclr-git/patches/patch-src_pal_src_config.h.in b/coreclr-git/patches/patch-src_pal_src_config.h.in
new file mode 100644
index 0000000..393661c
--- /dev/null
+++ b/coreclr-git/patches/patch-src_pal_src_config.h.in
@@ -0,0 +1,12 @@
+$NetBSD$
+
+--- src/pal/src/config.h.in.orig	2016-02-13 00:18:27.000000000 +0000
++++ src/pal/src/config.h.in
+@@ -130,6 +130,7 @@
+ #cmakedefine01 UNWIND_CONTEXT_IS_UCONTEXT_T
+ #cmakedefine BSD_REGS_STYLE(reg, RR, rr) @BSD_REGS_STYLE@
+ #cmakedefine FREEBSD_LIBC "@FREEBSD_LIBC@"
++#cmakedefine01 HAVE_SCHED_OTHER_ASSIGNABLE
+ 
+ #define CHECK_TRACE_SPECIFIERS 0
+ #define PROCFS_MEM_NAME ""
diff --git a/coreclr-git/patches/patch-src_pal_src_configure.cmake b/coreclr-git/patches/patch-src_pal_src_configure.cmake
new file mode 100644
index 0000000..fe81492
--- /dev/null
+++ b/coreclr-git/patches/patch-src_pal_src_configure.cmake
@@ -0,0 +1,37 @@
+$NetBSD$
+
+--- src/pal/src/configure.cmake.orig	2016-02-15 22:52:17.000000000 +0000
++++ src/pal/src/configure.cmake
+@@ -933,6 +933,8 @@ if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
+   set(PAL_PT_READ_D PT_READ_D)
+   set(PAL_PT_WRITE_D PT_WRITE_D)
+   set(HAS_FTRUNCATE_LENGTH_ISSUE 1)
++  set(HAVE_SCHED_OTHER_ASSIGNABLE 1)
++
+ elseif(CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
+   if(NOT HAVE_LIBUNWIND_H)
+     unset(HAVE_LIBUNWIND_H CACHE)
+@@ -950,6 +952,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL FreeBS
+   set(PAL_PT_WRITE_D PT_WRITE_D)
+   set(HAS_FTRUNCATE_LENGTH_ISSUE 0)
+   set(BSD_REGS_STYLE "((reg).r_##rr)")
++  set(HAVE_SCHED_OTHER_ASSIGNABLE 1)
+ 
+   if(EXISTS "/lib/libc.so.7")
+     set(FREEBSD_LIBC "/lib/libc.so.7")
+@@ -974,6 +977,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL NetBSD
+   set(PAL_PT_WRITE_D PT_WRITE_D)
+   set(HAS_FTRUNCATE_LENGTH_ISSUE 0)
+   set(BSD_REGS_STYLE "((reg).regs[_REG_##RR])")
++  set(HAVE_SCHED_OTHER_ASSIGNABLE 0)
+ 
+ elseif(CMAKE_SYSTEM_NAME STREQUAL SunOS)
+   if(NOT HAVE_LIBUNWIND_H)
+@@ -1011,6 +1015,7 @@ else() # Anything else is Linux
+   set(PAL_PT_READ_D PTRACE_PEEKDATA)
+   set(PAL_PT_WRITE_D PTRACE_POKEDATA)
+   set(HAS_FTRUNCATE_LENGTH_ISSUE 0)
++  set(HAVE_SCHED_OTHER_ASSIGNABLE 1)
+ endif(CMAKE_SYSTEM_NAME STREQUAL Darwin)
+ 
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
diff --git a/coreclr-git/patches/patch-src_pal_src_thread_thread.cpp b/coreclr-git/patches/patch-src_pal_src_thread_thread.cpp
new file mode 100644
index 0000000..bb4bddb
--- /dev/null
+++ b/coreclr-git/patches/patch-src_pal_src_thread_thread.cpp
@@ -0,0 +1,31 @@
+$NetBSD$
+
+--- src/pal/src/thread/thread.cpp.orig	2016-02-17 20:49:34.000000000 +0000
++++ src/pal/src/thread/thread.cpp
+@@ -1168,7 +1168,7 @@ CorUnix::InternalSetThreadPriority(
+     {
+         goto InternalSetThreadPriorityExit;
+     }
+-        
++
+     pTargetThread->Lock(pThread);
+ 
+     /* validate the requested priority */
+@@ -1219,6 +1219,17 @@ CorUnix::InternalSetThreadPriority(
+         goto InternalSetThreadPriorityExit;
+     }
+ 
++#if !HAVE_SCHED_OTHER_ASSIGNABLE
++    /* Defining thread priority for SCHED_OTHER is implementation defined.
++       Some platforms like NetBSD cannot reassign it as they are dynamic.
++    */
++    if (policy == SCHED_OTHER)
++    {
++        TRACE("Pthread priority levels for SCHED_OTHER cannot be reassigned on this platform\n");
++        goto InternalSetThreadPriorityExit;
++    }
++#endif
++
+ #if HAVE_SCHED_GET_PRIORITY
+     max_priority = sched_get_priority_max(policy);
+     min_priority = sched_get_priority_min(policy);


Home | Main Index | Thread Index | Old Index