[PATCH] nptl: Add <thread_pointer.h> for microblaze

Florian Weimer fweimer@redhat.com
Fri Jan 3 07:25:17 GMT 2025


* Michael Jeanson:

> +static inline void *
> +__thread_pointer (void)
> +{
> +  void *__thread_register;
> +  __asm__ ("add %0, r21, r0" : "=r" (__thread_register));
> +  return __thread_register;
> +}
> +
> +#endif /* _SYS_THREAD_POINTER_H */

After reading other parts of the port, I conclude that r0 is the zero
register, r21 is the thread register, and the destination operand comes
first.  The port does not use __thread_register in other places.  So
this should be okay.

Reviewed-by: Florian Weimer <fweimer@redhat.com>

Thanks,
Florian



More information about the Libc-alpha mailing list