libroot/x86[_64]: relax asm constraints in tls_*() functions
This commit is contained in:
@@ -30,8 +30,8 @@ tls_get(int32 index)
|
|||||||
{
|
{
|
||||||
void *ret;
|
void *ret;
|
||||||
__asm__ __volatile__ (
|
__asm__ __volatile__ (
|
||||||
"movl %%fs:(,%%edx, 4), %%eax \n\t"
|
"movl %%fs:(, %1, 4), %0"
|
||||||
: "=a"(ret) : "d"(index) );
|
: "=r" (ret) : "r" (index));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,9 +40,9 @@ tls_address(int32 index)
|
|||||||
{
|
{
|
||||||
void **ret;
|
void **ret;
|
||||||
__asm__ __volatile__ (
|
__asm__ __volatile__ (
|
||||||
"movl %%fs:0, %%eax \n\t"
|
"movl %%fs:0, %0\n\t"
|
||||||
"leal (%%eax, %%edx, 4), %%eax \n\t"
|
"leal (%0, %1, 4), %0\n\t"
|
||||||
: "=a"(ret) : "d"(index) );
|
: "=&r" (ret) : "r" (index));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,8 +50,8 @@ static inline void
|
|||||||
tls_set(int32 index, void *value)
|
tls_set(int32 index, void *value)
|
||||||
{
|
{
|
||||||
__asm__ __volatile__ (
|
__asm__ __volatile__ (
|
||||||
"movl %%eax, %%fs:(,%%edx, 4) \n\t"
|
"movl %1, %%fs:(, %0, 4)"
|
||||||
: : "d"(index), "a"(value) );
|
: : "r" (index), "r" (value));
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ tls_get(int32 index)
|
|||||||
{
|
{
|
||||||
void *ret;
|
void *ret;
|
||||||
__asm__ __volatile__ (
|
__asm__ __volatile__ (
|
||||||
"movl %%fs:(,%%edx, 4), %%eax \n\t"
|
"movl %%fs:(, %1, 4), %0"
|
||||||
: "=a"(ret) : "d"(index) );
|
: "=r" (ret) : "r" (index));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,9 +43,9 @@ tls_address(int32 index)
|
|||||||
{
|
{
|
||||||
void **ret;
|
void **ret;
|
||||||
__asm__ __volatile__ (
|
__asm__ __volatile__ (
|
||||||
"movl %%fs:0, %%eax \n\t"
|
"movl %%fs:0, %0\n\t"
|
||||||
"leal (%%eax, %%edx, 4), %%eax \n\t"
|
"leal (%0, %1, 4), %0\n\t"
|
||||||
: "=a"(ret) : "d"(index) );
|
: "=&r" (ret) : "r" (index));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ void
|
|||||||
tls_set(int32 index, void *value)
|
tls_set(int32 index, void *value)
|
||||||
{
|
{
|
||||||
__asm__ __volatile__ (
|
__asm__ __volatile__ (
|
||||||
"movl %%eax, %%fs:(,%%edx, 4) \n\t"
|
"movl %1, %%fs:(, %0, 4)"
|
||||||
: : "d"(index), "a"(value) );
|
: : "r" (index), "r" (value));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,8 +35,8 @@ tls_get(int32 _index)
|
|||||||
void* ret;
|
void* ret;
|
||||||
|
|
||||||
__asm__ __volatile__ (
|
__asm__ __volatile__ (
|
||||||
"movq %%fs:(, %%rdi, 8), %%rax"
|
"movq %%fs:(, %1, 8), %0"
|
||||||
: "=a" (ret) : "D" (index));
|
: "=r" (ret) : "r" (index));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,9 +48,9 @@ tls_address(int32 _index)
|
|||||||
void** ret;
|
void** ret;
|
||||||
|
|
||||||
__asm__ __volatile__ (
|
__asm__ __volatile__ (
|
||||||
"movq %%fs:0, %%rax\n\t"
|
"movq %%fs:0, %0\n\t"
|
||||||
"leaq (%%rax, %%rdi, 8), %%rax\n\t"
|
"leaq (%0, %1, 8), %0\n\t"
|
||||||
: "=a" (ret) : "D" (index));
|
: "=&r" (ret) : "r" (index));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,6 +60,6 @@ tls_set(int32 _index, void* value)
|
|||||||
{
|
{
|
||||||
int64 index = _index;
|
int64 index = _index;
|
||||||
__asm__ __volatile__ (
|
__asm__ __volatile__ (
|
||||||
"movq %%rsi, %%fs:(, %%rdi, 8)"
|
"movq %1, %%fs:(, %0, 8)"
|
||||||
: : "D" (index), "S" (value));
|
: : "r" (index), "r" (value));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user