mirror of
git://sourceware.org/git/glibc.git
synced 2025-03-01 13:17:19 +08:00
* sysdeps/x86_64/pt-machine.h: Use %fs instead of %gs
as thread specific register. (testandset): Fix inline asm. (THREAD_GETMEM): Fix inline asm. 2002-08-23 Andreas Jaeger <aj@suse.de> * sysdeps/x86_64/pt-machine.h: Use %fs instead of %gs as thread specific register. (testandset): Fix inline asm. (THREAD_GETMEM): Fix inline asm.
This commit is contained in:
parent
404d4cef44
commit
fb2bdbbabd
linuxthreads
@ -1,3 +1,10 @@
|
|||||||
|
2002-08-23 Andreas Jaeger <aj@suse.de>
|
||||||
|
|
||||||
|
* sysdeps/x86_64/pt-machine.h: Use %fs instead of %gs
|
||||||
|
as thread specific register.
|
||||||
|
(testandset): Fix inline asm.
|
||||||
|
(THREAD_GETMEM): Fix inline asm.
|
||||||
|
|
||||||
2002-08-22 Roland McGrath <roland@redhat.com>
|
2002-08-22 Roland McGrath <roland@redhat.com>
|
||||||
|
|
||||||
* sysdeps/i386/useldt.h (INIT_THREAD_SELF): Remove [HAVE_TLS_SUPPORT]
|
* sysdeps/i386/useldt.h (INIT_THREAD_SELF): Remove [HAVE_TLS_SUPPORT]
|
||||||
|
@ -46,7 +46,7 @@ testandset (int *spinlock)
|
|||||||
long int ret;
|
long int ret;
|
||||||
|
|
||||||
__asm__ __volatile__ (
|
__asm__ __volatile__ (
|
||||||
"xchgq %0, %1"
|
"xchgl %k0, %1"
|
||||||
: "=r"(ret), "=m"(*spinlock)
|
: "=r"(ret), "=m"(*spinlock)
|
||||||
: "0"(1), "m"(*spinlock)
|
: "0"(1), "m"(*spinlock)
|
||||||
: "memory");
|
: "memory");
|
||||||
@ -71,7 +71,6 @@ __compare_and_swap (long int *p, long int oldval, long int newval)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Return the thread descriptor for the current thread.
|
/* Return the thread descriptor for the current thread.
|
||||||
|
|
||||||
The contained asm must *not* be marked volatile since otherwise
|
The contained asm must *not* be marked volatile since otherwise
|
||||||
@ -81,7 +80,7 @@ __compare_and_swap (long int *p, long int oldval, long int newval)
|
|||||||
#define THREAD_SELF \
|
#define THREAD_SELF \
|
||||||
({ \
|
({ \
|
||||||
register pthread_descr __self; \
|
register pthread_descr __self; \
|
||||||
__asm__ ("movq %%gs:%c1,%0" : "=r" (__self) \
|
__asm__ ("movq %%fs:%c1,%0" : "=r" (__self) \
|
||||||
: "i" (offsetof (struct _pthread_descr_struct, \
|
: "i" (offsetof (struct _pthread_descr_struct, \
|
||||||
p_header.data.self))); \
|
p_header.data.self))); \
|
||||||
__self; \
|
__self; \
|
||||||
@ -93,7 +92,7 @@ extern int __arch_prctl (int __code, unsigned long __addr);
|
|||||||
/* Initialize the thread-unique value. */
|
/* Initialize the thread-unique value. */
|
||||||
#define INIT_THREAD_SELF(descr, nr) \
|
#define INIT_THREAD_SELF(descr, nr) \
|
||||||
{ \
|
{ \
|
||||||
if (__arch_prctl (ARCH_SET_GS, (unsigned long)descr) != 0) \
|
if (__arch_prctl (ARCH_SET_FS, (unsigned long)descr) != 0) \
|
||||||
abort (); \
|
abort (); \
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,15 +101,16 @@ extern int __arch_prctl (int __code, unsigned long __addr);
|
|||||||
({ \
|
({ \
|
||||||
__typeof__ (descr->member) __value; \
|
__typeof__ (descr->member) __value; \
|
||||||
if (sizeof (__value) == 1) \
|
if (sizeof (__value) == 1) \
|
||||||
__asm__ __volatile__ ("movb %%gs:%P2,%b0" \
|
__asm__ __volatile__ ("movb %%fs:%P2,%b0" \
|
||||||
: "=q" (__value) \
|
: "=q" (__value) \
|
||||||
: "0" (0), \
|
: "0" (0), \
|
||||||
"i" (offsetof (struct _pthread_descr_struct, \
|
"i" (offsetof (struct _pthread_descr_struct, \
|
||||||
member))); \
|
member))); \
|
||||||
else if (sizeof (__value) == 4) \
|
else if (sizeof (__value) == 4) \
|
||||||
__asm__ __volatile__ ("movl %%gs:%P1,%0" \
|
__asm__ __volatile__ ("movl %%fs:%P2,%k0" \
|
||||||
: "=r" (__value) \
|
: "=r" (__value) \
|
||||||
: "i" (offsetof (struct _pthread_descr_struct, \
|
: "0" (0), \
|
||||||
|
"i" (offsetof (struct _pthread_descr_struct, \
|
||||||
member))); \
|
member))); \
|
||||||
else \
|
else \
|
||||||
{ \
|
{ \
|
||||||
@ -118,7 +118,7 @@ extern int __arch_prctl (int __code, unsigned long __addr);
|
|||||||
/* There should not be any value with a size other than 1, 4 or 8. */\
|
/* There should not be any value with a size other than 1, 4 or 8. */\
|
||||||
abort (); \
|
abort (); \
|
||||||
\
|
\
|
||||||
__asm__ __volatile__ ("movq %%gs:%P1,%0" \
|
__asm__ __volatile__ ("movq %%fs:%P1,%0" \
|
||||||
: "=r" (__value) \
|
: "=r" (__value) \
|
||||||
: "i" (offsetof (struct _pthread_descr_struct, \
|
: "i" (offsetof (struct _pthread_descr_struct, \
|
||||||
member))); \
|
member))); \
|
||||||
@ -131,15 +131,16 @@ extern int __arch_prctl (int __code, unsigned long __addr);
|
|||||||
({ \
|
({ \
|
||||||
__typeof__ (descr->member) __value; \
|
__typeof__ (descr->member) __value; \
|
||||||
if (sizeof (__value) == 1) \
|
if (sizeof (__value) == 1) \
|
||||||
__asm__ __volatile__ ("movb %%gs:(%2),%b0" \
|
__asm__ __volatile__ ("movb %%fs:(%2),%b0" \
|
||||||
: "=q" (__value) \
|
: "=q" (__value) \
|
||||||
: "0" (0), \
|
: "0" (0), \
|
||||||
"r" (offsetof (struct _pthread_descr_struct, \
|
"r" (offsetof (struct _pthread_descr_struct, \
|
||||||
member))); \
|
member))); \
|
||||||
else if (sizeof (__value) == 4) \
|
else if (sizeof (__value) == 4) \
|
||||||
__asm__ __volatile__ ("movl %%gs:(%1),%0" \
|
__asm__ __volatile__ ("movl %%fs:(%2),%k0" \
|
||||||
: "=r" (__value) \
|
: "=r" (__value) \
|
||||||
: "r" (offsetof (struct _pthread_descr_struct, \
|
: "0" (0), \
|
||||||
|
"r" (offsetof (struct _pthread_descr_struct, \
|
||||||
member))); \
|
member))); \
|
||||||
else \
|
else \
|
||||||
{ \
|
{ \
|
||||||
@ -147,7 +148,7 @@ extern int __arch_prctl (int __code, unsigned long __addr);
|
|||||||
/* There should not be any value with a size other than 1, 4 or 8. */\
|
/* There should not be any value with a size other than 1, 4 or 8. */\
|
||||||
abort (); \
|
abort (); \
|
||||||
\
|
\
|
||||||
__asm__ __volatile__ ("movq %%gs:(%1),%0" \
|
__asm__ __volatile__ ("movq %%fs:(%1),%0" \
|
||||||
: "=r" (__value) \
|
: "=r" (__value) \
|
||||||
: "r" (offsetof (struct _pthread_descr_struct, \
|
: "r" (offsetof (struct _pthread_descr_struct, \
|
||||||
member))); \
|
member))); \
|
||||||
@ -160,12 +161,12 @@ extern int __arch_prctl (int __code, unsigned long __addr);
|
|||||||
({ \
|
({ \
|
||||||
__typeof__ (descr->member) __value = (value); \
|
__typeof__ (descr->member) __value = (value); \
|
||||||
if (sizeof (__value) == 1) \
|
if (sizeof (__value) == 1) \
|
||||||
__asm__ __volatile__ ("movb %0,%%gs:%P1" : \
|
__asm__ __volatile__ ("movb %0,%%fs:%P1" : \
|
||||||
: "q" (__value), \
|
: "q" (__value), \
|
||||||
"i" (offsetof (struct _pthread_descr_struct, \
|
"i" (offsetof (struct _pthread_descr_struct, \
|
||||||
member))); \
|
member))); \
|
||||||
else if (sizeof (__value) == 4) \
|
else if (sizeof (__value) == 4) \
|
||||||
__asm__ __volatile__ ("movl %0,%%gs:%P1" : \
|
__asm__ __volatile__ ("movl %k0,%%fs:%P1" : \
|
||||||
: "r" (__value), \
|
: "r" (__value), \
|
||||||
"i" (offsetof (struct _pthread_descr_struct, \
|
"i" (offsetof (struct _pthread_descr_struct, \
|
||||||
member))); \
|
member))); \
|
||||||
@ -175,7 +176,7 @@ extern int __arch_prctl (int __code, unsigned long __addr);
|
|||||||
/* There should not be any value with a size other than 1, 4 or 8. */\
|
/* There should not be any value with a size other than 1, 4 or 8. */\
|
||||||
abort (); \
|
abort (); \
|
||||||
\
|
\
|
||||||
__asm__ __volatile__ ("movq %0,%%gs:%P1" : \
|
__asm__ __volatile__ ("movq %0,%%fs:%P1" : \
|
||||||
: "r" (__value), \
|
: "r" (__value), \
|
||||||
"i" (offsetof (struct _pthread_descr_struct, \
|
"i" (offsetof (struct _pthread_descr_struct, \
|
||||||
member))); \
|
member))); \
|
||||||
@ -187,12 +188,12 @@ extern int __arch_prctl (int __code, unsigned long __addr);
|
|||||||
({ \
|
({ \
|
||||||
__typeof__ (descr->member) __value = (value); \
|
__typeof__ (descr->member) __value = (value); \
|
||||||
if (sizeof (__value) == 1) \
|
if (sizeof (__value) == 1) \
|
||||||
__asm__ __volatile__ ("movb %0,%%gs:(%1)" : \
|
__asm__ __volatile__ ("movb %0,%%fs:(%1)" : \
|
||||||
: "q" (__value), \
|
: "q" (__value), \
|
||||||
"r" (offsetof (struct _pthread_descr_struct, \
|
"r" (offsetof (struct _pthread_descr_struct, \
|
||||||
member))); \
|
member))); \
|
||||||
else if (sizeof (__value) == 4) \
|
else if (sizeof (__value) == 4) \
|
||||||
__asm__ __volatile__ ("movl %0,%%gs:(%1)" : \
|
__asm__ __volatile__ ("movl %k0,%%fs:(%1)" : \
|
||||||
: "r" (__value), \
|
: "r" (__value), \
|
||||||
"r" (offsetof (struct _pthread_descr_struct, \
|
"r" (offsetof (struct _pthread_descr_struct, \
|
||||||
member))); \
|
member))); \
|
||||||
@ -202,7 +203,7 @@ extern int __arch_prctl (int __code, unsigned long __addr);
|
|||||||
/* There should not be any value with a size other than 1, 4 or 8. */\
|
/* There should not be any value with a size other than 1, 4 or 8. */\
|
||||||
abort (); \
|
abort (); \
|
||||||
\
|
\
|
||||||
__asm__ __volatile__ ("movq %0,%%gs:(%1)" : \
|
__asm__ __volatile__ ("movq %0,%%fs:(%1)" : \
|
||||||
: "r" (__value), \
|
: "r" (__value), \
|
||||||
"r" (offsetof (struct _pthread_descr_struct, \
|
"r" (offsetof (struct _pthread_descr_struct, \
|
||||||
member))); \
|
member))); \
|
||||||
|
Loading…
Reference in New Issue
Block a user