hppa
authorAlastair McKinstry <mckinstry@debian.org>
Mon, 12 Sep 2016 06:54:45 +0000 (06:54 +0000)
committerAlastair McKinstry <mckinstry@debian.org>
Mon, 12 Sep 2016 06:54:45 +0000 (06:54 +0000)
Gbp-Pq: Name hppa.patch

config/opal_config_asm.m4
opal/include/opal/sys/architecture.h
opal/include/opal/sys/atomic.h
opal/include/opal/sys/hppa/Makefile.am [new file with mode: 0644]
opal/include/opal/sys/hppa/atomic.h [new file with mode: 0644]
opal/include/opal/sys/hppa/timer.h [new file with mode: 0644]
opal/include/opal/sys/timer.h
opal/mca/timer/linux/configure.m4

index 34fba986b2ba62f12725522d789a99bb04e0c754..51ba503083d8597ea9f59fe9b7634f2b71077c46 100644 (file)
@@ -952,6 +952,12 @@ AC_DEFUN([OPAL_CONFIG_ASM],[
             OPAL_GCC_INLINE_ASSIGN='"mov %0, #0" : "=&r"(ret)'
             ;;
 
+        hppa*)
+            opal_cv_asm_arch="HPPA"
+            OPAL_ASM_SUPPORT_64BIT=0
+            OPAL_GCC_INLINE_ASSIGN='"copy 0,%0" : "=&r"(ret)'
+            ;;
+
         mips-*|mipsel-*)
            opal_cv_asm_arch="MIPS"
            OPAL_ASM_SUPPORT_64BIT=0
index ead36e64f9ba75c75eb41490287c6a4de743bb6b..4d221ed67f1105a5fa7fc9a18b2301cde7bb3a13 100644 (file)
@@ -30,6 +30,7 @@
 #define OPAL_IA32           0010
 #define OPAL_IA64           0020
 #define OPAL_AMD64          0030
+#define OPAL_HPPA           0110
 #define OPAL_POWERPC32      0050
 #define OPAL_POWERPC64      0051
 #define OPAL_SPARC          0060
index 3c2745cbccb638d857040ec6ca7c002cffb07d74..f6494ca4b463e94b8ca233ae94a6fb97bd69b736 100644 (file)
@@ -153,6 +153,8 @@ typedef struct opal_atomic_lock_t opal_atomic_lock_t;
 #include "opal/sys/ia32/atomic.h"
 #elif OPAL_ASSEMBLY_ARCH == OPAL_IA64
 #include "opal/sys/ia64/atomic.h"
+#elif OPAL_ASSEMBLY_ARCH == OPAL_HPPA
+#include "opal/sys/hppa/atomic.h"
 #elif OPAL_ASSEMBLY_ARCH == OPAL_MIPS
 #include "opal/sys/mips/atomic.h"
 #elif OPAL_ASSEMBLY_ARCH == OPAL_POWERPC32
diff --git a/opal/include/opal/sys/hppa/Makefile.am b/opal/include/opal/sys/hppa/Makefile.am
new file mode 100644 (file)
index 0000000..3154816
--- /dev/null
@@ -0,0 +1,23 @@
+#
+# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
+#                         University Research and Technology
+#                         Corporation.  All rights reserved.
+# Copyright (c) 2004-2005 The University of Tennessee and The University
+#                         of Tennessee Research Foundation.  All rights
+#                         reserved.
+# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
+#                         University of Stuttgart.  All rights reserved.
+# Copyright (c) 2004-2005 The Regents of the University of California.
+#                         All rights reserved.
+# $COPYRIGHT$
+#
+# Additional copyrights may follow
+#
+# $HEADER$
+#
+
+# This makefile.am does not stand on its own - it is included from opal/include/Makefile.am
+
+headers += \
+       opal/sys/hppa/atomic.h \
+       opal/sys/hppa/timer.h
diff --git a/opal/include/opal/sys/hppa/atomic.h b/opal/include/opal/sys/hppa/atomic.h
new file mode 100644 (file)
index 0000000..3862618
--- /dev/null
@@ -0,0 +1,95 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
+ *                         University Research and Technology
+ *                         Corporation.  All rights reserved.
+ * Copyright (c) 2004-2013 The University of Tennessee and The University
+ *                         of Tennessee Research Foundation.  All rights
+ *                         reserved.
+ * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, 
+ *                         University of Stuttgart.  All rights reserved.
+ * Copyright (c) 2004-2005 The Regents of the University of California.
+ *                         All rights reserved.
+ * Copyright (c) 2011      Sandia National Laboratories. All rights reserved.
+ * Copyright (c) 2014      Los Alamos National Security, LLC. All rights
+ *                         reserved.
+ * $COPYRIGHT$
+ * 
+ * Additional copyrights may follow
+ * 
+ * $HEADER$
+ */
+
+#ifndef OPAL_SYS_ARCH_ATOMIC_H
+#define OPAL_SYS_ARCH_ATOMIC_H 1
+
+/**********************************************************************
+ *
+ * Memory Barriers
+ *
+ *********************************************************************/
+#define OPAL_HAVE_ATOMIC_MEM_BARRIER 1
+
+static inline void opal_atomic_mb(void)
+{
+    __sync_synchronize();
+}
+
+static inline void opal_atomic_rmb(void)
+{
+    __sync_synchronize();
+}
+
+static inline void opal_atomic_wmb(void)
+{
+    __sync_synchronize();
+}
+
+#if OPAL_WANT_SMP_LOCKS
+#define MB() opal_atomic_mb()
+#else
+#define MB()
+#endif
+
+/**********************************************************************
+ *
+ * Atomic math operations
+ *
+ *********************************************************************/
+
+#define OPAL_HAVE_ATOMIC_CMPSET_32 1
+static inline int opal_atomic_cmpset_acq_32( volatile int32_t *addr,
+                                             int32_t oldval, int32_t newval)
+{
+    return __sync_bool_compare_and_swap(addr, oldval, newval);
+}
+
+
+static inline int opal_atomic_cmpset_rel_32( volatile int32_t *addr,
+                                             int32_t oldval, int32_t newval)
+{
+    return __sync_bool_compare_and_swap(addr, oldval, newval);}
+
+static inline int opal_atomic_cmpset_32( volatile int32_t *addr,
+                                         int32_t oldval, int32_t newval)
+{
+    return __sync_bool_compare_and_swap(addr, oldval, newval);
+}
+
+#define OPAL_HAVE_ATOMIC_MATH_32 1
+
+#define OPAL_HAVE_ATOMIC_ADD_32 1
+static inline int32_t opal_atomic_add_32(volatile int32_t *addr, int32_t delta)
+{
+    return __sync_add_and_fetch(addr, delta);
+}
+
+#define OPAL_HAVE_ATOMIC_SUB_32 1
+static inline int32_t opal_atomic_sub_32(volatile int32_t *addr, int32_t delta)
+{
+    return __sync_sub_and_fetch(addr, delta);
+}
+
+#define OPAL_HAVE_ATOMIC_CMPSET_64 0
+
+#endif /* ! OPAL_SYS_ARCH_ATOMIC_H */
diff --git a/opal/include/opal/sys/hppa/timer.h b/opal/include/opal/sys/hppa/timer.h
new file mode 100644 (file)
index 0000000..6e3eb94
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
+ *                         University Research and Technology
+ *                         Corporation.  All rights reserved.
+ * Copyright (c) 2004-2005 The University of Tennessee and The University
+ *                         of Tennessee Research Foundation.  All rights
+ *                         reserved.
+ * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, 
+ *                         University of Stuttgart.  All rights reserved.
+ * Copyright (c) 2004-2005 The Regents of the University of California.
+ *                         All rights reserved.
+ * $COPYRIGHT$
+ * 
+ * Additional copyrights may follow
+ * 
+ * $HEADER$
+ */
+
+#ifndef OPAL_SYS_ARCH_TIMER_H
+#define OPAL_SYS_ARCH_TIMER_H 1
+
+
+typedef uint64_t opal_timer_t;
+
+static inline opal_timer_t
+opal_sys_timer_get_cycles(void)
+{
+    return 0;
+}
+
+#define OPAL_HAVE_SYS_TIMER_GET_CYCLES 0
+
+#endif /* ! OPAL_SYS_ARCH_TIMER_H */
index 3d9587ced50f7176ea1b8f78b7e3e558ae1479b8..cbbba3eea30ca3679cd0df035763da5b006dfc9b 100644 (file)
@@ -100,6 +100,8 @@ BEGIN_C_DECLS
 #include "opal/sys/sparcv9/timer.h"
 #elif OPAL_ASSEMBLY_ARCH == OPAL_MIPS
 #include "opal/sys/mips/timer.h"
+#elif OPAL_ASSEMBLY_ARCH == OPAL_HPPA
+#include "opal/sys/hppa/timer.h"
 #endif
 
 #ifndef DOXYGEN
index 77557721dbcb8913eba01369846b11270be54dd9..43ea690c530989e50774a8a18ac285ecd2a044b0 100644 (file)
@@ -46,7 +46,7 @@ AC_DEFUN([MCA_opal_timer_linux_CONFIG],[
                  [timer_linux_happy="no"])])
 
    case "${host}" in
-   i?86-*linux*|x86_64*linux*|ia64-*linux*|powerpc-*linux*|powerpc64-*linux*|sparc*-*linux*)
+   i?86-*linux*|x86_64*linux*|ia64-*linux*|powerpc-*linux*|powerpc64-*linux*|sparc*-*linux*|arm*-*linux*|hppa*-*linux*)
         AS_IF([test "$timer_linux_happy" = "yes"],
               [AS_IF([test -r "/proc/cpuinfo"],
                      [timer_linux_happy="yes"],