diff options
author | davidxu <davidxu@FreeBSD.org> | 2003-07-31 22:06:36 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2003-07-31 22:06:36 +0000 |
commit | beddecf91d81ec7b63547c8734710e2a9ce85155 (patch) | |
tree | 3b8b752ea09d3b4696d41026e834c2a9ec2a8f1d /lib | |
parent | fd30158300877584b9b0ab481091d9e7cba85ff7 (diff) | |
download | FreeBSD-src-beddecf91d81ec7b63547c8734710e2a9ce85155.zip FreeBSD-src-beddecf91d81ec7b63547c8734710e2a9ce85155.tar.gz |
Use FSBase to map kse, GCC generates code which uses %fs to access TLS data.
Reminded by: marcel
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libpthread/arch/amd64/include/ksd.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libpthread/arch/amd64/include/ksd.h b/lib/libpthread/arch/amd64/include/ksd.h index ce2b422..843d184 100644 --- a/lib/libpthread/arch/amd64/include/ksd.h +++ b/lib/libpthread/arch/amd64/include/ksd.h @@ -57,7 +57,7 @@ struct pthread; __ksd_type(name) __result; \ \ u_long __i; \ - __asm __volatile("movq %%gs:%1, %0" \ + __asm __volatile("movq %%fs:%1, %0" \ : "=r" (__i) \ : "m" (*(u_long *)(__ksd_offset(name)))); \ __result = *(__ksd_type(name) *)&__i; \ @@ -73,7 +73,7 @@ struct pthread; \ u_long __i; \ __i = *(u_long *)&__val; \ - __asm __volatile("movq %1,%%gs:%0" \ + __asm __volatile("movq %1,%%fs:%0" \ : "=m" (*(u_long *)(__ksd_offset(name))) \ : "r" (__i)); \ }) @@ -85,7 +85,7 @@ __ksd_readandclear64(volatile u_long *addr) __asm __volatile ( " xorq %0, %0;" - " xchgq %%gs:%1, %0;" + " xchgq %%fs:%1, %0;" "# __ksd_readandclear64" : "=&r" (result) : "m" (*addr)); @@ -126,7 +126,7 @@ _ksd_destroy(struct ksd *ksd) static __inline int _ksd_setprivate(struct ksd *ksd) { - return (sysarch(AMD64_SET_GSBASE, &ksd->base)); + return (sysarch(AMD64_SET_FSBASE, &ksd->base)); } #endif |