cvs commit: src/sys/sys tls.h src/lib/libc/gen tls.c src/lib/libthread_xu/arch/amd64/amd64 pthread_md.c src/lib/libthread_xu/arch/i386/i386 pthread_md.c src/libexec/rtld-elf rtld.c rtld.h rtld_tls.h src/libexec/rtld-elf/i386 reloc.c

Joerg Sonnenberger joerg at britannica.bec.de
Mon Mar 28 09:57:02 PST 2005


On Mon, Mar 28, 2005 at 09:50:34AM -0800, Matthew Dillon wrote:
> 
> :I should add that I mean the following tcb layout:
> :struct tls_tcb {
> :#ifdef INDIRECT_THREAD_REGISTER
> :	struct tls_tcb *tcb_base;
> :#endif
> :	void *dtv_base;
> :	void *tcb_pthread;
> :}
> :
> :Joerg
> 
>     I would not do that.  I would just make tcb_base mandatory (which
>     is what it is now).  There is no reason to make it optional and
>     every reason to make it mandatory.  It means we automatically support
>     dynamic link libraries and binaries using either method.

It should be optional (based on the platform), since some platforms
need / want it and some don't. We need that pointer for both methods
on IA32, on platforms with a normal pointer as thread register we don't
need it at all.

This is not about
__thread int a;

testfunc()
{
	a = 1;
}

but about
int *testfunc()
{
	return &a;
}

The conditional allows us to support both styles in MI code. Let me finish
my patchset to show what I mean.

Joerg





More information about the Commits mailing list