bionic/libc/arch-mips/bionic
Elliott Hughes b30aff405a Revert "Revert "Lose the hand-written futex assembler.""
The problem with the original patch was that using syscall(3) means that
errno can be set, but pthread_create(3) was abusing the TLS errno slot as
a pthread_mutex_t for the thread startup handshake.

There was also a mistake in the check for syscall failures --- it should
have checked against -1 instead of 0 (not just because that's the default
idiom, but also here because futex(2) can legitimately return values > 0).

This patch stops abusing the TLS errno slot and adds a pthread_mutex_t to
pthread_internal_t instead. (Note that for LP64 sizeof(pthread_mutex_t) >
sizeof(uintptr_t), so we could potentially clobber other TLS slots too.)

I've also rewritten the LP32 compatibility stubs to directly reuse the
code from the .h file.

This reverts commit 75c55ff84e.

Bug: 15195455
Change-Id: I6ffb13e5cf6a35d8f59f692d94192aae9ab4593d
2014-05-28 18:31:15 -07:00
..
__bionic_clone.S Clear the return address register in __bionic_clone. 2014-05-27 15:49:51 -07:00
__get_sp.S Hide __get_sp. 2014-05-20 20:22:50 -07:00
_exit_with_stack_teardown.S Hide _exit_with_stack_teardown. 2014-05-16 16:17:44 -07:00
_setjmp.S Unify our assembler macros. 2014-02-20 13:51:26 -08:00
atexit.h [MIPS] Rewrite MIPS crtbegin* as C files. 2013-07-17 14:23:29 -07:00
bzero.S Unify our assembler macros. 2014-02-20 13:51:26 -08:00
cacheflush.cpp Clean up cacheflush. 2014-02-11 10:24:40 -08:00
crtbegin_so.c Fix x86_64 build, clean up intermediate libraries. 2013-10-09 16:00:17 -07:00
crtbegin.c Fix x86_64 build, clean up intermediate libraries. 2013-10-09 16:00:17 -07:00
memcmp16.S Unify our assembler macros. 2014-02-20 13:51:26 -08:00
setjmp.S Unify our assembler macros. 2014-02-20 13:51:26 -08:00
sigsetjmp.S Unify our assembler macros. 2014-02-20 13:51:26 -08:00
syscall.S Unify our assembler macros. 2014-02-20 13:51:26 -08:00
vfork.S Unify our assembler macros. 2014-02-20 13:51:26 -08:00