bionic/libc/arch-arm64/syscalls
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
..
__accept4.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
__brk.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
__connect.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
__epoll_pwait.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
__exit.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
__getcpu.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
__getcwd.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
__getpriority.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
__ioctl.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
__openat.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
__ppoll.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
__pselect6.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
__ptrace.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
__reboot.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
__rt_sigaction.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
__rt_sigpending.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
__rt_sigprocmask.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
__rt_sigsuspend.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
__rt_sigtimedwait.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
__sched_getaffinity.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
__set_tid_address.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
__signalfd4.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
__socket.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
__timer_create.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
__timer_delete.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
__timer_getoverrun.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
__timer_gettime.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
__timer_settime.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
__waitid.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
_exit.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
acct.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
bind.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
capget.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
capset.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
chdir.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
chroot.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
clock_getres.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
clock_gettime.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
clock_nanosleep.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
clock_settime.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
close.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
delete_module.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
dup3.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
dup.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
epoll_create1.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
epoll_ctl.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
eventfd.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
execve.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
faccessat.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
fallocate.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
fchdir.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
fchmod.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
fchmodat.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
fchown.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
fchownat.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
fcntl.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
fdatasync.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
fgetxattr.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
flistxattr.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
flock.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
fremovexattr.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
fsetxattr.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
fstat64.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
fstatat64.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
fstatfs64.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
fsync.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
ftruncate.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
getdents.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
getegid.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
geteuid.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
getgid.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
getgroups.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
getitimer.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
getpeername.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
getpgid.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
getpid.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
getppid.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
getresgid.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
getresuid.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
getrlimit.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
getrusage.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
getsid.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
getsockname.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
getsockopt.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
gettid.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
gettimeofday.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
getuid.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
getxattr.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
init_module.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
inotify_add_watch.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
inotify_init1.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
inotify_rm_watch.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
ioprio_get.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
ioprio_set.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
kill.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
klogctl.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
lgetxattr.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
linkat.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
listen.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
listxattr.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
llistxattr.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
lremovexattr.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
lseek.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
lsetxattr.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
madvise.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
mincore.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
mkdirat.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
mknodat.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
mlock.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
mlockall.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
mmap.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
mount.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
mprotect.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
mremap.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
msync.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
munlock.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
munlockall.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
munmap.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
nanosleep.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
personality.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
pipe2.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
prctl.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
pread64.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
prlimit64.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
pwrite64.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
read.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
readahead.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
readlinkat.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
readv.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
recvfrom.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
recvmmsg.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
recvmsg.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
removexattr.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
renameat.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
sched_get_priority_max.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
sched_get_priority_min.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
sched_getparam.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
sched_getscheduler.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
sched_rr_get_interval.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
sched_setaffinity.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
sched_setparam.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
sched_setscheduler.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
sched_yield.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
sendfile.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
sendmmsg.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
sendmsg.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
sendto.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
setgid.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
setgroups.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
setitimer.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
setns.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
setpgid.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
setpriority.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
setregid.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
setresgid.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
setresuid.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
setreuid.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
setrlimit.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
setsid.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
setsockopt.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
settimeofday.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
setuid.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
setxattr.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
shutdown.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
sigaltstack.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
socketpair.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
statfs64.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
swapoff.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
swapon.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
symlinkat.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
sync.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
sysinfo.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
tgkill.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
timerfd_create.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
timerfd_gettime.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
timerfd_settime.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
times.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
truncate.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
umask.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
umount2.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
uname.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
unlinkat.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
unshare.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
utimensat.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
wait4.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
write.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00
writev.S Add cfi directives for arm64 assembler. 2014-05-21 17:46:52 -07:00