fs/gs for thread local storage

Vedavyas Duggirala vduggira@gmail.com
Fri Aug 6 18:53:00 GMT 2010


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



More information about the Libc-help mailing list