Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Aug 2003 20:55:29 -0400 (EDT)
From:      Daniel Eischen <eischen@vigrid.com>
To:        Julian Elischer <julian@elischer.org>
Cc:        freebsd-threads@freebsd.org
Subject:   Re: cvs commit: src/sys/i386/i386 sys_machdep.c
Message-ID:  <Pine.GSO.4.10.10308052044200.17786-100000@pcnet5.pcnet.com>
In-Reply-To: <Pine.BSF.4.21.0308051719440.82100-100000@InterJet.elischer.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 5 Aug 2003, Julian Elischer wrote:

> Warning warning warning....
> 
> The code that Dan shows ends up pointing %gs to the struct pthread
> structure.. however the ELF i386 (and amd64) ABI for TLS assumes that it
> points to a POINTER to the TCB (is that the same thing?). If the TCB
> (Thread control block) is the same thing as the struct pthread then you
> should probably make the first entry be a pointer to istelf or the TLS
> code generated by the linker (when enabled) will point to the wrong
> thing..

For libthr, the struct pthread isn't really the thread control
block.  struct pthread is MI, so you can't rely on it having
a layout that will satisfy all the ABIs.  It isn't correct
now for i386.

libthr will likely need the same sort of arch-dependent
hooks that libpthread just grew (minus the struct kcb
stuff).  The patch I posted just addresses auto-ldt
allocation.

> 
> With the array there is now it just happens to come out right.

But it doesn't really, since the first slot of struct pthread
is not a pointer to the dynamic TLS.

-- 
Dan Eischen



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.10.10308052044200.17786-100000>