glibc/sysdeps/nptl
Adhemerval Zanella 06be6368da nptl: Define __PTHREAD_MUTEX_{NUSERS_AFTER_KIND,USE_UNION}
This patch adds two new internal defines to set the internal
pthread_mutex_t layout required by the supported ABIS:

  1. __PTHREAD_MUTEX_NUSERS_AFTER_KIND which control whether to define
     __nusers fields before or after __kind.  The preferred value for
     is 0 for new ports and it sets __nusers before __kind.

  2. __PTHREAD_MUTEX_USE_UNION which control whether internal __spins and
     __list members will be place inside an union for linuxthreads
     compatibility.  The preferred value is 0 for ports and it sets
     to not use an union to define both fields.

It fixes the wrong offsets value for __kind value on x86_64-linux-gnu-x32.
Checked with a make check run-built-tests=no on all afected ABIs.

	[BZ #22298]
	* nptl/allocatestack.c (allocate_stack): Check if
	__PTHREAD_MUTEX_HAVE_PREV is non-zero, instead if
	__PTHREAD_MUTEX_HAVE_PREV is defined.
	* nptl/descr.h (pthread): Likewise.
	* nptl/nptl-init.c (__pthread_initialize_minimal_internal):
	Likewise.
	* nptl/pthread_create.c (START_THREAD_DEFN): Likewise.
	* sysdeps/nptl/fork.c (__libc_fork): Likewise.
	* sysdeps/nptl/pthread.h (PTHREAD_MUTEX_INITIALIZER): Likewise.
	* sysdeps/nptl/bits/thread-shared-types.h
	(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION): New
	defines.
	(__pthread_internal_list): Check __PTHREAD_MUTEX_USE_UNION instead
	of __WORDSIZE for internal layout.
	(__pthread_mutex_s): Check __PTHREAD_MUTEX_NUSERS_AFTER_KIND instead
	of __WORDSIZE for internal __nusers layout and __PTHREAD_MUTEX_USE_UNION
	instead of __WORDSIZE whether to use an union for __spins and __list
	fields.
	(__PTHREAD_MUTEX_HAVE_PREV): Define also for __PTHREAD_MUTEX_USE_UNION
	case.
	* sysdeps/aarch64/nptl/bits/pthreadtypes-arch.h
	(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION): New
	defines.
	* sysdeps/alpha/nptl/bits/pthreadtypes-arch.h
	(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION):
	Likewise.
	* sysdeps/arm/nptl/bits/pthreadtypes-arch.h
	(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION):
	Likewise.
	* sysdeps/hppa/nptl/bits/pthreadtypes-arch.h
	(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION):
	Likewise.
	* sysdeps/ia64/nptl/bits/pthreadtypes-arch.h
	(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION):
	Likewise.
	* sysdeps/m68k/nptl/bits/pthreadtypes-arch.h
	(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION):
	Likewise.
	* sysdeps/microblaze/nptl/bits/pthreadtypes-arch.h
	(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION):
	Likewise.
	* sysdeps/mips/nptl/bits/pthreadtypes-arch.h
	(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION):
	Likewise.
	* sysdeps/nios2/nptl/bits/pthreadtypes-arch.h
	(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION):
	Likewise.
	* sysdeps/powerpc/nptl/bits/pthreadtypes-arch.h
	(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION):
	Likewise.
	* sysdeps/s390/nptl/bits/pthreadtypes-arch.h
	(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION):
	Likewise.
	* sysdeps/sh/nptl/bits/pthreadtypes-arch.h
	(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION):
	Likewise.
	* sysdeps/sparc/nptl/bits/pthreadtypes-arch.h
	(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION):
	Likewise.
	* sysdeps/tile/nptl/bits/pthreadtypes-arch.h
	(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION):
	Likewise.
	* sysdeps/x86/nptl/bits/pthreadtypes-arch.h
	(__PTHREAD_MUTEX_NUSERS_AFTER_KIND, __PTHREAD_MUTEX_USE_UNION):
	Likewise.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2017-11-07 09:48:41 -02:00
..
bits nptl: Define __PTHREAD_MUTEX_{NUSERS_AFTER_KIND,USE_UNION} 2017-11-07 09:48:41 -02:00
sys Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
Implies
Makeconfig Remove add-ons mechanism. 2017-10-05 15:58:13 +00:00
Makefile Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
Subdirs
aio_misc.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
allocrtsig.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
fork.c nptl: Define __PTHREAD_MUTEX_{NUSERS_AFTER_KIND,USE_UNION} 2017-11-07 09:48:41 -02:00
fork.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
futex-internal.h Narrowing the visibility of libc-internal.h even further. 2017-03-01 20:33:46 -05:00
gai_misc.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
internaltypes.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
jmp-unwind.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
libc-lock.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
libc-lockP.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
librt-cancellation.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
lowlevellock-futex.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
lowlevellock.h Add __glibc_unlikely hint in lll_trylock, lll_cond_trylock. 2017-02-06 13:46:01 +01:00
malloc-machine.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
nptl-signals.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
pthread-functions.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
pthread.h nptl: Define __PTHREAD_MUTEX_{NUSERS_AFTER_KIND,USE_UNION} 2017-11-07 09:48:41 -02:00
setxid.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
shm-directory.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sigfillset.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
stdio-lock.h Remove _IO_MTSAFE_IO from public headers. 2017-05-11 19:14:11 -04:00
tcb-offsets.h
tst-mqueue8x.c
unwind-forcedunwind.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00