Support for the HPPA architecture
authorHelge Deller <deller@gmx.de>
Mon, 21 Aug 2023 08:51:43 +0000 (09:51 +0100)
committerAlastair McKinstry <mckinstry@debian.org>
Mon, 21 Aug 2023 08:51:43 +0000 (09:51 +0100)
Bug-Origin: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=776730
Last-Updated: 2016-09-04
Forwarded: no

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 5183c7e0828f4896e350cfb5c76b94f7b2a7d6ba..2a84d51363abc58db9afcdedbec12023f2db3f9f 100644 (file)
@@ -1111,6 +1111,12 @@ AC_DEFUN([OPAL_CONFIG_ASM],[
               [AC_MSG_ERROR([No atomic primitives available for $host])])
             ;;
 
+        hppa*)
+            opal_cv_asm_arch="HPPA"
+            OPAL_ASM_SUPPORT_64BIT=0
+            OPAL_GCC_INLINE_ASSIGN='"copy 0,%0" : "=&r"(ret)'
+            ;;
+
         mips-*|mips64*)
             # Should really find some way to make sure that we are on
             # a MIPS III machine (r4000 and later)
index ee9aa96901d262a0276c3702e78e6d6de1cf7175..45e485c1c221ded13cc4d6be5a5c0d04c104b079 100644 (file)
@@ -36,6 +36,7 @@
 #define OPAL_X86_64         0030
 #define OPAL_POWERPC32      0050
 #define OPAL_POWERPC64      0051
+#define OPAL_HPPA           0120
 #define OPAL_SPARC          0060
 #define OPAL_SPARCV9_32     0061
 #define OPAL_SPARCV9_64     0062
index 3b165f00e058a05fd14b1f58cbaa1b8ebf04c4e3..4e3687622169d353d346d500f829e9bda2fff485 100644 (file)
@@ -169,6 +169,8 @@ enum {
 #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 4ce2810b7f67d29b769078759e0a0ccd9366bc1b..606596367b0e8f57564e6d6db383a5fbee8847ee 100644 (file)
@@ -90,6 +90,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 5ec7b013872e078b10eddaaf601e9d1d90c87f33..6ecfb48ebcf50b90cdd1fa8d6907024603611041 100644 (file)
@@ -47,7 +47,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*|powerpc64le-*linux*|powerpcle-*linux*|sparc*-*linux*|aarch64-*linux*)
+       i?86-*linux*|x86_64*linux*|ia64-*linux*|powerpc-*linux*|powerpc64-*linux*|powerpc64le-*linux*|powerpcle-*linux*|sparc*-*linux*|aarch64-*linux*|hppa*-*linux*)
         AS_IF([test "$timer_linux_happy" = "yes"],
               [AS_IF([test -r "/proc/cpuinfo"],
                      [timer_linux_happy="yes"],