X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=arch%2Fmips%2Fpthread_arch.h;h=e5812655df8684f7e44204bf0561c9c0dade0ceb;hb=cff5747c74c41b22f1ce1340978b1c226a8cdf32;hp=93edbd4ed42138b10eaa25d4b1f1a9fa4e3e3664;hpb=11da520c7af5b190e69c0906c6e95000c4e59f33;p=musl diff --git a/arch/mips/pthread_arch.h b/arch/mips/pthread_arch.h index 93edbd4e..e5812655 100644 --- a/arch/mips/pthread_arch.h +++ b/arch/mips/pthread_arch.h @@ -1,12 +1,11 @@ static inline struct pthread *__pthread_self() { -#ifdef __clang__ - char *tp; - __asm__ __volatile__ (".word 0x7c03e83b ; move %0, $3" : "=r" (tp) : : "$3" ); -#else +#if __mips_isa_rev < 2 register char *tp __asm__("$3"); - /* rdhwr $3,$29 */ __asm__ __volatile__ (".word 0x7c03e83b" : "=r" (tp) ); +#else + char *tp; + __asm__ __volatile__ ("rdhwr %0, $29" : "=r" (tp) ); #endif return (pthread_t)(tp - 0x7000 - sizeof(struct pthread)); } @@ -16,4 +15,4 @@ static inline struct pthread *__pthread_self() #define DTP_OFFSET 0x8000 -#define CANCEL_REG_IP (3-(union {int __i; char __b;}){1}.__b) +#define MC_PC pc