]> sourceware.org Git - glibc.git/commitdiff
nptl: fix __builtin_thread_pointer detection on LoongArch
authorcaiyinyu <caiyinyu@loongson.cn>
Wed, 6 Nov 2024 02:06:21 +0000 (10:06 +0800)
committercaiyinyu <caiyinyu@loongson.cn>
Thu, 7 Nov 2024 06:08:30 +0000 (14:08 +0800)
Signed-off-by: caiyinyu <caiyinyu@loongson.cn>
sysdeps/loongarch/nptl/thread_pointer.h
sysdeps/loongarch/nptl/tls.h

index 5dec2ef4c63f576793af0eee3e2bad1a5bb56050..cc96062c931c39e10c4eb25556b5c9a91e58e50f 100644 (file)
 #ifndef _SYS_THREAD_POINTER_H
 #define _SYS_THREAD_POINTER_H
 
-#include <sys/cdefs.h>
+register void *__thread_self asm ("$tp");
 
 static inline void *
 __thread_pointer (void)
 {
-#if __glibc_has_builtin (__builtin_thread_pointer)
-  return __builtin_thread_pointer ();
-#else
-  void *__thread_register;
-  __asm__ ("move %0, $tp" : "=r" (__thread_register));
-  return __thread_register;
-#endif
+  return __thread_self;
 }
 
 #endif /* _SYS_THREAD_POINTER_H */
index ac1a92ea7b19334cff52b0c3e59f5b349bbe44ca..675c0d27c1a66b205e5042bb2a2dde710bbdbed3 100644 (file)
@@ -26,8 +26,8 @@
 #include <stddef.h>
 #include <stdint.h>
 #include <dl-dtv.h>
+#include "thread_pointer.h"
 
-register void *__thread_self asm ("$tp");
 #define READ_THREAD_POINTER() ({ __thread_self; })
 
 /* Get system call information.  */
This page took 0.037909 seconds and 5 git commands to generate.