[PATCH] Remove second argument from TLS_INIT_TP macro

Roland McGrath roland@hack.frob.com
Tue May 13 17:03:00 GMT 2014


> --- a/nptl/sysdeps/i386/tls.h
> +++ b/nptl/sysdeps/i386/tls.h
> @@ -195,7 +195,7 @@ union user_desc_init
>  /* Code to initially initialize the thread pointer.  This might need
>     special attention since 'errno' is not yet available and if the
>     operation can cause a failure 'errno' must not be touched.  */
> -# define TLS_INIT_TP(thrdescr, secondcall) \
> +# define TLS_INIT_TP(thrdescr) \
>    ({ void *_thrdescr = (thrdescr);					      \
>       tcbhead_t *_head = _thrdescr;					      \
>       union user_desc_init _segdescr;					      \
> @@ -208,10 +208,7 @@ union user_desc_init
>       INIT_SYSINFO;							      \
>  									      \
>       /* The 'entry_number' field.  Let the kernel pick a value.  */	      \
> -     if (secondcall)							      \
> -       _segdescr.vals[0] = TLS_GET_GS () >> 3;				      \
> -     else								      \
> -       _segdescr.vals[0] = -1;						      \
> +     _segdescr.vals[0] = -1;						      \

Please leave a comment behind explaining what -1 means here.

> --- a/sysdeps/generic/tls.h
> +++ b/sysdeps/generic/tls.h
> @@ -59,12 +59,11 @@
>       use the value.
>  
>  
> -     TLS_INIT_TP(tcb, firstcall)
> +     TLS_INIT_TP(tcb)
>  
>       This macro must initialize the thread pointer to enable normal TLS
>       operation.  The first parameter is a pointer to the thread control
> -     block.  The second parameter specifies whether this is the first
> -     call for the TCB.  ld.so calls this macro more than once.
> +     block.

Amend the comment to say that the macro can be used at most once in a
process.

> --- a/sysdeps/mach/hurd/i386/tls.h
> +++ b/sysdeps/mach/hurd/i386/tls.h

Looks OK to me but tschwinge should approve it too.

If the Hurd bit is OK, then the whole patch is OK with the comment changes
I requested above.


Thanks,
Roland



More information about the Libc-alpha mailing list