Remove unnecessary instructions from x86/x86_64 syscalls.

__set_errno returns -1 exactly so that callers don't need to bother.
The other architectures were already taking advantage of this, but
no one had ever fixed x86 and x86_64.

Change-Id: Ie131494be664f6c4a1bbf8c61bbbed58eac56122
This commit is contained in:
Elliott Hughes 2014-06-05 17:24:30 -07:00
parent 50b79530c6
commit 15a0456d0b
386 changed files with 1 additions and 388 deletions

View File

@ -34,7 +34,6 @@ ENTRY(__bionic_clone)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
jmp .L_bc_return
.L_bc_child:

View File

@ -40,7 +40,6 @@ ENTRY(syscall)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
# Restore the callee save registers.
pop %ebp

View File

@ -39,7 +39,6 @@ ENTRY(vfork)
negl %eax
pushl %eax
call __set_errno
orl $-1, %eax
1:
jmp *%ecx // Jump to the stored return address.
jmp *%ecx // Jump to the stored return address.
END(vfork)

View File

@ -20,7 +20,6 @@ ENTRY(__accept4)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ecx
popl %ebx

View File

@ -15,7 +15,6 @@ ENTRY(__brk)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ebx
ret

View File

@ -20,7 +20,6 @@ ENTRY(__connect)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ecx
popl %ebx

View File

@ -35,7 +35,6 @@ ENTRY(__epoll_pwait)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ebp
popl %edi

View File

@ -15,7 +15,6 @@ ENTRY(__exit)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ebx
ret

View File

@ -23,7 +23,6 @@ ENTRY(__fcntl64)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %edx
popl %ecx

View File

@ -23,7 +23,6 @@ ENTRY(__fstatfs64)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %edx
popl %ecx

View File

@ -23,7 +23,6 @@ ENTRY(__getcpu)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %edx
popl %ecx

View File

@ -19,7 +19,6 @@ ENTRY(__getcwd)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ecx
popl %ebx

View File

@ -19,7 +19,6 @@ ENTRY(__getpriority)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ecx
popl %ebx

View File

@ -23,7 +23,6 @@ ENTRY(__ioctl)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %edx
popl %ecx

View File

@ -31,7 +31,6 @@ ENTRY(__llseek)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %edi
popl %esi

View File

@ -35,7 +35,6 @@ ENTRY(__mmap2)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ebp
popl %edi

View File

@ -27,7 +27,6 @@ ENTRY(__openat)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %esi
popl %edx

View File

@ -31,7 +31,6 @@ ENTRY(__ppoll)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %edi
popl %esi

View File

@ -35,7 +35,6 @@ ENTRY(__pselect6)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ebp
popl %edi

View File

@ -27,7 +27,6 @@ ENTRY(__ptrace)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %esi
popl %edx

View File

@ -27,7 +27,6 @@ ENTRY(__reboot)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %esi
popl %edx

View File

@ -27,7 +27,6 @@ ENTRY(__rt_sigaction)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %esi
popl %edx

View File

@ -19,7 +19,6 @@ ENTRY(__rt_sigpending)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ecx
popl %ebx

View File

@ -27,7 +27,6 @@ ENTRY(__rt_sigprocmask)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %esi
popl %edx

View File

@ -19,7 +19,6 @@ ENTRY(__rt_sigsuspend)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ecx
popl %ebx

View File

@ -27,7 +27,6 @@ ENTRY(__rt_sigtimedwait)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %esi
popl %edx

View File

@ -23,7 +23,6 @@ ENTRY(__sched_getaffinity)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %edx
popl %ecx

View File

@ -15,7 +15,6 @@ ENTRY(__set_thread_area)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ebx
ret

View File

@ -15,7 +15,6 @@ ENTRY(__set_tid_address)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ebx
ret

View File

@ -23,7 +23,6 @@ ENTRY(__sigaction)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %edx
popl %ecx

View File

@ -27,7 +27,6 @@ ENTRY(__signalfd4)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %esi
popl %edx

View File

@ -20,7 +20,6 @@ ENTRY(__socket)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ecx
popl %ebx

View File

@ -23,7 +23,6 @@ ENTRY(__statfs64)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %edx
popl %ecx

View File

@ -23,7 +23,6 @@ ENTRY(__timer_create)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %edx
popl %ecx

View File

@ -15,7 +15,6 @@ ENTRY(__timer_delete)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ebx
ret

View File

@ -15,7 +15,6 @@ ENTRY(__timer_getoverrun)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ebx
ret

View File

@ -19,7 +19,6 @@ ENTRY(__timer_gettime)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ecx
popl %ebx

View File

@ -27,7 +27,6 @@ ENTRY(__timer_settime)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %esi
popl %edx

View File

@ -31,7 +31,6 @@ ENTRY(__waitid)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %edi
popl %esi

View File

@ -15,7 +15,6 @@ ENTRY(_exit)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ebx
ret

View File

@ -15,7 +15,6 @@ ENTRY(acct)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ebx
ret

View File

@ -20,7 +20,6 @@ ENTRY(bind)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ecx
popl %ebx

View File

@ -19,7 +19,6 @@ ENTRY(capget)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ecx
popl %ebx

View File

@ -19,7 +19,6 @@ ENTRY(capset)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ecx
popl %ebx

View File

@ -15,7 +15,6 @@ ENTRY(chdir)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ebx
ret

View File

@ -15,7 +15,6 @@ ENTRY(chroot)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ebx
ret

View File

@ -19,7 +19,6 @@ ENTRY(clock_getres)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ecx
popl %ebx

View File

@ -19,7 +19,6 @@ ENTRY(clock_gettime)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ecx
popl %ebx

View File

@ -27,7 +27,6 @@ ENTRY(clock_nanosleep)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %esi
popl %edx

View File

@ -19,7 +19,6 @@ ENTRY(clock_settime)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ecx
popl %ebx

View File

@ -15,7 +15,6 @@ ENTRY(close)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ebx
ret

View File

@ -19,7 +19,6 @@ ENTRY(delete_module)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ecx
popl %ebx

View File

@ -15,7 +15,6 @@ ENTRY(dup)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ebx
ret

View File

@ -23,7 +23,6 @@ ENTRY(dup3)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %edx
popl %ecx

View File

@ -15,7 +15,6 @@ ENTRY(epoll_create1)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ebx
ret

View File

@ -27,7 +27,6 @@ ENTRY(epoll_ctl)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %esi
popl %edx

View File

@ -19,7 +19,6 @@ ENTRY(eventfd)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ecx
popl %ebx

View File

@ -23,7 +23,6 @@ ENTRY(execve)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %edx
popl %ecx

View File

@ -27,7 +27,6 @@ ENTRY(faccessat)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %esi
popl %edx

View File

@ -35,7 +35,6 @@ ENTRY(fallocate64)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ebp
popl %edi

View File

@ -15,7 +15,6 @@ ENTRY(fchdir)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ebx
ret

View File

@ -19,7 +19,6 @@ ENTRY(fchmod)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ecx
popl %ebx

View File

@ -27,7 +27,6 @@ ENTRY(fchmodat)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %esi
popl %edx

View File

@ -23,7 +23,6 @@ ENTRY(fchown)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %edx
popl %ecx

View File

@ -31,7 +31,6 @@ ENTRY(fchownat)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %edi
popl %esi

View File

@ -15,7 +15,6 @@ ENTRY(fdatasync)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ebx
ret

View File

@ -27,7 +27,6 @@ ENTRY(fgetxattr)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %esi
popl %edx

View File

@ -23,7 +23,6 @@ ENTRY(flistxattr)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %edx
popl %ecx

View File

@ -19,7 +19,6 @@ ENTRY(flock)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ecx
popl %ebx

View File

@ -19,7 +19,6 @@ ENTRY(fremovexattr)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ecx
popl %ebx

View File

@ -31,7 +31,6 @@ ENTRY(fsetxattr)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %edi
popl %esi

View File

@ -19,7 +19,6 @@ ENTRY(fstat64)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ecx
popl %ebx

View File

@ -27,7 +27,6 @@ ENTRY(fstatat64)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %esi
popl %edx

View File

@ -15,7 +15,6 @@ ENTRY(fsync)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ebx
ret

View File

@ -19,7 +19,6 @@ ENTRY(ftruncate)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ecx
popl %ebx

View File

@ -23,7 +23,6 @@ ENTRY(ftruncate64)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %edx
popl %ecx

View File

@ -23,7 +23,6 @@ ENTRY(getdents)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %edx
popl %ecx

View File

@ -11,7 +11,6 @@ ENTRY(getegid)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
ret
END(getegid)

View File

@ -11,7 +11,6 @@ ENTRY(geteuid)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
ret
END(geteuid)

View File

@ -11,7 +11,6 @@ ENTRY(getgid)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
ret
END(getgid)

View File

@ -19,7 +19,6 @@ ENTRY(getgroups)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ecx
popl %ebx

View File

@ -19,7 +19,6 @@ ENTRY(getitimer)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ecx
popl %ebx

View File

@ -20,7 +20,6 @@ ENTRY(getpeername)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ecx
popl %ebx

View File

@ -15,7 +15,6 @@ ENTRY(getpgid)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ebx
ret

View File

@ -11,7 +11,6 @@ ENTRY(getpid)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
ret
END(getpid)

View File

@ -11,7 +11,6 @@ ENTRY(getppid)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
ret
END(getppid)

View File

@ -23,7 +23,6 @@ ENTRY(getresgid)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %edx
popl %ecx

View File

@ -23,7 +23,6 @@ ENTRY(getresuid)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %edx
popl %ecx

View File

@ -19,7 +19,6 @@ ENTRY(getrlimit)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ecx
popl %ebx

View File

@ -19,7 +19,6 @@ ENTRY(getrusage)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ecx
popl %ebx

View File

@ -15,7 +15,6 @@ ENTRY(getsid)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ebx
ret

View File

@ -20,7 +20,6 @@ ENTRY(getsockname)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ecx
popl %ebx

View File

@ -20,7 +20,6 @@ ENTRY(getsockopt)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ecx
popl %ebx

View File

@ -19,7 +19,6 @@ ENTRY(gettimeofday)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ecx
popl %ebx

View File

@ -11,7 +11,6 @@ ENTRY(getuid)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
ret
END(getuid)

View File

@ -27,7 +27,6 @@ ENTRY(getxattr)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %esi
popl %edx

View File

@ -23,7 +23,6 @@ ENTRY(init_module)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %edx
popl %ecx

View File

@ -23,7 +23,6 @@ ENTRY(inotify_add_watch)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %edx
popl %ecx

View File

@ -15,7 +15,6 @@ ENTRY(inotify_init1)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ebx
ret

View File

@ -19,7 +19,6 @@ ENTRY(inotify_rm_watch)
pushl %eax
call __set_errno
addl $4, %esp
orl $-1, %eax
1:
popl %ecx
popl %ebx

Some files were not shown because too many files have changed in this diff Show More