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; }