This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: fs/gs for thread local storage
- From: Vedavyas Duggirala <vduggira at gmail dot com>
- To: libc-help at sourceware dot org
- Date: Fri, 6 Aug 2010 14:53:24 -0400
- Subject: Re: fs/gs for thread local storage
- References: <AANLkTi=JVjkab1PFE7PmpKc=OZyPjv8ormwNvx46PcUT@mail.gmail.com>
Hi,
x86_64 uses fs register for tls while x86_32 uses gs register. I am
interested in using the spare register(gs on 64bit and fs on 32bit)
for my own purpose. Are they available ? arch_prctl has ARCH_SET_GS
option so I assume that is available. But on 32 bit the kernels struct
thread_struct in task_struct doesn't have fs register. Does that mean
it is available or used for some other purpose.
I am curious if there is any reason why both architectures picked
different registers.
thank you,
Ved
PS: Can you cc me on the reply. I am not subscribed to the list