mirror of
git://git.musl-libc.org/musl
synced 2024-12-17 12:14:42 +00:00
a4a3e4dbc0
this will allow the compiler to cache and reuse the result, meaning we
no longer have to take care not to load it more than once for the sake
of archs where the load may be expensive.
depends on commit 1c84c99913
for
correctness, since otherwise the compiler could hoist loads during
stage 3 of dynamic linking before the initial thread-pointer setup.
11 lines
178 B
C
11 lines
178 B
C
static inline struct pthread *__pthread_self()
|
|
{
|
|
struct pthread *self;
|
|
__asm__ ("ori %0, r21, 0" : "=r" (self) );
|
|
return self;
|
|
}
|
|
|
|
#define TP_ADJ(p) (p)
|
|
|
|
#define MC_PC regs.pc
|