kfreebsd-openmp
authorLLVM Packaging Team <pkg-llvm-team@lists.alioth.debian.org>
Mon, 30 Dec 2019 14:31:05 +0000 (14:31 +0000)
committerPeter Michael Green <plugwash@raspbian.org>
Mon, 30 Dec 2019 14:31:05 +0000 (14:31 +0000)
===================================================================

Gbp-Pq: Topic kfreebsd
Gbp-Pq: Name kfreebsd-openmp.diff

openmp/runtime/src/kmp.h
openmp/runtime/src/kmp_ftn_entry.h
openmp/runtime/src/kmp_platform.h
openmp/runtime/src/kmp_runtime.cpp
openmp/runtime/src/z_Linux_util.cpp

index 4fa5d2102c7a457a95e47a5f8ea21624d3e92f99..f438b383adcb19e0b67158746d856a91b261050d 100644 (file)
@@ -1052,6 +1052,10 @@ extern kmp_uint64 __kmp_now_nsec();
 /* TODO: tune for KMP_OS_HURD */
 #define KMP_INIT_WAIT 1024U /* initial number of spin-tests   */
 #define KMP_NEXT_WAIT 512U /* susequent number of spin-tests */
+#elif KMP_OS_KFREEBSD
+/* TODO: tune for KMP_OS_KFREEBSD */
+#define KMP_INIT_WAIT 1024U /* initial number of spin-tests   */
+#define KMP_NEXT_WAIT 512U /* susequent number of spin-tests */
 #endif
 
 #if KMP_ARCH_X86 || KMP_ARCH_X86_64
index 4486a8d7c1882e8d83b7562505a7c58a302ace38..1edb23bbd070252621e0e8e9d4f9d31f2c080598 100644 (file)
@@ -369,7 +369,7 @@ int FTN_STDCALL KMP_EXPAND_NAME(FTN_GET_THREAD_NUM)(void) {
 #else
   int gtid;
 
-#if KMP_OS_DARWIN || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_HURD
+#if KMP_OS_DARWIN || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_HURD || KMP_OS_KFREEBSD
   gtid = __kmp_entry_gtid();
 #elif KMP_OS_WINDOWS
   if (!__kmp_init_parallel ||
index 761048413ad6b3853a56940c8e48e0252c0a0eb3..b981910829d4be6b758a5d3645e587657ce2dc58 100644 (file)
@@ -18,6 +18,7 @@
 
 #define KMP_OS_LINUX 0
 #define KMP_OS_FREEBSD 0
+#define KMP_OS_KFREEBSD 0
 #define KMP_OS_NETBSD 0
 #define KMP_OS_DARWIN 0
 #define KMP_OS_WINDOWS 0
 #define KMP_OS_FREEBSD 1
 #endif
 
+#if (defined __FreeBSD_kernel__)
+#undef KMP_OS_KFREEBSD
+#define KMP_OS_KFREEBSD 1
+#endif
+
 #if (defined __NetBSD__)
 #undef KMP_OS_NETBSD
 #define KMP_OS_NETBSD 1
 
 #if (1 !=                                                                      \
      KMP_OS_LINUX + KMP_OS_FREEBSD + KMP_OS_NETBSD + KMP_OS_DARWIN +           \
-         KMP_OS_WINDOWS + KMP_OS_HURD)
+         KMP_OS_WINDOWS + KMP_OS_HURD + KMP_OS_KFREEBSD)
 #error Unknown OS
 #endif
 
-#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_DARWIN || KMP_OS_HURD
+#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_KFREEBSD || KMP_OS_NETBSD || KMP_OS_DARWIN || KMP_OS_HURD
 #undef KMP_OS_UNIX
 #define KMP_OS_UNIX 1
 #endif
index e9de18c1517b4b854d7a6cbed0db81dd8f1cef2f..b350cb0c74bf4f4486ea938b77f48b5493e7d336 100644 (file)
@@ -7643,7 +7643,7 @@ __kmp_determine_reduction_method(
 #if KMP_ARCH_X86_64 || KMP_ARCH_PPC64 || KMP_ARCH_AARCH64 || KMP_ARCH_MIPS64
 
 #if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_WINDOWS ||       \
-    KMP_OS_DARWIN || KMP_OS_HURD
+    KMP_OS_DARWIN || KMP_OS_HURD || KMP_OS_KFREEBSD
 
     int teamsize_cutoff = 4;
 
@@ -7670,7 +7670,7 @@ __kmp_determine_reduction_method(
 
 #elif KMP_ARCH_X86 || KMP_ARCH_ARM || KMP_ARCH_AARCH || KMP_ARCH_MIPS
 
-#if KMP_OS_LINUX || KMP_OS_WINDOWS || KMP_OS_HURD
+#if KMP_OS_LINUX || KMP_OS_WINDOWS || KMP_OS_HURD || KMP_OS_KFREEBSD
 
     // basic tuning
 
index 27a107123a53b20f8c3aa4fcdd4491af818e8fe0..f0e8516bbe9087e0a9abdf6f7be942278e775e84 100644 (file)
@@ -444,7 +444,7 @@ void __kmp_terminate_thread(int gtid) {
    determined exactly, FALSE if incremental refinement is necessary. */
 static kmp_int32 __kmp_set_stack_info(int gtid, kmp_info_t *th) {
   int stack_data;
-#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_HURD
+#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_HURD || KMP_OS_KFREEBSD
   pthread_attr_t attr;
   int status;
   size_t size = 0;
@@ -496,7 +496,7 @@ static void *__kmp_launch_worker(void *thr) {
   sigset_t new_set, old_set;
 #endif /* KMP_BLOCK_SIGNALS */
   void *exit_val;
-#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_HURD
+#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_HURD || KMP_OS_KFREEBSD
   void *volatile padding = 0;
 #endif
   int gtid;
@@ -1764,7 +1764,7 @@ static int __kmp_get_xproc(void) {
 
   int r = 0;
 
-#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_HURD
+#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_HURD || KMP_OS_KFREEBSD
 
   r = sysconf(_SC_NPROCESSORS_ONLN);
 
@@ -1952,7 +1952,7 @@ int __kmp_is_address_mapped(void *addr) {
   int found = 0;
   int rc;
 
-#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_HURD
+#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_HURD || KMP_OS_KFREEBSD
 
   /* On GNUish OSes, read the /proc/<pid>/maps pseudo-file to get all the address
      ranges mapped into the address space. */