libroot/x86_64: relax asm constraints in find_thread()

This commit is contained in:
Pawel Dziepak
2014-05-06 14:59:53 +02:00
parent 344643740a
commit f31c19bb9e
+3 -1
View File
@@ -13,7 +13,9 @@ find_thread(const char* name)
{
if (!name) {
thread_id thread;
__asm__ __volatile__ ("movq %%fs:8, %%rax" : "=a" (thread));
static_assert(sizeof(thread_id) <= sizeof(uint32_t),
"thread_id is larger than uint32_t");
__asm__ __volatile__ ("movl %%fs:8, %0" : "=r" (thread));
return thread;
}