Jeremy Fitzhardinge 75d6dc8434 This change implements the TLS extension to the x86 ABI. This allows
threads to have thread-private data which is quickly accessible via a
segment in the GDT, stored in %gs.  The patch implements the relevent
syscalls (setthreadarea), and also manages switching the VCPU's segment
information at thread context-switch time.  Mostly Tom Hughes' work.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2215
2004-01-21 01:27:27 +00:00

21 lines
259 B
C

#include <pthread.h>
extern __thread int so_extern;
static __thread int so_local;
extern __thread int global;
int *test_so_extern(void)
{
return &so_extern;
}
int *test_so_local(void)
{
return &so_local;
}
int *test_so_global(void)
{
return &global;
}