xref: /linux/tools/testing/selftests/rseq/rseq-or1k-thread-pointer.h (revision 2151003e773c7e7dba4d64bed4bfc483681b5f6a)
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