This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: [PATCH] PPC linuxthreads tls.h fix
- From: Paul Mackerras <paulus at samba dot org>
- To: sjmunroe at vnet dot ibm dot com
- Cc: libc-alpha <libc-alpha at sources dot redhat dot com>,Franz-Sirl <Franz-Sirl at lauterbach dot com>,Alan Modra <amodra at bigpond dot net dot au>
- Date: Fri, 28 Feb 2003 12:00:26 +1100
- Subject: Re: [PATCH] PPC linuxthreads tls.h fix
- References: <3E5EA083.86C88304@us.ibm.com>
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.