rseq-or1k-thread-pointer.h 291 B

12345678910111213
  1. /* SPDX-License-Identifier: LGPL-2.1-only OR MIT */
  2. #ifndef _RSEQ_OR1K_THREAD_POINTER
  3. #define _RSEQ_OR1K_THREAD_POINTER
  4. static inline void *rseq_thread_pointer(void)
  5. {
  6. void *__thread_register;
  7. __asm__ ("l.or %0, r10, r0" : "=r" (__thread_register));
  8. return __thread_register;
  9. }
  10. #endif