From f22bfe6a55dc6b52ab5c6de46e12b81926f5c227 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Mon, 2 Jul 2012 02:49:12 +0200 Subject: [PATCH 1/4] Set the tests for hurd similar to linux --- ctest.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ctest.c b/ctest.c index 9fc0b0c40..d12e7be99 100644 --- a/ctest.c +++ b/ctest.c @@ -70,6 +70,11 @@ OS_CYGWIN_NT OS_INTERIX #endif +#if defined(__gnu_hurd__) +/* Hurd is very similar to GNU/Linux, it should work out of the box */ +OS_LINUX +#endif + #if defined(__i386) || defined(_X86) ARCH_X86 #endif From 5719b7a58d25c302a9190d5f936be7dae97851d5 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Mon, 2 Jul 2012 02:50:02 +0200 Subject: [PATCH 2/4] if SYS_gettid doesn't exist (like under HURD), use getpid() instead --- common_linux.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/common_linux.h b/common_linux.h index b0381d991..6766ff37c 100644 --- a/common_linux.h +++ b/common_linux.h @@ -86,7 +86,13 @@ static inline int my_set_mempolicy(int mode, const unsigned long *addr, unsigned return syscall(SYS_set_mempolicy, mode, addr, flag); } -static inline int my_gettid(void) { return syscall(SYS_gettid); } +static inline int my_gettid(void) { +#ifdef SYS_gettid +return syscall(SYS_gettid); +#else +return getpid(); +#endif +} #endif #endif From 4b7677a9165f2417c602152ea9fa5dfe87c21685 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Mon, 2 Jul 2012 02:50:41 +0200 Subject: [PATCH 3/4] When dealing with the kfreebsd kernel, set the same behavior as FreeBSD --- ctest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ctest.c b/ctest.c index d12e7be99..95a5e8bb2 100644 --- a/ctest.c +++ b/ctest.c @@ -34,7 +34,7 @@ COMPILER_GNU OS_LINUX #endif -#if defined(__FreeBSD__) +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) OS_FREEBSD #endif From 3692b4d631cc34de62ad17dd0519d8332d6231a3 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Mon, 2 Jul 2012 02:51:38 +0200 Subject: [PATCH 4/4] Improve the detection of sparc --- driver/others/memory.c | 2 +- param.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/driver/others/memory.c b/driver/others/memory.c index 9b8863f39..af9b54eff 100644 --- a/driver/others/memory.c +++ b/driver/others/memory.c @@ -1128,7 +1128,7 @@ static BLASULONG init_lock = 0UL; static void _touch_memory(blas_arg_t *arg, BLASLONG *range_m, BLASLONG *range_n, void *sa, void *sb, BLASLONG pos) { -#ifndef ARCH_POWER +#if !defined(ARCH_POWER) && !defined(ARCH_SPARC) long size; BLASULONG buffer; diff --git a/param.h b/param.h index 5465c1cbd..c6cd354be 100644 --- a/param.h +++ b/param.h @@ -1482,7 +1482,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define GEMM_THREAD gemm_thread_mn #endif -#if defined(SPARC) && defined(V9) +#if (defined(SPARC) && defined(V9)) || defined(__sparc_v9__) #define SNUMOPT 2 #define DNUMOPT 2