summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/rseq/rseq-or1k-thread-pointer.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2025-01-25 10:16:56 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2025-01-25 10:16:56 -0800
commitfd56e5104a37f96e1b1ca42b4fd64fd49257fdce (patch)
treef1affd621b701bbfb83fde9a0046dac5baadef6e /tools/testing/selftests/rseq/rseq-or1k-thread-pointer.h
parent0f8e26b38d7ac72b3ad764944a25dd5808f37a6e (diff)
parentea1413e5b53a8dd4fa7675edb23cdf828bbdce1e (diff)
Merge tag 'for-linus' of https://github.com/openrisc/linux
Pull OpenRISC updates from Stafford Horne: - Added support for restartable sequences (me) - Migration to Generic built-in DTB (Masahiro Yamada) * tag 'for-linus' of https://github.com/openrisc/linux: rseq/selftests: Add support for OpenRISC openrisc: Add support for restartable sequences openrisc: Add HAVE_REGS_AND_STACK_ACCESS_API support openrisc: migrate to the generic rule for built-in DTB
Diffstat (limited to 'tools/testing/selftests/rseq/rseq-or1k-thread-pointer.h')
-rw-r--r--tools/testing/selftests/rseq/rseq-or1k-thread-pointer.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/testing/selftests/rseq/rseq-or1k-thread-pointer.h b/tools/testing/selftests/rseq/rseq-or1k-thread-pointer.h
new file mode 100644
index 000000000000..cda740f7aff3
--- /dev/null
+++ b/tools/testing/selftests/rseq/rseq-or1k-thread-pointer.h
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: LGPL-2.1-only OR MIT */
+#ifndef _RSEQ_OR1K_THREAD_POINTER
+#define _RSEQ_OR1K_THREAD_POINTER
+
+static inline void *rseq_thread_pointer(void)
+{
+ void *__thread_register;
+
+ __asm__ ("l.or %0, r10, r0" : "=r" (__thread_register));
+ return __thread_register;
+}
+
+#endif