[PATCH] PPC linuxthreads tls.h fix

Paul Mackerras paulus@samba.org
Fri Feb 28 01:02:00 GMT 2003


Steven Munroe writes:

> The PPC32/PPC64 TLS ABIs specify that the tcb is exactly 8/16 bytes and
> that the first word/doubleword of the tcb is the dtv pointer. Similar to
> Alpha.

That is true, but this tcbhead_t definition is used for both TLS and
non-TLS, and the ppc32 non-TLS code assumes that the tcbhead_t has a
multiple_threads field.

I would like a multiple_threads field in the tcbhead_t in the TLS case
for ppc32 as well, since it would make the check for multiple threads
fast and easy.  I will talk to Alan about expanding the TCB to 16
bytes on ppc32 to accommodate that.

There remains a question as to how/where to initialize the
multiple_threads member.  In the non-TLS case the tcbhead_t overlays
the start of the _pthread_descr_struct, and pthread_handle_create will
set the multiple_threads field for us.  In the TLS case, since we
define TLS_DTV_AT_TP, the tcbhead_t comes after the
_pthread_descr_struct and won't get initialized by the generic
linuxthreads code, and we'll have to do it somewhere else, possibly in
TLS_INIT_TP.

Regards,
Paul.



More information about the Libc-alpha mailing list