[Openmp-commits] [openmp] r346310 - Add Hurd support.
Andrey Churbanov via Openmp-commits
openmp-commits at lists.llvm.org
Wed Nov 7 04:27:38 PST 2018
Author: achurbanov
Date: Wed Nov 7 04:27:38 2018
New Revision: 346310
URL: http://llvm.org/viewvc/llvm-project?rev=346310&view=rev
Log:
Add Hurd support.
Patch by samuel.thibault at ens-lyon.org
Differential Revision: https://reviews.llvm.org/D54079
Modified:
openmp/trunk/runtime/src/kmp.h
openmp/trunk/runtime/src/kmp_ftn_entry.h
openmp/trunk/runtime/src/kmp_platform.h
openmp/trunk/runtime/src/kmp_runtime.cpp
openmp/trunk/runtime/src/thirdparty/ittnotify/ittnotify_static.c
openmp/trunk/runtime/src/z_Linux_util.cpp
Modified: openmp/trunk/runtime/src/kmp.h
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp.h?rev=346310&r1=346309&r2=346310&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp.h (original)
+++ openmp/trunk/runtime/src/kmp.h Wed Nov 7 04:27:38 2018
@@ -1050,6 +1050,10 @@ extern kmp_uint64 __kmp_now_nsec();
/* TODO: tune for KMP_OS_NETBSD */
#define KMP_INIT_WAIT 1024U /* initial number of spin-tests */
#define KMP_NEXT_WAIT 512U /* susequent number of spin-tests */
+#elif KMP_OS_HURD
+/* 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 */
#endif
#if KMP_ARCH_X86 || KMP_ARCH_X86_64
Modified: openmp/trunk/runtime/src/kmp_ftn_entry.h
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_ftn_entry.h?rev=346310&r1=346309&r2=346310&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_ftn_entry.h (original)
+++ openmp/trunk/runtime/src/kmp_ftn_entry.h Wed Nov 7 04:27:38 2018
@@ -397,7 +397,7 @@ int FTN_STDCALL KMP_EXPAND_NAME(FTN_GET_
#else
int gtid;
-#if KMP_OS_DARWIN || KMP_OS_FREEBSD || KMP_OS_NETBSD
+#if KMP_OS_DARWIN || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_HURD
gtid = __kmp_entry_gtid();
#elif KMP_OS_WINDOWS
if (!__kmp_init_parallel ||
Modified: openmp/trunk/runtime/src/kmp_platform.h
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_platform.h?rev=346310&r1=346309&r2=346310&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_platform.h (original)
+++ openmp/trunk/runtime/src/kmp_platform.h Wed Nov 7 04:27:38 2018
@@ -22,6 +22,7 @@
#define KMP_OS_DARWIN 0
#define KMP_OS_WINDOWS 0
#define KMP_OS_CNK 0
+#define KMP_OS_HURD 0
#define KMP_OS_UNIX 0 /* disjunction of KMP_OS_LINUX, KMP_OS_DARWIN etc. */
#ifdef _WIN32
@@ -59,13 +60,18 @@
#define KMP_OS_CNK 1
#endif
+#if (defined __GNU__)
+#undef KMP_OS_HURD
+#define KMP_OS_HURD 1
+#endif
+
#if (1 != \
KMP_OS_LINUX + KMP_OS_FREEBSD + KMP_OS_NETBSD + KMP_OS_DARWIN + \
- KMP_OS_WINDOWS)
+ KMP_OS_WINDOWS + KMP_OS_HURD)
#error Unknown OS
#endif
-#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_DARWIN
+#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_DARWIN || KMP_OS_HURD
#undef KMP_OS_UNIX
#define KMP_OS_UNIX 1
#endif
Modified: openmp/trunk/runtime/src/kmp_runtime.cpp
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_runtime.cpp?rev=346310&r1=346309&r2=346310&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_runtime.cpp (original)
+++ openmp/trunk/runtime/src/kmp_runtime.cpp Wed Nov 7 04:27:38 2018
@@ -7668,7 +7668,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_DARWIN || KMP_OS_HURD
int teamsize_cutoff = 4;
@@ -7696,7 +7696,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
+#if KMP_OS_LINUX || KMP_OS_WINDOWS || KMP_OS_HURD
// basic tuning
Modified: openmp/trunk/runtime/src/thirdparty/ittnotify/ittnotify_static.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/thirdparty/ittnotify/ittnotify_static.c?rev=346310&r1=346309&r2=346310&view=diff
==============================================================================
--- openmp/trunk/runtime/src/thirdparty/ittnotify/ittnotify_static.c (original)
+++ openmp/trunk/runtime/src/thirdparty/ittnotify/ittnotify_static.c Wed Nov 7 04:27:38 2018
@@ -78,6 +78,10 @@ static const char* ittnotify_lib_name =
#endif
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+
#ifndef LIB_VAR_NAME
#if ITT_ARCH==ITT_ARCH_IA32 || ITT_ARCH==ITT_ARCH_ARM || ITT_ARCH==ITT_ARCH_MIPS
Modified: openmp/trunk/runtime/src/z_Linux_util.cpp
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/z_Linux_util.cpp?rev=346310&r1=346309&r2=346310&view=diff
==============================================================================
--- openmp/trunk/runtime/src/z_Linux_util.cpp (original)
+++ openmp/trunk/runtime/src/z_Linux_util.cpp Wed Nov 7 04:27:38 2018
@@ -444,8 +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
- /* Linux* OS only -- no pthread_getattr_np support on OS X* */
+#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_HURD
pthread_attr_t attr;
int status;
size_t size = 0;
@@ -497,7 +496,7 @@ static void *__kmp_launch_worker(void *t
sigset_t new_set, old_set;
#endif /* KMP_BLOCK_SIGNALS */
void *exit_val;
-#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD
+#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_HURD
void *volatile padding = 0;
#endif
int gtid;
@@ -1765,7 +1764,7 @@ static int __kmp_get_xproc(void) {
int r = 0;
-#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD
+#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_HURD
r = sysconf(_SC_NPROCESSORS_ONLN);
@@ -1953,9 +1952,9 @@ int __kmp_is_address_mapped(void *addr)
int found = 0;
int rc;
-#if KMP_OS_LINUX || KMP_OS_FREEBSD
+#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_HURD
- /* On Linux* OS, read the /proc/<pid>/maps pseudo-file to get all the address
+ /* On GNUish OSes, read the /proc/<pid>/maps pseudo-file to get all the address
ranges mapped into the address space. */
char *name = __kmp_str_format("/proc/%d/maps", getpid());
More information about the Openmp-commits
mailing list