X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=arch%2Fmips%2Fpthread_arch.h;h=77b7330dacfd1445d4635d64bb0c6ece1a87897c;hb=743546a9339d3da4304fd63f74872e90ac792f63;hp=60296fd669c3f91c4951540ece0a1a6e1e17138a;hpb=6315004f6102dca44c4ba50654a36967b8b9c2a6;p=musl diff --git a/arch/mips/pthread_arch.h b/arch/mips/pthread_arch.h index 60296fd6..77b7330d 100644 --- a/arch/mips/pthread_arch.h +++ b/arch/mips/pthread_arch.h @@ -1,8 +1,12 @@ static inline struct pthread *__pthread_self() { struct pthread *self; +#ifdef __clang__ + __asm__ __volatile__ (".word 0x7c03e83b ; move %0, $3" : "=r" (self) : : "$3" ); +#else __asm__ __volatile__ (".word 0x7c03e83b" : "=v" (self) ); +#endif return self; } -#define CANCEL_REG_IP 3 +#define CANCEL_REG_IP (3-(union {int __i; char __b;}){1}.__b)