mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-21 12:30:06 +00:00
nptl: fix __builtin_thread_pointer detection on LoongArch
Signed-off-by: caiyinyu <caiyinyu@loongson.cn>
This commit is contained in:
parent
ba60be8735
commit
1b70a0a024
@ -19,18 +19,12 @@
|
||||
#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 */
|
||||
|
@ -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. */
|
||||
|
Loading…
Reference in New Issue
Block a user