提交 18771490 创建 作者: Nickolai Zeldovich's avatar Nickolai Zeldovich

need 64-bit offset to force 64-bit address mode

上级 04d2a8a3
...@@ -48,14 +48,14 @@ void* ...@@ -48,14 +48,14 @@ void*
pthread_getspecific(pthread_key_t key) pthread_getspecific(pthread_key_t key)
{ {
u64 v; u64 v;
__asm volatile("movq %%fs:(%1), %0" : "=r" (v) : "r" (key * 8)); __asm volatile("movq %%fs:(%1), %0" : "=r" (v) : "r" ((u64) key * 8));
return (void*) v; return (void*) v;
} }
int int
pthread_setspecific(pthread_key_t key, void* value) pthread_setspecific(pthread_key_t key, void* value)
{ {
__asm volatile("movq %0, %%fs:(%1)" : : "r" (value), "r" (key * 8)); __asm volatile("movq %0, %%fs:(%1)" : : "r" (value), "r" ((u64) key * 8));
return 0; return 0;
} }
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论