(THREAD_GETMEM): Makr asms volatile. (THREAD_GETMEM_NC): Likewise.

This commit is contained in:
Ulrich Drepper 2003-03-14 09:45:53 +00:00
parent 365eccdb09
commit 7f2936863e

View File

@ -156,13 +156,13 @@ typedef struct
# define THREAD_GETMEM(descr, member) \ # define THREAD_GETMEM(descr, member) \
({ __typeof (descr->member) __value; \ ({ __typeof (descr->member) __value; \
if (sizeof (__value) == 1) \ if (sizeof (__value) == 1) \
asm ("movb %%fs:%P2,%b0" \ asm volatile ("movb %%fs:%P2,%b0" \
: "=q" (__value) \ : "=q" (__value) \
: "0" (0), "i" (offsetof (struct pthread, member))); \ : "0" (0), "i" (offsetof (struct pthread, member))); \
else if (sizeof (__value) == 4) \ else if (sizeof (__value) == 4) \
asm ("movl %%fs:%P1,%0" \ asm volatile ("movl %%fs:%P1,%0" \
: "=r" (__value) \ : "=r" (__value) \
: "i" (offsetof (struct pthread, member))); \ : "i" (offsetof (struct pthread, member))); \
else \ else \
{ \ { \
if (sizeof (__value) != 8) \ if (sizeof (__value) != 8) \
@ -170,9 +170,9 @@ typedef struct
4 or 8. */ \ 4 or 8. */ \
abort (); \ abort (); \
\ \
asm ("movq %%fs:%P1,%q0" \ asm volatile ("movq %%fs:%P1,%q0" \
: "=r" (__value) \ : "=r" (__value) \
: "i" (offsetof (struct pthread, member))); \ : "i" (offsetof (struct pthread, member))); \
} \ } \
__value; }) __value; })
@ -181,14 +181,14 @@ typedef struct
# define THREAD_GETMEM_NC(descr, member, idx) \ # define THREAD_GETMEM_NC(descr, member, idx) \
({ __typeof (descr->member[0]) __value; \ ({ __typeof (descr->member[0]) __value; \
if (sizeof (__value) == 1) \ if (sizeof (__value) == 1) \
asm ("movb %%fs:%P2(%q3),%b0" \ asm volatile ("movb %%fs:%P2(%q3),%b0" \
: "=q" (__value) \ : "=q" (__value) \
: "0" (0), "i" (offsetof (struct pthread, member[0])), \ : "0" (0), "i" (offsetof (struct pthread, member[0])), \
"r" (idx)); \ "r" (idx)); \
else if (sizeof (__value) == 4) \ else if (sizeof (__value) == 4) \
asm ("movl %%fs:%P1(,%q2,4),%0" \ asm volatile ("movl %%fs:%P1(,%q2,4),%0" \
: "=r" (__value) \ : "=r" (__value) \
: "i" (offsetof (struct pthread, member[0])), "r" (idx)); \ : "i" (offsetof (struct pthread, member[0])), "r" (idx));\
else \ else \
{ \ { \
if (sizeof (__value) != 8) \ if (sizeof (__value) != 8) \
@ -196,9 +196,10 @@ typedef struct
4 or 8. */ \ 4 or 8. */ \
abort (); \ abort (); \
\ \
asm ("movq %%fs:%P1(,%q2,8),%q0" \ asm volatile ("movq %%fs:%P1(,%q2,8),%q0" \
: "=r" (__value) \ : "=r" (__value) \
: "i" (offsetof (struct pthread, member[0])), "r" (idx)); \ : "i" (offsetof (struct pthread, member[0])), \
"r" (idx)); \
} \ } \
__value; }) __value; })