Use the __seg_gs named address space qualifier to cast access to the
gscope_flag in the TCB as a %gs: prefixed address. This enables the
use of the "m" operand constraint, which informs the compiler about
memory access in the inline assembly.
Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Cc: H.J.Lu <hjl.tools@gmail.com>
Cc: Florian Weimer <fweimer@redhat.com>
Cc: Carlos O'Donell <carlos@redhat.com>
#define THREAD_GSCOPE_RESET_FLAG() \
do \
{ int __res; \
- asm volatile ("xchgl %0, %%gs:%P1" \
+ asm volatile ("xchgl %1, %0" \
: "=r" (__res) \
- : "i" (offsetof (struct pthread, header.gscope_flag)), \
+ : "m" (*(int __seg_gs *) \
+ offsetof (struct pthread, header.gscope_flag)), \
"0" (THREAD_GSCOPE_FLAG_UNUSED)); \
if (__res == THREAD_GSCOPE_FLAG_WAIT) \
lll_futex_wake (&THREAD_SELF->header.gscope_flag, 1, LLL_PRIVATE); \