Add support for hppa/PA-RISC architecture
authorHelge Deller <deller@gmx.de>
Thu, 17 Apr 2014 11:04:05 +0000 (07:04 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 17 Apr 2014 11:05:28 +0000 (07:05 -0400)
Add the missing architecture specific functions to provide support for
the hppa/PA-RISC architecture:
- the processor internal time stamp counter (Control Register CR16) is
  used to get high-performance/low-latency cycle counts
- gcc provides the necessary built-in atomic functions on hppa (which in
  turn uses the light-weigth atomic locking syscall-interface of the
  Linux kernel)

Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
configure.ac
urcu/arch/hppa.h [new file with mode: 0644]
urcu/uatomic/hppa.h [new file with mode: 0644]

index 86f0e2b9744e1de248ed24dc6b27fae6d69d23d4..008336c0ec92da0d0d64c4adc32030873d4b0a30 100644 (file)
@@ -82,6 +82,7 @@ AS_CASE([$host_cpu],
        [aarch64], [ARCHTYPE="gcc"],
        [mips*], [ARCHTYPE="mips"],
        [tile*], [ARCHTYPE="gcc"],
+       [hppa*], [ARCHTYPE="hppa"],
        [ARCHTYPE="unknown"]
 )
 
diff --git a/urcu/arch/hppa.h b/urcu/arch/hppa.h
new file mode 100644 (file)
index 0000000..b9b9494
--- /dev/null
@@ -0,0 +1,30 @@
+#ifndef _URCU_ARCH_HPPA_H
+#define _URCU_ARCH_HPPA_H
+
+#include <urcu/compiler.h>
+#include <urcu/config.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdlib.h>
+#include <sys/time.h>
+
+typedef unsigned long cycles_t;
+
+static inline cycles_t caa_get_cycles(void)
+{
+       cycles_t cycles;
+
+       asm volatile("mfctl 16, %0" : "=r" (cycles));
+       return cycles;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#include <urcu/arch/generic.h>
+
+#endif /* _URCU_ARCH_HPPA_H */
diff --git a/urcu/uatomic/hppa.h b/urcu/uatomic/hppa.h
new file mode 100644 (file)
index 0000000..2102153
--- /dev/null
@@ -0,0 +1,10 @@
+#ifndef _URCU_ARCH_UATOMIC_HPPA_H
+#define _URCU_ARCH_UATOMIC_HPPA_H
+
+#include <urcu/compiler.h>
+#include <urcu/system.h>
+
+#define UATOMIC_HAS_ATOMIC_SHORT
+#include <urcu/uatomic/generic.h>
+
+#endif /* _URCU_ARCH_UATOMIC_HPPA_H */
This page took 0.026044 seconds and 4 git commands to generate.