xref: /linux/tools/testing/selftests/rseq/rseq-or1k-thread-pointer.h (revision 21aa65bf82a78c1e70447a45a85e533689b7f1a7)
1 /* SPDX-License-Identifier: LGPL-2.1-only OR MIT */
2 #ifndef _RSEQ_OR1K_THREAD_POINTER
3 #define _RSEQ_OR1K_THREAD_POINTER
4 
5 static inline void *rseq_thread_pointer(void)
6 {
7 	void *__thread_register;
8 
9 	__asm__ ("l.or %0, r10, r0" : "=r" (__thread_register));
10 	return __thread_register;
11 }
12 
13 #endif
14