mirror of
https://git.proxmox.com/git/llvm-toolchain
synced 2025-06-14 20:00:43 +00:00
130 lines
5.2 KiB
Diff
130 lines
5.2 KiB
Diff
Index: llvm-toolchain-snapshot_9~svn359759/openmp/runtime/src/kmp.h
|
|
===================================================================
|
|
--- llvm-toolchain-snapshot_9~svn359759.orig/openmp/runtime/src/kmp.h
|
|
+++ llvm-toolchain-snapshot_9~svn359759/openmp/runtime/src/kmp.h
|
|
@@ -1177,6 +1177,10 @@ extern kmp_uint64 __kmp_now_nsec();
|
|
/* TODO: tune for KMP_OS_OPENBSD */
|
|
#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: llvm-toolchain-snapshot_9~svn359759/openmp/runtime/src/kmp_ftn_entry.h
|
|
===================================================================
|
|
--- llvm-toolchain-snapshot_9~svn359759.orig/openmp/runtime/src/kmp_ftn_entry.h
|
|
+++ llvm-toolchain-snapshot_9~svn359759/openmp/runtime/src/kmp_ftn_entry.h
|
|
@@ -535,7 +535,7 @@ int FTN_STDCALL KMP_EXPAND_NAME(FTN_GET_
|
|
int gtid;
|
|
|
|
#if KMP_OS_DARWIN || KMP_OS_DRAGONFLY || KMP_OS_FREEBSD || KMP_OS_NETBSD || \
|
|
- KMP_OS_HURD
|
|
+ KMP_OS_HURD || KMP_OS_KFREEBSD
|
|
gtid = __kmp_entry_gtid();
|
|
#elif KMP_OS_WINDOWS
|
|
if (!__kmp_init_parallel ||
|
|
Index: llvm-toolchain-snapshot_9~svn359759/openmp/runtime/src/kmp_platform.h
|
|
===================================================================
|
|
--- llvm-toolchain-snapshot_9~svn359759.orig/openmp/runtime/src/kmp_platform.h
|
|
+++ llvm-toolchain-snapshot_9~svn359759/openmp/runtime/src/kmp_platform.h
|
|
@@ -18,6 +18,7 @@
|
|
#define KMP_OS_LINUX 0
|
|
#define KMP_OS_DRAGONFLY 0
|
|
#define KMP_OS_FREEBSD 0
|
|
+#define KMP_OS_KFREEBSD 0
|
|
#define KMP_OS_NETBSD 0
|
|
#define KMP_OS_OPENBSD 0
|
|
#define KMP_OS_DARWIN 0
|
|
@@ -56,6 +57,11 @@
|
|
#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
|
|
@@ -78,12 +84,12 @@
|
|
|
|
#if (1 != \
|
|
KMP_OS_LINUX + KMP_OS_DRAGONFLY + KMP_OS_FREEBSD + KMP_OS_NETBSD + \
|
|
- KMP_OS_OPENBSD + KMP_OS_DARWIN + KMP_OS_WINDOWS + KMP_OS_HURD)
|
|
+ KMP_OS_OPENBSD + KMP_OS_DARWIN + KMP_OS_WINDOWS + KMP_OS_HURD + KMP_OS_KFREEBSD)
|
|
#error Unknown OS
|
|
#endif
|
|
|
|
#if KMP_OS_LINUX || KMP_OS_DRAGONFLY || KMP_OS_FREEBSD || KMP_OS_NETBSD || \
|
|
- KMP_OS_OPENBSD || KMP_OS_DARWIN || KMP_OS_HURD
|
|
+ KMP_OS_OPENBSD || KMP_OS_DARWIN || KMP_OS_HURD || KMP_OS_KFREEBSD
|
|
#undef KMP_OS_UNIX
|
|
#define KMP_OS_UNIX 1
|
|
#endif
|
|
Index: llvm-toolchain-snapshot_9~svn359759/openmp/runtime/src/kmp_runtime.cpp
|
|
===================================================================
|
|
--- llvm-toolchain-snapshot_9~svn359759.orig/openmp/runtime/src/kmp_runtime.cpp
|
|
+++ llvm-toolchain-snapshot_9~svn359759/openmp/runtime/src/kmp_runtime.cpp
|
|
@@ -8228,7 +8228,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_DRAGONFLY || KMP_OS_FREEBSD || KMP_OS_NETBSD || \
|
|
- KMP_OS_OPENBSD || KMP_OS_WINDOWS || KMP_OS_DARWIN || KMP_OS_HURD
|
|
+ KMP_OS_OPENBSD || KMP_OS_WINDOWS || KMP_OS_DARWIN || KMP_OS_HURD || KMP_OS_KFREEBSD
|
|
|
|
int teamsize_cutoff = 4;
|
|
|
|
@@ -8256,7 +8256,7 @@ __kmp_determine_reduction_method(
|
|
|
|
#elif KMP_ARCH_X86 || KMP_ARCH_ARM || KMP_ARCH_AARCH || KMP_ARCH_MIPS
|
|
|
|
-#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_WINDOWS || KMP_OS_HURD
|
|
+#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_WINDOWS || KMP_OS_HURD || KMP_OS_KFREEBSD
|
|
|
|
// basic tuning
|
|
|
|
Index: llvm-toolchain-snapshot_9~svn359759/openmp/runtime/src/z_Linux_util.cpp
|
|
===================================================================
|
|
--- llvm-toolchain-snapshot_9~svn359759.orig/openmp/runtime/src/z_Linux_util.cpp
|
|
+++ llvm-toolchain-snapshot_9~svn359759/openmp/runtime/src/z_Linux_util.cpp
|
|
@@ -447,7 +447,7 @@ void __kmp_terminate_thread(int gtid) {
|
|
static kmp_int32 __kmp_set_stack_info(int gtid, kmp_info_t *th) {
|
|
int stack_data;
|
|
#if KMP_OS_LINUX || KMP_OS_DRAGONFLY || KMP_OS_FREEBSD || KMP_OS_NETBSD || \
|
|
- KMP_OS_HURD
|
|
+ KMP_OS_HURD || KMP_OS_KFREEBSD
|
|
pthread_attr_t attr;
|
|
int status;
|
|
size_t size = 0;
|
|
@@ -501,7 +501,7 @@ static void *__kmp_launch_worker(void *t
|
|
#endif /* KMP_BLOCK_SIGNALS */
|
|
void *exit_val;
|
|
#if KMP_OS_LINUX || KMP_OS_DRAGONFLY || KMP_OS_FREEBSD || KMP_OS_NETBSD || \
|
|
- KMP_OS_OPENBSD || KMP_OS_HURD
|
|
+ KMP_OS_OPENBSD || KMP_OS_HURD || KMP_OS_KFREEBSD
|
|
void *volatile padding = 0;
|
|
#endif
|
|
int gtid;
|
|
@@ -1758,7 +1758,7 @@ static int __kmp_get_xproc(void) {
|
|
int r = 0;
|
|
|
|
#if KMP_OS_LINUX || KMP_OS_DRAGONFLY || KMP_OS_FREEBSD || KMP_OS_NETBSD || \
|
|
- KMP_OS_OPENBSD || KMP_OS_HURD
|
|
+ KMP_OS_OPENBSD || KMP_OS_HURD || KMP_OS_KFREEBSD
|
|
|
|
r = sysconf(_SC_NPROCESSORS_ONLN);
|
|
|
|
@@ -1953,7 +1953,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. */
|