am 5995bf88
: Merge "don\'t hardcode register r0/v1 when reading the TLS"
* commit '5995bf880e2a7fac249382f0a929b7271c843122': don't hardcode register r0/v1 when reading the TLS
This commit is contained in:
commit
d2dbf16358
1 changed files with 9 additions and 12 deletions
|
@ -84,20 +84,17 @@ extern int __set_tls(void* ptr);
|
|||
/* get the TLS */
|
||||
#if defined(__arm__)
|
||||
# define __get_tls() \
|
||||
({ register unsigned int __val asm("r0"); \
|
||||
asm ("mrc p15, 0, r0, c13, c0, 3" : "=r"(__val) ); \
|
||||
(volatile void*)__val; })
|
||||
({ register unsigned int __val; \
|
||||
asm ("mrc p15, 0, %0, c13, c0, 3" : "=r"(__val)); \
|
||||
(volatile void*) __val; })
|
||||
#elif defined(__mips__)
|
||||
# define __get_tls() \
|
||||
({ register unsigned int __val asm("v1"); \
|
||||
asm ( \
|
||||
" .set push\n" \
|
||||
" .set mips32r2\n" \
|
||||
" rdhwr %0,$29\n" \
|
||||
" .set pop\n" \
|
||||
: "=r"(__val) \
|
||||
); \
|
||||
(volatile void*)__val; })
|
||||
({ register unsigned int __val; \
|
||||
asm (" .set push\n" \
|
||||
" .set mips32r2\n" \
|
||||
" rdhwr %0,$29\n" \
|
||||
" .set pop\n" : "=r"(__val)); \
|
||||
(volatile void*) __val; })
|
||||
#elif defined(__i386__)
|
||||
# define __get_tls() \
|
||||
({ register void* __val; \
|
||||
|
|
Loading…
Reference in a new issue