summaryrefslogtreecommitdiff
path: root/arch/or1k/pthread_arch.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/or1k/pthread_arch.h')
-rw-r--r--arch/or1k/pthread_arch.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/or1k/pthread_arch.h b/arch/or1k/pthread_arch.h
new file mode 100644
index 0000000..f75ea7e
--- /dev/null
+++ b/arch/or1k/pthread_arch.h
@@ -0,0 +1,16 @@
+static inline uintptr_t __get_tp()
+{
+#ifdef __clang__
+ uintptr_t tp;
+ __asm__ ("l.ori %0, r10, 0" : "=r" (tp) );
+#else
+ register uintptr_t tp __asm__("r10");
+ __asm__ ("" : "=r" (tp) );
+#endif
+ return tp;
+}
+
+#define TLS_ABOVE_TP
+#define GAP_ABOVE_TP 0
+
+#define MC_PC regs.pc