From f31c19bb9e6abdd85acde7a900894c7c31e14a01 Mon Sep 17 00:00:00 2001 From: Pawel Dziepak Date: Mon, 5 May 2014 17:09:34 +0200 Subject: [PATCH] libroot/x86_64: relax asm constraints in find_thread() --- src/system/libroot/os/arch/x86_64/thread.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/system/libroot/os/arch/x86_64/thread.cpp b/src/system/libroot/os/arch/x86_64/thread.cpp index 10614ba6c6..e4da9a8f41 100644 --- a/src/system/libroot/os/arch/x86_64/thread.cpp +++ b/src/system/libroot/os/arch/x86_64/thread.cpp @@ -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; }