bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [PATCH] linuxthreads/sysdeps/i386/useldt.h


From: Roland McGrath
Subject: RE: [PATCH] linuxthreads/sysdeps/i386/useldt.h
Date: Sat, 24 Feb 2001 18:23:43 -0500 (EST)

What is wrong with using:

extern struct _pthread_descr_struct _mydata_ __asm__("%gs:0");
#define THREAD_GETMEM(d, mem) (_mydata.mem)

I don't know if this hack works for every asm syntax, but it does for the
linux/x86 gas syntax and with what GCC generates for simple global variable
accesses.  I imagine it will produce invalid asm syntax for something like
taking the address of _mydata.foo, but if the only uses of this magic
declaration are in THREAD_GETMEM/THREAD_SETMEM, and perhaps adding a
volatile to the decl, then it should be fine.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]