Compare commits

..

1 Commits

Author SHA1 Message Date
Geremy Condra
fc89980c7b Ensure that the port number and TXID are properly randomized.
This fix reads from /dev/urandom to get the required entropy.

Bug: 6535492
Change-Id: Ibc2fec3f71a67607b608ad9b767b0b6504993c1d
2012-05-30 18:18:00 -07:00
2789 changed files with 67030 additions and 110908 deletions

6
MAINTAINERS Normal file
View File

@@ -0,0 +1,6 @@
Bionic support for SuperH
-------------------------
Bionic support for SuperH architecture is written by
Shin-ichiro KAWASAKI <shinichiro.kawasaki.mg@hitachi.com>
and Contributed to Android by Hitachi, Ltd. and Renesas Solutions Corp.

10
ThirdPartyProject.prop Normal file
View File

@@ -0,0 +1,10 @@
# Copyright 2010 Google Inc. All Rights Reserved.
#Fri Jul 16 10:03:08 PDT 2010
currentVersion=Unknown
version=Unknown
isNative=true
feedurl=http\://www.openbsd.org/security.html
name=openbsd
keywords=openbsd
onDevice=true
homepage=http\://openbsd.org

View File

@@ -8,13 +8,72 @@ libc_common_src_files := \
$(syscall_src) \ $(syscall_src) \
unistd/abort.c \ unistd/abort.c \
unistd/alarm.c \ unistd/alarm.c \
unistd/brk.c \
unistd/creat.c \
unistd/daemon.c \
unistd/eventfd.c \
unistd/exec.c \ unistd/exec.c \
unistd/fcntl.c \
unistd/fnmatch.c \ unistd/fnmatch.c \
unistd/fstatfs.c \
unistd/ftime.c \
unistd/ftok.c \
unistd/getcwd.c \
unistd/getdtablesize.c \
unistd/gethostname.c \
unistd/getopt_long.c \ unistd/getopt_long.c \
unistd/getpgrp.c \
unistd/getpriority.c \
unistd/getpt.c \
unistd/initgroups.c \
unistd/isatty.c \
unistd/issetugid.c \
unistd/killpg.c \
unistd/lseek64.c \
unistd/mmap.c \
unistd/nice.c \
unistd/open.c \
unistd/openat.c \
unistd/opendir.c \
unistd/pathconf.c \
unistd/perror.c \
unistd/popen.c \ unistd/popen.c \
unistd/pread.c \
unistd/pselect.c \
unistd/ptsname.c \
unistd/ptsname_r.c \
unistd/pwrite.c \
unistd/raise.c \
unistd/reboot.c \
unistd/recv.c \
unistd/sbrk.c \
unistd/send.c \
unistd/setegid.c \
unistd/setuid.c \
unistd/seteuid.c \
unistd/setreuid.c \
unistd/setresuid.c \
unistd/setpgrp.c \
unistd/sigblock.c \
unistd/siginterrupt.c \
unistd/siglist.c \
unistd/signal.c \
unistd/signame.c \
unistd/sigsetmask.c \
unistd/sigsuspend.c \
unistd/sigwait.c \
unistd/sleep.c \
unistd/statfs.c \
unistd/strsignal.c \
unistd/syslog.c \ unistd/syslog.c \
unistd/system.c \ unistd/system.c \
unistd/tcgetpgrp.c \
unistd/tcsetpgrp.c \
unistd/time.c \ unistd/time.c \
unistd/umount.c \
unistd/unlockpt.c \
unistd/usleep.c \
unistd/wait.c \
stdio/asprintf.c \ stdio/asprintf.c \
stdio/clrerr.c \ stdio/clrerr.c \
stdio/fclose.c \ stdio/fclose.c \
@@ -29,6 +88,7 @@ libc_common_src_files := \
stdio/fileno.c \ stdio/fileno.c \
stdio/findfp.c \ stdio/findfp.c \
stdio/flags.c \ stdio/flags.c \
stdio/flockfile.c \
stdio/fopen.c \ stdio/fopen.c \
stdio/fprintf.c \ stdio/fprintf.c \
stdio/fpurge.c \ stdio/fpurge.c \
@@ -67,6 +127,7 @@ libc_common_src_files := \
stdio/sscanf.c \ stdio/sscanf.c \
stdio/stdio.c \ stdio/stdio.c \
stdio/tempnam.c \ stdio/tempnam.c \
stdio/tmpfile.c \
stdio/tmpnam.c \ stdio/tmpnam.c \
stdio/ungetc.c \ stdio/ungetc.c \
stdio/vasprintf.c \ stdio/vasprintf.c \
@@ -79,13 +140,32 @@ libc_common_src_files := \
stdio/vsscanf.c \ stdio/vsscanf.c \
stdio/wbuf.c \ stdio/wbuf.c \
stdio/wsetup.c \ stdio/wsetup.c \
stdlib/_rand48.c \
stdlib/assert.c \
stdlib/atexit.c \ stdlib/atexit.c \
stdlib/atoi.c \
stdlib/atol.c \
stdlib/atoll.c \
stdlib/bsearch.c \
stdlib/ctype_.c \ stdlib/ctype_.c \
stdlib/div.c \
stdlib/exit.c \ stdlib/exit.c \
stdlib/getenv.c \ stdlib/getenv.c \
stdlib/jrand48.c \
stdlib/ldiv.c \
stdlib/lldiv.c \
stdlib/locale.c \
stdlib/lrand48.c \
stdlib/mrand48.c \
stdlib/nrand48.c \
stdlib/putenv.c \ stdlib/putenv.c \
stdlib/qsort.c \ stdlib/qsort.c \
stdlib/seed48.c \
stdlib/setenv.c \ stdlib/setenv.c \
stdlib/setjmperr.c \
stdlib/srand48.c \
stdlib/strntoimax.c \
stdlib/strntoumax.c \
stdlib/strtod.c \ stdlib/strtod.c \
stdlib/strtoimax.c \ stdlib/strtoimax.c \
stdlib/strtol.c \ stdlib/strtol.c \
@@ -95,28 +175,43 @@ libc_common_src_files := \
stdlib/strtoumax.c \ stdlib/strtoumax.c \
stdlib/tolower_.c \ stdlib/tolower_.c \
stdlib/toupper_.c \ stdlib/toupper_.c \
stdlib/wchar.c \
string/index.c \ string/index.c \
string/memccpy.c \
string/memchr.c \
string/memmem.c \
string/memrchr.c \
string/memswap.c \
string/strcasecmp.c \ string/strcasecmp.c \
string/strcasestr.c \
string/strcat.c \ string/strcat.c \
string/strchr.c \ string/strchr.c \
string/strcoll.c \
string/strcspn.c \ string/strcspn.c \
string/strdup.c \ string/strdup.c \
string/strerror.c \
string/strerror_r.c \
string/strlcat.c \ string/strlcat.c \
string/strlcpy.c \ string/strlcpy.c \
string/strncat.c \ string/strncat.c \
string/strncpy.c \ string/strncpy.c \
string/strndup.c \
string/strnlen.c \
string/strpbrk.c \ string/strpbrk.c \
string/strrchr.c \ string/strrchr.c \
string/strsep.c \ string/strsep.c \
string/strspn.c \ string/strspn.c \
string/strstr.c \ string/strstr.c \
string/strtok.c \ string/strtok.c \
string/strtotimeval.c \
string/strxfrm.c \
wchar/wcpcpy.c \ wchar/wcpcpy.c \
wchar/wcpncpy.c \ wchar/wcpncpy.c \
wchar/wcscasecmp.c \ wchar/wcscasecmp.c \
wchar/wcscat.c \ wchar/wcscat.c \
wchar/wcschr.c \ wchar/wcschr.c \
wchar/wcscmp.c \ wchar/wcscmp.c \
wchar/wcscoll.c \
wchar/wcscpy.c \ wchar/wcscpy.c \
wchar/wcscspn.c \ wchar/wcscspn.c \
wchar/wcsdup.c \ wchar/wcsdup.c \
@@ -140,103 +235,59 @@ libc_common_src_files := \
wchar/wmemcpy.c \ wchar/wmemcpy.c \
wchar/wmemmove.c \ wchar/wmemmove.c \
wchar/wmemset.c \ wchar/wmemset.c \
inet/bindresvport.c \
inet/inet_addr.c \
inet/inet_aton.c \
inet/inet_ntoa.c \
inet/inet_ntop.c \
inet/inet_pton.c \
inet/ether_aton.c \
inet/ether_ntoa.c \
tzcode/asctime.c \ tzcode/asctime.c \
tzcode/difftime.c \ tzcode/difftime.c \
tzcode/localtime.c \ tzcode/localtime.c \
tzcode/strftime.c \ tzcode/strftime.c \
tzcode/strptime.c \ tzcode/strptime.c \
bionic/arc4random.c \ bionic/__set_errno.c \
bionic/atoi.c \
bionic/atol.c \
bionic/atoll.c \
bionic/bindresvport.c \
bionic/bionic_clone.c \
bionic/clearenv.c \
bionic/cpuacct.c \ bionic/cpuacct.c \
bionic/daemon.c \ bionic/arc4random.c \
bionic/basename.c \
bionic/basename_r.c \
bionic/clearenv.c \
bionic/dirname.c \
bionic/dirname_r.c \
bionic/drand48.c \
bionic/erand48.c \
bionic/err.c \ bionic/err.c \
bionic/ether_aton.c \
bionic/ether_ntoa.c \
bionic/fcntl.c \
bionic/fdprintf.c \ bionic/fdprintf.c \
bionic/flockfile.c \
bionic/fork.c \ bionic/fork.c \
bionic/fstatfs.c \
bionic/ftime.c \
bionic/ftok.c \
bionic/fts.c \ bionic/fts.c \
bionic/getdtablesize.c \
bionic/gethostname.c \
bionic/getpgrp.c \
bionic/getpriority.c \
bionic/getpt.c \
bionic/if_indextoname.c \
bionic/if_nametoindex.c \ bionic/if_nametoindex.c \
bionic/initgroups.c \ bionic/if_indextoname.c \
bionic/ioctl.c \ bionic/ioctl.c \
bionic/isatty.c \
bionic/issetugid.c \
bionic/ldexp.c \ bionic/ldexp.c \
bionic/libc_init_common.c \
bionic/logd_write.c \ bionic/logd_write.c \
bionic/lseek64.c \
bionic/md5.c \ bionic/md5.c \
bionic/memchr.c \
bionic/memmem.c \
bionic/memmove_words.c \ bionic/memmove_words.c \
bionic/memrchr.c \
bionic/memswap.c \
bionic/mmap.c \
bionic/openat.c \
bionic/open.c \
bionic/pathconf.c \
bionic/perror.c \
bionic/pread.c \
bionic/pselect.c \
bionic/ptsname.c \
bionic/ptsname_r.c \
bionic/pututline.c \ bionic/pututline.c \
bionic/pwrite.c \
bionic/realpath.c \ bionic/realpath.c \
bionic/reboot.c \
bionic/recv.c \
bionic/sched_cpualloc.c \
bionic/sched_cpucount.c \
bionic/sched_getaffinity.c \ bionic/sched_getaffinity.c \
bionic/sched_getcpu.c \ bionic/sched_getcpu.c \
bionic/sched_cpualloc.c \
bionic/sched_cpucount.c \
bionic/semaphore.c \ bionic/semaphore.c \
bionic/send.c \ bionic/sha1.c \
bionic/setegid.c \ bionic/ssp.c \
bionic/seteuid.c \ bionic/stubs.c \
bionic/setpgrp.c \
bionic/setresuid.c \
bionic/setreuid.c \
bionic/setuid.c \
bionic/sigblock.c \
bionic/siginterrupt.c \
bionic/siglist.c \
bionic/signal.c \
bionic/signame.c \
bionic/sigsetmask.c \
bionic/sigsuspend.c \
bionic/sleep.c \
bionic/statfs.c \
bionic/strndup.c \
bionic/strnlen.c \
bionic/strntoimax.c \
bionic/strntoumax.c \
bionic/strtotimeval.c \
bionic/system_properties.c \ bionic/system_properties.c \
bionic/tcgetpgrp.c \
bionic/tcsetpgrp.c \
bionic/thread_atexit.c \
bionic/time64.c \ bionic/time64.c \
bionic/umount.c \ bionic/thread_atexit.c \
bionic/unlockpt.c \ bionic/utime.c \
bionic/usleep.c \
bionic/utmp.c \ bionic/utmp.c \
bionic/wait.c \
bionic/wcscoll.c \
netbsd/gethnamaddr.c \ netbsd/gethnamaddr.c \
netbsd/isc/ev_timers.c \
netbsd/isc/ev_streams.c \
netbsd/inet/nsap_addr.c \ netbsd/inet/nsap_addr.c \
netbsd/resolv/__dn_comp.c \ netbsd/resolv/__dn_comp.c \
netbsd/resolv/__res_close.c \ netbsd/resolv/__res_close.c \
@@ -264,88 +315,10 @@ libc_common_src_files := \
netbsd/nameser/ns_netint.c \ netbsd/nameser/ns_netint.c \
netbsd/nameser/ns_print.c \ netbsd/nameser/ns_print.c \
netbsd/nameser/ns_samedomain.c \ netbsd/nameser/ns_samedomain.c \
regex/regcomp.c \
libc_bionic_src_files := \ regex/regerror.c \
bionic/assert.cpp \ regex/regexec.c \
bionic/brk.cpp \ regex/regfree.c \
bionic/debug_format.cpp \
bionic/dirent.cpp \
bionic/eventfd.cpp \
bionic/__fgets_chk.cpp \
bionic/getauxval.cpp \
bionic/getcwd.cpp \
bionic/libc_init_common.cpp \
bionic/libgen.cpp \
bionic/__memcpy_chk.cpp \
bionic/__memmove_chk.cpp \
bionic/__memset_chk.cpp \
bionic/pthread_sigmask.cpp \
bionic/raise.cpp \
bionic/sbrk.cpp \
bionic/__set_errno.cpp \
bionic/setlocale.cpp \
bionic/signalfd.cpp \
bionic/sigwait.cpp \
bionic/__strcat_chk.cpp \
bionic/__strcpy_chk.cpp \
bionic/strerror.cpp \
bionic/strerror_r.cpp \
bionic/__strlcat_chk.cpp \
bionic/__strlcpy_chk.cpp \
bionic/__strlen_chk.cpp \
bionic/__strncat_chk.cpp \
bionic/__strncpy_chk.cpp \
bionic/strsignal.cpp \
bionic/stubs.cpp \
bionic/tdestroy.cpp \
bionic/tmpfile.cpp \
bionic/__umask_chk.cpp \
bionic/__vsnprintf_chk.cpp \
bionic/__vsprintf_chk.cpp \
bionic/wchar.cpp \
libc_upstream_netbsd_src_files := \
upstream-netbsd/common/lib/libc/hash/sha1/sha1.c \
upstream-netbsd/common/lib/libc/inet/inet_addr.c \
upstream-netbsd/libc/compat-43/creat.c \
upstream-netbsd/libc/gen/ftw.c \
upstream-netbsd/libc/gen/nftw.c \
upstream-netbsd/libc/gen/nice.c \
upstream-netbsd/libc/gen/psignal.c \
upstream-netbsd/libc/gen/setjmperr.c \
upstream-netbsd/libc/gen/utime.c \
upstream-netbsd/libc/inet/inet_ntoa.c \
upstream-netbsd/libc/inet/inet_ntop.c \
upstream-netbsd/libc/inet/inet_pton.c \
upstream-netbsd/libc/isc/ev_streams.c \
upstream-netbsd/libc/isc/ev_timers.c \
upstream-netbsd/libc/regex/regcomp.c \
upstream-netbsd/libc/regex/regerror.c \
upstream-netbsd/libc/regex/regexec.c \
upstream-netbsd/libc/regex/regfree.c \
upstream-netbsd/libc/stdio/getdelim.c \
upstream-netbsd/libc/stdio/getline.c \
upstream-netbsd/libc/stdlib/bsearch.c \
upstream-netbsd/libc/stdlib/div.c \
upstream-netbsd/libc/stdlib/drand48.c \
upstream-netbsd/libc/stdlib/erand48.c \
upstream-netbsd/libc/stdlib/jrand48.c \
upstream-netbsd/libc/stdlib/ldiv.c \
upstream-netbsd/libc/stdlib/lldiv.c \
upstream-netbsd/libc/stdlib/lrand48.c \
upstream-netbsd/libc/stdlib/mrand48.c \
upstream-netbsd/libc/stdlib/nrand48.c \
upstream-netbsd/libc/stdlib/_rand48.c \
upstream-netbsd/libc/stdlib/seed48.c \
upstream-netbsd/libc/stdlib/srand48.c \
upstream-netbsd/libc/stdlib/tdelete.c \
upstream-netbsd/libc/stdlib/tfind.c \
upstream-netbsd/libc/stdlib/tsearch.c \
upstream-netbsd/libc/string/memccpy.c \
upstream-netbsd/libc/string/strcasestr.c \
upstream-netbsd/libc/string/strcoll.c \
upstream-netbsd/libc/string/strxfrm.c \
upstream-netbsd/libc/unistd/killpg.c \
# The following files are common, but must be compiled # The following files are common, but must be compiled
# with different C flags when building a static C library. # with different C flags when building a static C library.
@@ -361,40 +334,39 @@ libc_upstream_netbsd_src_files := \
# below. # below.
# #
libc_static_common_src_files := \ libc_static_common_src_files := \
unistd/sysconf.c \
bionic/__errno.c \ bionic/__errno.c \
bionic/sysconf.cpp \
# Architecture specific source files go here # Architecture specific source files go here
# ========================================================= # =========================================================
ifeq ($(TARGET_ARCH),arm) ifeq ($(TARGET_ARCH),arm)
libc_common_src_files += \ libc_common_src_files += \
arch-arm/bionic/abort_arm.S \ bionic/bionic_clone.c \
arch-arm/bionic/atomics_arm.c \ arch-arm/bionic/__get_pc.S \
arch-arm/bionic/__get_sp.S \
arch-arm/bionic/_exit_with_stack_teardown.S \
arch-arm/bionic/_setjmp.S \
arch-arm/bionic/atomics_arm.S \
arch-arm/bionic/clone.S \ arch-arm/bionic/clone.S \
arch-arm/bionic/eabi.c \ arch-arm/bionic/eabi.c \
arch-arm/bionic/_exit_with_stack_teardown.S \
arch-arm/bionic/ffs.S \ arch-arm/bionic/ffs.S \
arch-arm/bionic/futex_arm.S \
arch-arm/bionic/__get_sp.S \
arch-arm/bionic/kill.S \ arch-arm/bionic/kill.S \
arch-arm/bionic/libgcc_compat.c \ arch-arm/bionic/libgcc_compat.c \
arch-arm/bionic/memcmp16.S \ arch-arm/bionic/tkill.S \
arch-arm/bionic/memcmp.S \ arch-arm/bionic/memcmp.S \
arch-arm/bionic/memcmp16.S \
arch-arm/bionic/memcpy.S \ arch-arm/bionic/memcpy.S \
arch-arm/bionic/memset.S \ arch-arm/bionic/memset.S \
arch-arm/bionic/_setjmp.S \
arch-arm/bionic/setjmp.S \ arch-arm/bionic/setjmp.S \
arch-arm/bionic/sigsetjmp.S \ arch-arm/bionic/sigsetjmp.S \
arch-arm/bionic/strcmp.S \
arch-arm/bionic/strcpy.S \
arch-arm/bionic/strlen.c.arm \ arch-arm/bionic/strlen.c.arm \
arch-arm/bionic/strcpy.S \
arch-arm/bionic/strcmp.S \
arch-arm/bionic/syscall.S \ arch-arm/bionic/syscall.S \
arch-arm/bionic/tgkill.S \ string/memmove.c.arm \
arch-arm/bionic/tkill.S \
bionic/memmove.c.arm \
bionic/socketcalls.c \
string/bcopy.c \ string/bcopy.c \
string/strncmp.c \ string/strncmp.c \
unistd/socketcalls.c
# These files need to be arm so that gdbserver # These files need to be arm so that gdbserver
# can set breakpoints in them without messing # can set breakpoints in them without messing
@@ -407,7 +379,6 @@ libc_common_src_files += \
libc_static_common_src_files += \ libc_static_common_src_files += \
bionic/pthread.c.arm \ bionic/pthread.c.arm \
bionic/pthread_key.cpp.arm \
# these are used by the static and dynamic versions of the libc # these are used by the static and dynamic versions of the libc
# respectively # respectively
@@ -416,16 +387,16 @@ libc_arch_static_src_files := \
libc_arch_dynamic_src_files := \ libc_arch_dynamic_src_files := \
arch-arm/bionic/exidx_dynamic.c arch-arm/bionic/exidx_dynamic.c
endif # arm else # !arm
ifeq ($(TARGET_ARCH),x86) ifeq ($(TARGET_ARCH),x86)
libc_common_src_files += \ libc_common_src_files += \
arch-x86/bionic/__get_sp.S \ arch-x86/bionic/__get_sp.S \
arch-x86/bionic/__get_tls.c \ arch-x86/bionic/__get_tls.c \
arch-x86/bionic/__set_tls.c \ arch-x86/bionic/__set_tls.c \
arch-x86/bionic/atomics_x86.S \
arch-x86/bionic/clone.S \ arch-x86/bionic/clone.S \
arch-x86/bionic/_exit_with_stack_teardown.S \ arch-x86/bionic/_exit_with_stack_teardown.S \
arch-x86/bionic/futex_x86.S \
arch-x86/bionic/setjmp.S \ arch-x86/bionic/setjmp.S \
arch-x86/bionic/_setjmp.S \ arch-x86/bionic/_setjmp.S \
arch-x86/bionic/sigsetjmp.S \ arch-x86/bionic/sigsetjmp.S \
@@ -448,73 +419,69 @@ libc_common_src_files += \
libc_static_common_src_files += \ libc_static_common_src_files += \
bionic/pthread.c \ bionic/pthread.c \
bionic/pthread_key.cpp \
# this is needed for static versions of libc
libc_arch_static_src_files := \ libc_arch_static_src_files := \
bionic/dl_iterate_phdr_static.c arch-x86/bionic/dl_iterate_phdr_static.c
libc_arch_dynamic_src_files := libc_arch_dynamic_src_files :=
endif # x86 else # !x86
ifeq ($(TARGET_ARCH),mips) ifeq ($(TARGET_ARCH),sh)
libc_common_src_files += \ libc_common_src_files += \
arch-mips/bionic/__get_sp.S \ arch-sh/bionic/__get_pc.S \
arch-mips/bionic/__get_tls.c \ arch-sh/bionic/__get_sp.S \
arch-mips/bionic/__set_tls.c \ arch-sh/bionic/_exit_with_stack_teardown.S \
arch-mips/bionic/_exit_with_stack_teardown.S \ arch-sh/bionic/_setjmp.S \
arch-mips/bionic/_setjmp.S \ arch-sh/bionic/atomics_sh.c \
arch-mips/bionic/futex_mips.S \ arch-sh/bionic/atomic_cmpxchg.S \
arch-mips/bionic/bzero.S \ arch-sh/bionic/clone.S \
arch-mips/bionic/cacheflush.c \ arch-sh/bionic/pipe.S \
arch-mips/bionic/clone.S \ arch-sh/bionic/memcpy.S \
arch-mips/bionic/ffs.S \ arch-sh/bionic/memset.S \
arch-mips/bionic/memcmp16.S \ arch-sh/bionic/bzero.S \
arch-mips/bionic/memmove.c \ arch-sh/bionic/setjmp.S \
arch-mips/bionic/pipe.S \ arch-sh/bionic/sigsetjmp.S \
arch-mips/bionic/setjmp.S \ arch-sh/bionic/syscall.S \
arch-mips/bionic/sigsetjmp.S \ arch-sh/bionic/memmove.S \
arch-mips/bionic/vfork.S arch-sh/bionic/__set_tls.c \
arch-sh/bionic/__get_tls.c \
libc_common_src_files += \ arch-sh/bionic/ffs.S \
arch-mips/string/memset.S \
arch-mips/string/memcpy.S \
arch-mips/string/mips_strlen.c
libc_common_src_files += \
bionic/memcmp.c \
string/bcopy.c \ string/bcopy.c \
string/strcmp.c \ string/strcmp.c \
string/strncmp.c \
string/memcmp.c \
string/strlen.c \
string/strcpy.c \ string/strcpy.c \
string/strncmp.c
libc_common_src_files += \
bionic/pthread-atfork.c \ bionic/pthread-atfork.c \
bionic/pthread-rwlocks.c \ bionic/pthread-rwlocks.c \
bionic/pthread-timers.c \ bionic/pthread-timers.c \
bionic/ptrace.c bionic/ptrace.c \
unistd/socketcalls.c
libc_static_common_src_files += \ libc_static_common_src_files += \
bionic/pthread.c \ bionic/pthread.c \
bionic/pthread_key.cpp \
libc_arch_static_src_files := \ endif # sh
bionic/dl_iterate_phdr_static.c
libc_arch_dynamic_src_files := endif # !x86
endif # mips endif # !arm
# Define some common cflags # Define some common cflags
# ======================================================== # ========================================================
libc_common_cflags := \ libc_common_cflags := \
-DWITH_ERRLIST \ -DWITH_ERRLIST \
-DANDROID_CHANGES \ -DANDROID_CHANGES \
-DUSE_LOCKS \
-DREALLOC_ZERO_BYTES_FREES \
-D_LIBC=1 \ -D_LIBC=1 \
-DSOFTFLOAT \
-DFLOATING_POINT \ -DFLOATING_POINT \
-DINET6 \ -DINET6 \
-I$(LOCAL_PATH)/private \ -I$(LOCAL_PATH)/private \
-DUSE_DL_PREFIX \
-DPOSIX_MISTAKE \ -DPOSIX_MISTAKE \
-DLOG_ON_HEAP_ERROR \ -DLOG_ON_HEAP_ERROR \
-Wall -Wextra
# these macro definitions are required to implement the # these macro definitions are required to implement the
# 'timezone' and 'daylight' global variables, as well as # 'timezone' and 'daylight' global variables, as well as
@@ -528,15 +495,7 @@ ifeq ($(strip $(DEBUG_BIONIC_LIBC)),true)
libc_common_cflags += -DDEBUG libc_common_cflags += -DDEBUG
endif endif
# To customize dlmalloc's alignment, set BOARD_MALLOC_ALIGNMENT in
# the appropriate BoardConfig.mk file.
#
ifneq ($(BOARD_MALLOC_ALIGNMENT),)
libc_common_cflags += -DMALLOC_ALIGNMENT=$(BOARD_MALLOC_ALIGNMENT)
endif
ifeq ($(TARGET_ARCH),arm) ifeq ($(TARGET_ARCH),arm)
libc_common_cflags += -DSOFTFLOAT
libc_common_cflags += -fstrict-aliasing libc_common_cflags += -fstrict-aliasing
libc_crt_target_cflags := -mthumb-interwork libc_crt_target_cflags := -mthumb-interwork
# #
@@ -549,37 +508,15 @@ ifeq ($(TARGET_ARCH),arm)
ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true) ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true)
libc_common_cflags += -DHAVE_ARM_TLS_REGISTER libc_common_cflags += -DHAVE_ARM_TLS_REGISTER
endif endif
# else # !arm
# Define HAVE_32_BYTE_CACHE_LINES to indicate to C
# library it should use to 32-byte version of memcpy, and not
# the 64-byte version.
#
ifeq ($(ARCH_ARM_HAVE_32_BYTE_CACHE_LINES),true)
libc_common_cflags += -DHAVE_32_BYTE_CACHE_LINE
endif
ifeq ($(ARCH_ARM_USE_NON_NEON_MEMCPY),true)
libc_common_cflags += -DARCH_ARM_USE_NON_NEON_MEMCPY
endif
endif # !arm
ifeq ($(TARGET_ARCH),x86) ifeq ($(TARGET_ARCH),x86)
libc_common_cflags += -DSOFTFLOAT libc_crt_target_cflags := -m32
libc_crt_target_cflags :=
ifeq ($(ARCH_X86_HAVE_SSE2),true)
libc_crt_target_cflags += -DUSE_SSE2=1
endif
ifeq ($(ARCH_X86_HAVE_SSSE3),true)
libc_crt_target_cflags += -DUSE_SSSE3=1
endif
endif # x86
ifeq ($(TARGET_ARCH),mips) # Enable recent IA friendly memory routines (such as for Atom)
ifneq ($(ARCH_MIPS_HAS_FPU),true) # These will not work on the earlier x86 machines
libc_common_cflags += -DSOFTFLOAT libc_common_cflags += -mtune=i686 -DUSE_SSSE3 -DUSE_SSE2
endif endif # x86
libc_common_cflags += -fstrict-aliasing endif # !arm
libc_crt_target_cflags := $(TARGET_GLOBAL_CFLAGS)
endif # mips
# Define ANDROID_SMP appropriately. # Define ANDROID_SMP appropriately.
ifeq ($(TARGET_CPU_SMP),true) ifeq ($(TARGET_CPU_SMP),true)
@@ -588,145 +525,82 @@ else
libc_common_cflags += -DANDROID_SMP=0 libc_common_cflags += -DANDROID_SMP=0
endif endif
# crtbrand.c needs <stdint.h> and a #define for the platform SDK version. # Needed to access private/__dso_handle.S from
libc_crt_target_cflags += \ # crtbegin_xxx.S and crtend_xxx.S
-I$(LOCAL_PATH)/include \ #
-DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION) libc_crt_target_cflags += -I$(LOCAL_PATH)/private
ifeq ($(TARGET_ARCH),arm)
libc_crt_target_cflags += -DCRT_LEGACY_WORKAROUND
endif
# Define some common includes # Define some common includes
# ======================================================== # ========================================================
libc_common_c_includes := \ libc_common_c_includes := \
$(LOCAL_PATH)/stdlib \ $(LOCAL_PATH)/stdlib \
$(LOCAL_PATH)/string \ $(LOCAL_PATH)/string \
$(LOCAL_PATH)/stdio \ $(LOCAL_PATH)/stdio
external/safe-iop/include
# Needed to access private/__dso_handle.h from # Needed to access private/__dso_handle.S from
# crtbegin_xxx.S and crtend_xxx.S # crtbegin_xxx.S and crtend_xxx.S
libc_crt_target_cflags += \ #
-I$(LOCAL_PATH)/private \ libc_crt_target_cflags += -I$(LOCAL_PATH)/private
-I$(LOCAL_PATH)/arch-$(TARGET_ARCH)/include
# Define the libc run-time (crt) support object files that must be built, # Define the libc run-time (crt) support object files that must be built,
# which are needed to build all other objects (shared/static libs and # which are needed to build all other objects (shared/static libs and
# executables) # executables)
# ========================================================================== # ==========================================================================
# ARM, MIPS, and x86 all need crtbegin_so/crtend_so.
ifneq ($(filter arm x86,$(TARGET_ARCH)),)
# ARM and x86 need crtbegin_so/crtend_so.
# #
# For x86, the .init section must point to a function that calls all # For x86, the .init section must point to a function that calls all
# entries in the .ctors section. (on ARM this is done through the # entries in the .ctors section. (on ARM this is done through the
# .init_array section instead). # .init_array section instead).
# #
# For all the platforms, the .fini_array section must point to a function # For both platforms, the .fini_array section must point to a function
# that will call __cxa_finalize(&__dso_handle) in order to ensure that # that will call __cxa_finalize(&__dso_handle) in order to ensure that
# static C++ destructors are properly called on dlclose(). # static C++ destructors are properly called on dlclose().
# #
ifeq ($(TARGET_ARCH),arm)
libc_crtbegin_extension := c libc_crt_target_so_cflags := $(libc_crt_target_cflags)
libc_crt_target_so_cflags :=
endif
ifeq ($(TARGET_ARCH),mips)
libc_crtbegin_extension := S
libc_crt_target_so_cflags := -fPIC
endif
ifeq ($(TARGET_ARCH),x86) ifeq ($(TARGET_ARCH),x86)
libc_crtbegin_extension := c # This flag must be added for x86 targets, but not for ARM
libc_crt_target_so_cflags := -fPIC libc_crt_target_so_cflags += -fPIC
endif endif
ifeq ($(libc_crtbegin_extension),) GEN := $(TARGET_OUT_STATIC_LIBRARIES)/crtbegin_so.o
$(error $(TARGET_ARCH) not supported) $(GEN): $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtbegin_so.S
endif
libc_crt_target_so_cflags += $(libc_crt_target_cflags)
libc_crt_target_crtbegin_file := $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtbegin.$(libc_crtbegin_extension)
libc_crt_target_crtbegin_so_file := $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtbegin_so.$(libc_crtbegin_extension)
# See the comment in crtbrand.c for the reason why we need to generate
# crtbrand.s before generating crtbrand.o.
GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbrand.s
$(GEN): $(LOCAL_PATH)/bionic/crtbrand.c
@mkdir -p $(dir $@) @mkdir -p $(dir $@)
$(hide) $(TARGET_CC) $(libc_crt_target_so_cflags) -S \ $(TARGET_CC) $(libc_crt_target_so_cflags) -o $@ -c $<
-MD -MF $(@:%.s=%.d) -o $@ $<
$(hide) sed -i -e '/\.note\.ABI-tag/s/progbits/note/' $@
$(call transform-d-to-p-args,$(@:%.s=%.d),$(@:%.s=%.P))
-include $(GEN:%.s=%.P)
ALL_GENERATED_SOURCES += $(GEN) ALL_GENERATED_SOURCES += $(GEN)
GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbrand.o GEN := $(TARGET_OUT_STATIC_LIBRARIES)/crtend_so.o
$(GEN): $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbrand.s
@mkdir -p $(dir $@)
$(hide) $(TARGET_CC) $(libc_crt_target_so_cflags) -o $@ -c $<
ALL_GENERATED_SOURCES += $(GEN)
GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_so.o
$(GEN): $(libc_crt_target_crtbegin_so_file)
@mkdir -p $(dir $@)
$(hide) $(TARGET_CC) $(libc_crt_target_so_cflags) \
-MD -MF $(@:%.o=%.d) -o $@ -c $<
$(transform-d-to-p)
-include $(GEN:%.o=%.P)
ALL_GENERATED_SOURCES += $(GEN)
GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtend_so.o
$(GEN): $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtend_so.S $(GEN): $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtend_so.S
@mkdir -p $(dir $@) @mkdir -p $(dir $@)
$(hide) $(TARGET_CC) $(libc_crt_target_so_cflags) \ $(TARGET_CC) $(libc_crt_target_so_cflags) -o $@ -c $<
-MD -MF $(@:%.o=%.d) -o $@ -c $<
$(transform-d-to-p)
-include $(GEN:%.o=%.P)
ALL_GENERATED_SOURCES += $(GEN)
# The following two are installed to device
GEN := $(TARGET_OUT_SHARED_LIBRARIES)/crtbegin_so.o
$(GEN): $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_so.o
$(hide) mkdir -p $(dir $@) && cp -f $< $@
ALL_GENERATED_SOURCES += $(GEN)
GEN := $(TARGET_OUT_SHARED_LIBRARIES)/crtend_so.o
$(GEN): $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtend_so.o
$(hide) mkdir -p $(dir $@) && cp -f $< $@
ALL_GENERATED_SOURCES += $(GEN) ALL_GENERATED_SOURCES += $(GEN)
endif # TARGET_ARCH == x86 || TARGET_ARCH == arm
GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_static1.o GEN := $(TARGET_OUT_STATIC_LIBRARIES)/crtbegin_static.o
$(GEN): $(libc_crt_target_crtbegin_file) $(GEN): $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtbegin_static.S
@mkdir -p $(dir $@) @mkdir -p $(dir $@)
$(hide) $(TARGET_CC) $(libc_crt_target_cflags) \ $(TARGET_CC) $(libc_crt_target_cflags) -o $@ -c $<
-MD -MF $(@:%.o=%.d) -o $@ -c $<
$(transform-d-to-p)
-include $(GEN:%.o=%.P)
ALL_GENERATED_SOURCES += $(GEN) ALL_GENERATED_SOURCES += $(GEN)
GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_static.o GEN := $(TARGET_OUT_STATIC_LIBRARIES)/crtbegin_dynamic.o
$(GEN): $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_static1.o $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbrand.o $(GEN): $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtbegin_dynamic.S
@mkdir -p $(dir $@) @mkdir -p $(dir $@)
$(hide) $(TARGET_LD) -r -o $@ $^ $(TARGET_CC) $(libc_crt_target_cflags) -o $@ -c $<
ALL_GENERATED_SOURCES += $(GEN) ALL_GENERATED_SOURCES += $(GEN)
GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_dynamic1.o
$(GEN): $(libc_crt_target_crtbegin_file)
@mkdir -p $(dir $@)
$(hide) $(TARGET_CC) $(libc_crt_target_cflags) \
-MD -MF $(@:%.o=%.d) -o $@ -c $<
$(transform-d-to-p)
-include $(GEN:%.o=%.P)
ALL_GENERATED_SOURCES += $(GEN)
GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_dynamic.o
$(GEN): $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_dynamic1.o $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbrand.o
@mkdir -p $(dir $@)
$(hide) $(TARGET_LD) -r -o $@ $^
ALL_GENERATED_SOURCES += $(GEN)
# We rename crtend.o to crtend_android.o to avoid a # We rename crtend.o to crtend_android.o to avoid a
# name clash between gcc and bionic. # name clash between gcc and bionic.
GEN := $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtend_android.o GEN := $(TARGET_OUT_STATIC_LIBRARIES)/crtend_android.o
$(GEN): $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtend.S $(GEN): $(LOCAL_PATH)/arch-$(TARGET_ARCH)/bionic/crtend.S
@mkdir -p $(dir $@) @mkdir -p $(dir $@)
$(hide) $(TARGET_CC) $(libc_crt_target_cflags) \ $(TARGET_CC) $(libc_crt_target_cflags) -o $@ -c $<
-MD -MF $(@:%.o=%.d) -o $@ -c $<
$(transform-d-to-p)
-include $(GEN:%.o=%.P)
ALL_GENERATED_SOURCES += $(GEN) ALL_GENERATED_SOURCES += $(GEN)
@@ -734,79 +608,18 @@ ALL_GENERATED_SOURCES += $(GEN)
# "WITH_MALLOC_CHECK_LIBC_A := true" to buildspec.mk # "WITH_MALLOC_CHECK_LIBC_A := true" to buildspec.mk
WITH_MALLOC_CHECK_LIBC_A := $(strip $(WITH_MALLOC_CHECK_LIBC_A)) WITH_MALLOC_CHECK_LIBC_A := $(strip $(WITH_MALLOC_CHECK_LIBC_A))
# ========================================================
# libbionic_ssp.a - stack protector code
# ========================================================
#
# The stack protector code needs to be compiled
# with -fno-stack-protector, since it modifies the
# stack canary.
include $(CLEAR_VARS)
LOCAL_SRC_FILES := bionic/ssp.cpp
LOCAL_CFLAGS := $(libc_common_cflags) -fno-stack-protector
LOCAL_C_INCLUDES := $(libc_common_c_includes)
LOCAL_MODULE := libbionic_ssp
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_SYSTEM_SHARED_LIBRARIES :=
include $(BUILD_STATIC_LIBRARY)
# ========================================================
# libc_netbsd.a - upstream NetBSD C library code
# ========================================================
#
# These files are built with the netbsd-compat.h header file
# automatically included.
include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(libc_upstream_netbsd_src_files)
LOCAL_CFLAGS := \
$(libc_common_cflags) \
-I$(LOCAL_PATH)/upstream-netbsd \
-I$(LOCAL_PATH)/upstream-netbsd/libc/include \
-include upstream-netbsd/netbsd-compat.h
LOCAL_C_INCLUDES := $(libc_common_c_includes)
LOCAL_MODULE := libc_netbsd
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_SYSTEM_SHARED_LIBRARIES :=
include $(BUILD_STATIC_LIBRARY)
# ========================================================
# libc_bionic.a - home-grown C library code
# ========================================================
#
include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(libc_bionic_src_files)
LOCAL_CFLAGS := $(libc_common_cflags) -Werror
LOCAL_C_INCLUDES := $(libc_common_c_includes)
LOCAL_MODULE := libc_bionic
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_SYSTEM_SHARED_LIBRARIES :=
include $(BUILD_STATIC_LIBRARY)
# ======================================================== # ========================================================
# libc_common.a # libc_common.a
# ======================================================== # ========================================================
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(libc_common_src_files) LOCAL_SRC_FILES := $(libc_common_src_files)
LOCAL_CFLAGS := $(libc_common_cflags) \ LOCAL_CFLAGS := $(libc_common_cflags)
-std=gnu99 \ ifeq ($(TARGET_ARCH),arm)
-I$(LOCAL_PATH)/upstream-netbsd/libc/include # for netbsd private headers LOCAL_CFLAGS += -DCRT_LEGACY_WORKAROUND
endif
LOCAL_C_INCLUDES := $(libc_common_c_includes) LOCAL_C_INCLUDES := $(libc_common_c_includes)
LOCAL_MODULE := libc_common LOCAL_MODULE := libc_common
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_WHOLE_STATIC_LIBRARIES := libbionic_ssp libc_bionic libc_netbsd
LOCAL_SYSTEM_SHARED_LIBRARIES := LOCAL_SYSTEM_SHARED_LIBRARIES :=
include $(BUILD_STATIC_LIBRARY) include $(BUILD_STATIC_LIBRARY)
@@ -827,15 +640,13 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES := \ LOCAL_SRC_FILES := \
$(libc_arch_static_src_files) \ $(libc_arch_static_src_files) \
$(libc_static_common_src_files) \ $(libc_static_common_src_files) \
bionic/libc_init_static.cpp bionic/libc_init_static.c
LOCAL_C_INCLUDES := $(libc_common_c_includes) LOCAL_C_INCLUDES := $(libc_common_c_includes)
LOCAL_CFLAGS := $(libc_common_cflags) \ LOCAL_CFLAGS := $(libc_common_cflags) \
-DLIBC_STATIC \ -DLIBC_STATIC
-std=gnu99
LOCAL_MODULE := libc_nomalloc LOCAL_MODULE := libc_nomalloc
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_WHOLE_STATIC_LIBRARIES := libc_common LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
LOCAL_SYSTEM_SHARED_LIBRARIES := LOCAL_SYSTEM_SHARED_LIBRARIES :=
@@ -851,15 +662,13 @@ LOCAL_SRC_FILES := \
$(libc_arch_static_src_files) \ $(libc_arch_static_src_files) \
$(libc_static_common_src_files) \ $(libc_static_common_src_files) \
bionic/dlmalloc.c \ bionic/dlmalloc.c \
bionic/malloc_debug_common.cpp \ bionic/malloc_debug_common.c \
bionic/libc_init_static.cpp bionic/libc_init_static.c
LOCAL_CFLAGS := $(libc_common_cflags) \ LOCAL_CFLAGS := $(libc_common_cflags) \
-DLIBC_STATIC \ -DLIBC_STATIC
-std=gnu99
LOCAL_C_INCLUDES := $(libc_common_c_includes) LOCAL_C_INCLUDES := $(libc_common_c_includes)
LOCAL_MODULE := libc LOCAL_MODULE := libc
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_WHOLE_STATIC_LIBRARIES := libc_common LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
LOCAL_SYSTEM_SHARED_LIBRARIES := LOCAL_SYSTEM_SHARED_LIBRARIES :=
@@ -871,37 +680,17 @@ include $(BUILD_STATIC_LIBRARY)
# ======================================================== # ========================================================
include $(CLEAR_VARS) include $(CLEAR_VARS)
# pthread deadlock prediction: LOCAL_CFLAGS := $(libc_common_cflags)
# set -DPTHREAD_DEBUG -DPTHREAD_DEBUG_ENABLED=1 to enable support for
# pthread deadlock prediction.
# Since this code is experimental it is disabled by default.
# see libc/bionic/pthread_debug.c for details
LOCAL_CFLAGS := $(libc_common_cflags) -std=gnu99 -DPTHREAD_DEBUG -DPTHREAD_DEBUG_ENABLED=0
LOCAL_C_INCLUDES := $(libc_common_c_includes) LOCAL_C_INCLUDES := $(libc_common_c_includes)
LOCAL_SRC_FILES := \ LOCAL_SRC_FILES := \
$(libc_arch_dynamic_src_files) \ $(libc_arch_dynamic_src_files) \
$(libc_static_common_src_files) \ $(libc_static_common_src_files) \
bionic/dlmalloc.c \ bionic/dlmalloc.c \
bionic/malloc_debug_common.cpp \ bionic/malloc_debug_common.c \
bionic/pthread_debug.cpp \ bionic/libc_init_dynamic.c
bionic/libc_init_dynamic.cpp
ifeq ($(TARGET_ARCH),arm)
LOCAL_NO_CRT := true
LOCAL_CFLAGS += -DCRT_LEGACY_WORKAROUND
LOCAL_SRC_FILES := \
arch-arm/bionic/crtbegin_so.c \
arch-arm/bionic/atexit_legacy.c \
$(LOCAL_SRC_FILES) \
arch-arm/bionic/crtend_so.S
endif
LOCAL_MODULE:= libc LOCAL_MODULE:= libc
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_REQUIRED_MODULES := tzdata
# WARNING: The only library libc.so should depend on is libdl.so! If you add other libraries, # WARNING: The only library libc.so should depend on is libdl.so! If you add other libraries,
# make sure to add -Wl,--exclude-libs=libgcc.a to the LOCAL_LDFLAGS for those libraries. This # make sure to add -Wl,--exclude-libs=libgcc.a to the LOCAL_LDFLAGS for those libraries. This
@@ -938,15 +727,11 @@ LOCAL_CFLAGS := \
LOCAL_C_INCLUDES := $(libc_common_c_includes) LOCAL_C_INCLUDES := $(libc_common_c_includes)
LOCAL_SRC_FILES := \ LOCAL_SRC_FILES := \
bionic/debug_mapinfo.cpp \ bionic/malloc_debug_leak.c
bionic/debug_stacktrace.cpp \
bionic/malloc_debug_leak.cpp \
bionic/malloc_debug_check.cpp \
LOCAL_MODULE:= libc_malloc_debug_leak LOCAL_MODULE:= libc_malloc_debug_leak
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_SHARED_LIBRARIES := libc libdl LOCAL_SHARED_LIBRARIES := libc
LOCAL_WHOLE_STATIC_LIBRARIES := libc_common LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
LOCAL_SYSTEM_SHARED_LIBRARIES := LOCAL_SYSTEM_SHARED_LIBRARIES :=
LOCAL_ALLOW_UNDEFINED_SYMBOLS := true LOCAL_ALLOW_UNDEFINED_SYMBOLS := true
@@ -969,12 +754,11 @@ LOCAL_CFLAGS := \
LOCAL_C_INCLUDES := $(libc_common_c_includes) LOCAL_C_INCLUDES := $(libc_common_c_includes)
LOCAL_SRC_FILES := \ LOCAL_SRC_FILES := \
bionic/malloc_debug_qemu.cpp bionic/malloc_debug_qemu.c
LOCAL_MODULE:= libc_malloc_debug_qemu LOCAL_MODULE:= libc_malloc_debug_qemu
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_SHARED_LIBRARIES := libc libdl LOCAL_SHARED_LIBRARIES := libc
LOCAL_WHOLE_STATIC_LIBRARIES := libc_common LOCAL_WHOLE_STATIC_LIBRARIES := libc_common
LOCAL_SYSTEM_SHARED_LIBRARIES := LOCAL_SYSTEM_SHARED_LIBRARIES :=

441
libc/Jamfile Normal file
View File

@@ -0,0 +1,441 @@
# This file is used to build the Bionic library with the Jam build
# tool. For info, see www.perforce.com/jam/jam.html
#
BIONIC_TOP ?= $(DOT) ;
DEBUG = 1 ;
# pattern used for automatic heade inclusion detection
HDRPATTERN = "^[ ]*#[ ]*include[ ]*[<\"]([^\">]*)[\">].*$" ;
# debugging support, simply define the DEBUG variable to activate verbose output
rule Debug
{
if $(DEBUG) {
Echo $(1) ;
}
}
# return all elements from $(1) that are not in $(2)
rule Filter list : filter
{
local result = ;
local item ;
for item in $(list) {
if ! $(item) in $(filter) {
result += $(item) ;
}
}
return $(result) ;
}
# reverse a list of elements
rule Reverse list
{
local result = ;
local item ;
for item in $(list) {
result = $(item) $(result) ;
}
return $(result) ;
}
# decompose a path into a list of elements
rule PathDecompose dir
{
local result ;
while $(dir:D)
{
if ! $(dir:BS) { # for rooted paths like "/foo"
break ;
}
result = $(dir:BS) $(result) ;
dir = $(dir:D) ;
}
result = $(dir) $(result) ;
return $(result) ;
}
# simply a file path, i.e. get rid of . or .. when possible
rule _PathSimplify dir
{
local result = ;
local dir2 d ;
dir = [ PathDecompose $(dir) ] ;
# get rid of any single dot
dir2 = ;
for d in $(dir) {
if $(d) = "." {
continue ;
}
dir2 += $(d) ;
}
# get rid of .. when possible
for d in $(dir2) {
if $(d) = ".." && $(result) {
result = $(result[2-]) ;
}
else
result = $(d) $(result) ;
}
# now invert the result
result = [ Reverse $(result) ] ;
if ! $(result) {
result = "." ;
}
return $(result:J="/") ;
}
rule PathSimplify dirs
{
local result ;
local d ;
for d in $(dirs) {
result += [ _PathSimplify $(d) ] ;
}
return $(result) ;
}
# retrieve list of subdirectories
rule ListSubDirs paths
{
local result = ;
local entry ;
for entry in [ Glob $(paths) : * ] {
if ! $(entry:S) {
result += $(entry) ;
}
}
return [ PathSimplify $(result) ] ;
}
# retrieve list of sources in a given directory
rule ListSources path
{
return [ Glob $(path) : *.S *.c ] ;
}
# find the prebuilt directory
#
if ! $(TOP) {
Echo "Please define TOP as the root of your device build tree" ;
Exit ;
}
Debug "OS is" $(OS) ;
Debug "CPU is" $(CPU) ;
if $(OS) = LINUX
{
PREBUILT = $(TOP)/prebuilt/Linux ;
}
else if $(OS) = MACOSX
{
switch $(CPU) {
case i386 : PREBUILT = $(TOP)/prebuilt/darwin-x86 ; break ;
case ppc : PREBUILT = $(TOP)/prebuilt/darwin-ppc ; break ;
case * : Echo "unsupported CPU" "$(CPU) !!" ;
Echo "Please contact digit@google.com for help" ;
Exit ;
}
}
else
{
Echo "Unsupported operating system" $(OS) ;
Echo "Please contact digit@google.com for help" ;
Exit ;
}
Debug "TOP is" $(TOP) ;
Debug "PREBUILT is" $(PREBUILT) ;
# check architectures and setup toolchain variables
#
SUPPORTED_ARCHS = x86 arm ;
ARCH ?= $(SUPPORTED_ARCHS) ;
if ! $(ARCH) in $(SUPPORTED_ARCHS) {
Echo "The variable ARCH contains an unsupported value, use one or more of these instead" ;
Echo "separated by spaces:" $(SUPPORTED_ARCHS) ;
Exit ;
}
x86_TOOLSET_PREFIX ?= "" ;
arm_TOOLSET_PREFIX ?= $(TOP)/prebuilt/Linux/toolchain-4.1.1/bin/arm-elf- ;
for arch in $(ARCH) {
CC_$(arch) = $($(arch)_TOOLSET_PREFIX)gcc ;
C++_$(arch) = $($(arch)_TOOLSET_PREFIX)g++ ;
AR_$(arch) = $($(arch)_TOOLSET_PREFIX)ar ;
}
# the list of arch-independent source subdirectories
BIONIC_SRC_SUBDIRS = string ;
BIONIC_x86_SUBDIRS = ;
BIONIC_arm_SUBDIRS = ;
CFLAGS = -O0 -g -W ;
# find sources in a given list of subdirectories
rule FindSources dirs
{
local dir ;
for dir in $(dirs)
{
local LOCAL_SRC NO_LOCAL_SRC ;
if [ Glob $(dir) : rules.jam ] {
include $(dir)/rules.jam ;
if $(LOCAL_SRC) {
_sources = $(LOCAL_SRC) ;
}
else {
_sources = [ Glob $(dir) : *.S *.c ] ;
_sources = $(_sources:BS) ;
}
if $(NO_LOCAL_SRC) {
_sources = [ Filter $(_sources) : $(NO_LOCAL_SRC) ] ;
}
sources += $(dir)/$(_sources) ;
}
else
sources += [ ListSources $(dir) ] ;
}
}
# Compile a given object file from a source
rule Compile object : source
{
Depends $(object) : $(source) ;
Depends bionic : $(object) ;
Clean clean : $(object) ;
MakeLocate $(object) : $(OUT) ;
CC on $(object) = $(CC_$(arch)) ;
CFLAGS on $(object) = $(CFLAGS) ;
INCLUDES on $(object) = $(INCLUDES) ;
DEFINES on $(object) = $(DEFINES) ;
HDRRULE on $(>) = HdrRule ;
HDRSCAN on $(>) = $(HDRPATTERN) ;
HDRSEARCH on $(>) = $(INCLUDES) ;
HDRGRIST on $(>) = $(HDRGRIST) ;
}
actions Compile
{
$(CC) -c -o $(1) $(CFLAGS) -I$(INCLUDES) -D$(DEFINES) $(2)
}
rule RmTemps
{
Temporary $(2) ;
}
actions quietly updated piecemeal together RmTemps
{
rm -f $(2)
}
actions Archive
{
$(AR) ru $(1) $(2)
}
rule Library library : objects
{
local obj ;
if ! $(library:S) {
library = $(library:S=.a) ;
}
library = $(library:G=<$(arch)>) ;
Depends all : $(library) ;
if ! $(library:D) {
MakeLocate $(library) $(library)($(objects:BS)) : $(OUT) ;
}
Depends $(library) : $(library)($(objects:BS)) ;
for obj in $(objects) {
Depends $(library)($(obj:BS)) : $(obj) ;
}
Clean clean : $(library) ;
AR on $(library) = $(AR_$(arch)) ;
Archive $(library) : $(objects) ;
RmTemps $(library) : $(objects) ;
}
rule ProcessDir
{
local CFLAGS = $(CFLAGS) ;
local DEFINES = $(DEFINES) ;
local INCLUDES = $(INCLUDES) ;
local local_rules = [ Glob $(1) : rules.jam ] ;
local source sources ;
if $(local_rules) {
local LOCAL_CFLAGS LOCAL_DEFINES LOCAL_INCLUDES LOCAL_SRC NO_LOCAL_SRC ;
include $(local_rules) ;
CFLAGS += $(LOCAL_CFLAGS) ;
DEFINES += $(LOCAL_DEFINES) ;
INCLUDES += $(LOCAL_INCLUDES) ;
if $(LOCAL_SRC) {
sources = $(LOCAL_SRC) ;
}
else {
sources = [ Glob $(1) : *.S *.c ] ;
sources = $(sources:BS) ;
}
if $(NO_LOCAL_SRC) {
sources = [ Filter $(sources) : $(NO_LOCAL_SRC) ] ;
}
sources = $(1)/$(sources) ;
}
else
sources = [ Glob $(1) : *.S *.c ] ;
for source in $(sources) {
local name = $(source:B) ;
if $(source:S) = ".S" {
# record the list of assembler sources
ASSEMBLER_SOURCES += $(name) ;
}
else if $(source:S) = ".c" && $(name) in $(ASSEMBLER_SOURCES) {
# skip C source file if corresponding assembler exists
continue ;
}
objname = <$(arch)>$(name).o ;
Compile $(objname) : $(source) ;
ALL_OBJECTS += $(objname) ;
}
}
rule ProcessDirs
{
local dir ;
for dir in $(1) {
ProcessDir $(dir) ;
}
}
INCLUDES_x86 = /usr/src/linux/include ;
INCLUDES_arm = ../kernel_headers
include/arch/arm
include/bits32
;
INCLUDES = include stdio string stdlib .
../msun/include
;
DEFINES = ANDROID_CHANGES
USE_LOCKS
REALLOC_ZERO_BYTES_FREES
_LIBC=1
SOFTFLOAT
FLOATING_POINT
NEED_PSELECT=1
ANDROID
;
CFLAGS_x86 = ;
for arch in $(ARCH)
{
local ARCH_DIR = $(BIONIC_TOP)/arch-$(arch) ;
local INCLUDES = $(INCLUDES_$(arch)) $(ARCH_DIR)/include $(INCLUDES) ;
local DEFINES = $(DEFINES_$(arch)) $(DEFINES) ARCH=$(arch) ;
local CFLAGS = $(CFLAGS) $(CFLAGS_$(arch)) ;
local OUT = out/$(arch) ;
local ASSEMBLER_SOURCES ALL_OBJECTS ;
ProcessDirs [ ListSubDirs $(ARCH_DIR) ] ;
ProcessDirs stdlib stdio unistd string tzcode inet ;
ProcessDirs [ ListSubDirs netbsd ] ;
ProcessDirs bionic ;
Library bionic : $(ALL_OBJECTS) ;
}
BIONIC_SEARCH = $(BIONIC_TOP)/include ;
# /HdrRule source : headers ;
#
# Arranges the proper dependencies when the file _source_ includes the files
# _headers_ through the #include C preprocessor directive
#
# this rule is not intendend to be called explicitely. It is called
# automatically during header scanning on sources handled by the @Object
# rule (e.g. sources in @Main or @Library rules)
#
rule HdrRule
{
# HdrRule source : headers ;
# N.B. This rule is called during binding, potentially after
# the fate of many targets has been determined, and must be
# used with caution: don't add dependencies to unrelated
# targets, and don't set variables on $(<).
# Tell Jam that anything depending on $(<) also depends on $(>),
# set SEARCH so Jam can find the headers, but then say we don't
# care if we can't actually find the headers (they may have been
# within ifdefs),
local s = $(>:G=$(HDRGRIST:E)) ;
Includes $(<) : $(s) ;
SEARCH on $(s) = $(HDRSEARCH) ;
NoCare $(s) ;
# Propagate on $(<) to $(>)
HDRSEARCH on $(s) = $(HDRSEARCH) ;
HDRSCAN on $(s) = $(HDRSCAN) ;
HDRRULE on $(s) = $(HDRRULE) ;
HDRGRIST on $(s) = $(HDRGRIST) ;
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,10 +1,10 @@
# this file is used to list all the syscalls that will be supported by # this file is used to list all the syscalls that will be supported by
# the Bionic C library. It is used to automatically generate the syscall # the Bionic C library. It is used to automatically generate the syscall
# stubs, the list of syscall constants (__NR_xxxx) and the content of <linux/_unistd.h> # stubs, the list of syscall constants (__NR_xxxx) and the content of <linux/_unitsd.h>
# #
# each non comment line has the following format: # each non comment line has the following format:
# #
# return_type func_name[:syscall_name[:call_id]]([parameter_list]) (syscall_number|"stub") # return_type func_name[:syscall_name[:call_id]]([parameter_list]) (#syscall_number|stub)
# #
# note that: # note that:
# - syscall_name correspond to the name of the syscall, which may differ from # - syscall_name correspond to the name of the syscall, which may differ from
@@ -22,18 +22,18 @@
# assembler template for the syscall; it's up to the bionic implementation to provide # assembler template for the syscall; it's up to the bionic implementation to provide
# a relevant C stub # a relevant C stub
# #
# - additionally, if the syscall number is different amoung ARM, and x86, MIPS use: # - additionally, if the syscall number is different amoung ARM, x86 and SuperH, use:
# return_type funcname[:syscall_name](parameters) arm_number,x86_number,mips_number # return_type funcname[:syscall_name](parameters) arm_number,x86_number,superh_number
# #
# the file is processed by a python script named gensyscalls.py # the file is processed by a python script named gensyscalls.py
# #
# process management # process management
void _exit:exit_group (int) 248,252,246 void _exit:exit_group (int) 248,252
void _exit_thread:exit (int) 1 void _exit_thread:exit (int) 1
pid_t __fork:fork (void) 2 pid_t __fork:fork (void) 2
pid_t _waitpid:waitpid (pid_t, int*, int, struct rusage*) -1,7,7 pid_t _waitpid:waitpid (pid_t, int*, int, struct rusage*) -1,7
int __waitid:waitid(int, pid_t, struct siginfo_t*, int,void*) 280,284,278 int __waitid:waitid(int, pid_t, struct siginfo_t*, int,void*) 280,284
# NOTE: this system call is never called directly, but we list it there # NOTE: this system call is never called directly, but we list it there
# to have __NR_clone properly defined. # to have __NR_clone properly defined.
@@ -42,90 +42,70 @@ pid_t __sys_clone:clone (int, void*, int*, void*, int*) 120
int execve (const char*, char* const*, char* const*) 11 int execve (const char*, char* const*, char* const*) 11
int __setuid:setuid32 (uid_t) 213,213,-1 int __setuid:setuid32 (uid_t) 213
int __setuid:setuid (uid_t) -1,-1,23 uid_t getuid:getuid32 () 199
uid_t getuid:getuid32 () 199,199,-1 gid_t getgid:getgid32 () 200
uid_t getuid:getuid () -1,-1,24 uid_t geteuid:geteuid32 () 201
gid_t getgid:getgid32 () 200,200,-1 gid_t getegid:getegid32 () 202
gid_t getgid:getgid () -1,-1,47 uid_t getresuid:getresuid32 () 209
uid_t geteuid:geteuid32 () 201,201,-1 gid_t getresgid:getresgid32 () 211
uid_t geteuid:geteuid () -1,-1,49 pid_t gettid() 224
gid_t getegid:getegid32 () 202,202,-1 int getgroups:getgroups32(int, gid_t *) 205
gid_t getegid:getegid () -1,-1,50
uid_t getresuid:getresuid32 (uid_t *ruid, uid_t *euid, uid_t *suid) 209,209,-1
uid_t getresuid:getresuid (uid_t *ruid, uid_t *euid, uid_t *suid) -1,-1,186
gid_t getresgid:getresgid32 (gid_t *rgid, gid_t *egid, gid_t *sgid) 211,211,-1
gid_t getresgid:getresgid (gid_t *rgid, gid_t *egid, gid_t *sgid) -1,-1,191
pid_t gettid() 224,224,222
ssize_t readahead(int, off64_t, size_t) 225,225,223
int getgroups:getgroups32(int, gid_t *) 205,205,-1
int getgroups:getgroups(int, gid_t *) -1,-1,80
pid_t getpgid(pid_t) 132 pid_t getpgid(pid_t) 132
pid_t getppid() 64 pid_t getppid() 64
pid_t getsid(pid_t) 147,147,151
pid_t setsid() 66 pid_t setsid() 66
int setgid:setgid32(gid_t) 214,214,-1 int setgid:setgid32(gid_t) 214
int setgid:setgid(gid_t) -1,-1,46
int seteuid:seteuid32(uid_t) stub int seteuid:seteuid32(uid_t) stub
int __setreuid:setreuid32(uid_t, uid_t) 203,203,-1 int __setreuid:setreuid32(uid_t, uid_t) 203
int __setreuid:setreuid(uid_t, uid_t) -1,-1,70 int __setresuid:setresuid32(uid_t, uid_t, uid_t) 208
int __setresuid:setresuid32(uid_t, uid_t, uid_t) 208,208,-1 int setresgid:setresgid32(gid_t, gid_t, gid_t) 210
int __setresuid:setresuid(uid_t, uid_t, uid_t) -1,-1,185
int setresgid:setresgid32(gid_t, gid_t, gid_t) 210,210,-1
int setresgid:setresgid(gid_t, gid_t, gid_t) -1,-1,190
void* __brk:brk(void*) 45 void* __brk:brk(void*) 45
# see comments in arch-arm/bionic/kill.S to understand why we don't generate an ARM stub for kill/tkill # see comments in arch-arm/bionic/kill.S to understand why we don't generate an ARM stub for kill/tkill
int kill(pid_t, int) -1,37,37 int kill(pid_t, int) -1,37
int tkill(pid_t tid, int sig) -1,238,236 int tkill(pid_t tid, int sig) -1,238
int tgkill(pid_t tgid, pid_t tid, int sig) -1,270,266
int __ptrace:ptrace(int request, int pid, void* addr, void* data) 26 int __ptrace:ptrace(int request, int pid, void* addr, void* data) 26
int __set_thread_area:set_thread_area(void* user_desc) -1,243,283 int __set_thread_area:set_thread_area(void* user_desc) -1,243
int __getpriority:getpriority(int, int) 96 int __getpriority:getpriority(int, int) 96
int setpriority(int, int, int) 97 int setpriority(int, int, int) 97
int setrlimit(int resource, const struct rlimit *rlp) 75 int setrlimit(int resource, const struct rlimit *rlp) 75
int getrlimit:ugetrlimit(int resource, struct rlimit *rlp) 191,191,-1 int getrlimit:ugetrlimit(int resource, struct rlimit *rlp) 191
int getrlimit:getrlimit(int resource, struct rlimit *rlp) -1,-1,76
int getrusage(int who, struct rusage* r_usage) 77 int getrusage(int who, struct rusage* r_usage) 77
int setgroups:setgroups32(int, const gid_t *) 206,206,-1 int setgroups:setgroups32(int, const gid_t *) 206
int setgroups:setgroups(int, const gid_t *) -1,-1,81
pid_t getpgrp(void) stub pid_t getpgrp(void) stub
int setpgid(pid_t, pid_t) 57 int setpgid(pid_t, pid_t) 57
pid_t vfork(void) 190,-1,-1 pid_t vfork(void) 190,-1,190
int setregid:setregid32(gid_t, gid_t) 204,204,-1 int setregid:setregid32(gid_t, gid_t) 204
int setregid:setregid(gid_t, gid_t) -1,-1,71
int chroot(const char *) 61 int chroot(const char *) 61
# IMPORTANT: Even though <sys/prctl.h> declares prctl(int,...), the syscall stub must take 6 arguments # IMPORTANT: Even though <sys/prctl.h> declares prctl(int,...), the syscall stub must take 6 arguments
# to match the kernel implementation. # to match the kernel implementation.
int prctl(int option, unsigned int arg2, unsigned int arg3, unsigned int arg4, unsigned int arg5) 172,172,192 int prctl(int option, unsigned int arg2, unsigned int arg3, unsigned int arg4, unsigned int arg5) 172
int capget(cap_user_header_t header, cap_user_data_t data) 184,184,204 int capget(cap_user_header_t header, cap_user_data_t data) 184
int capset(cap_user_header_t header, const cap_user_data_t data) 185,185,205 int capset(cap_user_header_t header, const cap_user_data_t data) 185
int sigaltstack(const stack_t*, stack_t*) 186,186,206 int sigaltstack(const stack_t*, stack_t*) 186
int acct(const char* filepath) 51 int acct(const char* filepath) 51
# file descriptors # file descriptors
ssize_t read (int, void*, size_t) 3 ssize_t read (int, void*, size_t) 3
ssize_t write (int, const void*, size_t) 4 ssize_t write (int, const void*, size_t) 4
ssize_t pread64 (int, void *, size_t, off64_t) 180,180,200 ssize_t pread64 (int, void *, size_t, off64_t) 180
ssize_t pwrite64 (int, void *, size_t, off64_t) 181,181,201 ssize_t pwrite64 (int, void *, size_t, off64_t) 181
int __open:open (const char*, int, mode_t) 5 int __open:open (const char*, int, mode_t) 5
int __openat:openat (int, const char*, int, mode_t) 322,295,288 int __openat:openat (int, const char*, int, mode_t) 322,295
int close (int) 6 int close (int) 6
int creat(const char*, mode_t) stub int creat(const char*, mode_t) stub
off_t lseek(int, off_t, int) 19 off_t lseek(int, off_t, int) 19
int __llseek:_llseek (int, unsigned long, unsigned long, loff_t*, int) 140 int __llseek:_llseek (int, unsigned long, unsigned long, loff_t*, int) 140
pid_t getpid () 20 pid_t getpid () 20
void * mmap(void *, size_t, int, int, int, long) stub void * mmap(void *, size_t, int, int, int, long) stub
void * __mmap2:mmap2(void*, size_t, int, int, int, long) 192,192,210 void * __mmap2:mmap2(void*, size_t, int, int, int, long) 192
int munmap(void *, size_t) 91 int munmap(void *, size_t) 91
void * mremap(void *, size_t, size_t, unsigned long) 163,163,167 void * mremap(void *, size_t, size_t, unsigned long) 163
int msync(const void *, size_t, int) 144 int msync(const void *, size_t, int) 144
int mprotect(const void *, size_t, int) 125 int mprotect(const void *, size_t, int) 125
int madvise(const void *, size_t, int) 220,219,218 int madvise(const void *, size_t, int) 220,219
int mlock(const void *addr, size_t len) 150,150,154 int mlock(const void *addr, size_t len) 150
int munlock(const void *addr, size_t len) 151,151,155 int munlock(const void *addr, size_t len) 151
int mlockall(int flags) 152,152,156 int mincore(void* start, size_t length, unsigned char* vec) 219,218
int munlockall() 153,153,157
int mincore(void* start, size_t length, unsigned char* vec) 219,218,217
int __ioctl:ioctl(int, int, void *) 54 int __ioctl:ioctl(int, int, void *) 54
int readv(int, const struct iovec *, int) 145 int readv(int, const struct iovec *, int) 145
int writev(int, const struct iovec *, int) 146 int writev(int, const struct iovec *, int) 146
@@ -134,115 +114,95 @@ int flock(int, int) 143
int fchmod(int, mode_t) 94 int fchmod(int, mode_t) 94
int dup(int) 41 int dup(int) 41
int pipe(int *) 42,42,-1 int pipe(int *) 42,42,-1
int pipe2(int *, int) 359,331,328 int pipe2(int *, int) 359,331
int dup2(int, int) 63 int dup2(int, int) 63
int select:_newselect(int, struct fd_set *, struct fd_set *, struct fd_set *, struct timeval *) 142 int select:_newselect(int, struct fd_set *, struct fd_set *, struct fd_set *, struct timeval *) 142
int ftruncate(int, off_t) 93 int ftruncate(int, off_t) 93
int ftruncate64(int, off64_t) 194,194,212 int ftruncate64(int, off64_t) 194
int getdents:getdents64(unsigned int, struct dirent *, unsigned int) 217,220,219 int getdents:getdents64(unsigned int, struct dirent *, unsigned int) 217,220
int fsync(int) 118 int fsync(int) 118
int fdatasync(int) 148,148,152 int fdatasync(int) 148
int fchown:fchown32(int, uid_t, gid_t) 207,207,-1 int fchown:fchown32(int, uid_t, gid_t) 207
int fchown:fchown(int, uid_t, gid_t) -1,-1,95
void sync(void) 36 void sync(void) 36
int __fcntl64:fcntl64(int, int, void *) 221,221,220 int __fcntl64:fcntl64(int, int, void *) 221
int __fstatfs64:fstatfs64(int, size_t, struct statfs *) 267,269,256 int __fstatfs64:fstatfs64(int, size_t, struct statfs *) 267,269
ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count) 187,187,207 ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count) 187
int fstatat:fstatat64(int dirfd, const char *path, struct stat *buf, int flags) 327,300,293 int fstatat:fstatat64(int dirfd, const char *path, struct stat *buf, int flags) 327,300
int mkdirat(int dirfd, const char *pathname, mode_t mode) 323,296,289 int mkdirat(int dirfd, const char *pathname, mode_t mode) 323,296
int fchownat(int dirfd, const char *path, uid_t owner, gid_t group, int flags) 325,298,291 int fchownat(int dirfd, const char *path, uid_t owner, gid_t group, int flags) 325,298
int fchmodat(int dirfd, const char *path, mode_t mode, int flags) 333,306,299 int fchmodat(int dirfd, const char *path, mode_t mode, int flags) 333,306
int renameat(int olddirfd, const char *oldpath, int newdirfd, const char *newpath) 329,302,295 int renameat(int olddirfd, const char *oldpath, int newdirfd, const char *newpath) 329,302
int fsetxattr(int, const char *, const void *, size_t, int) 228,228,226
ssize_t fgetxattr(int, const char *, void *, size_t) 231,231,229
ssize_t flistxattr(int, char *, size_t) 234,234,232
int fremovexattr(int, const char *) 237,237,235
# file system # file system
int link (const char*, const char*) 9 int link (const char*, const char*) 9
int unlink (const char*) 10 int unlink (const char*) 10
int unlinkat (int, const char *, int) 328,301,294 int unlinkat (int, const char *, int) 328,301
int chdir (const char*) 12 int chdir (const char*) 12
int mknod (const char*, mode_t, dev_t) 14 int mknod (const char*, mode_t, dev_t) 14
int chmod (const char*,mode_t) 15 int chmod (const char*,mode_t) 15
int chown:chown32(const char *, uid_t, gid_t) 212,212,-1 int chown:chown32(const char *, uid_t, gid_t) 212
int chown:chown(const char *, uid_t, gid_t) -1,-1,202 int lchown:lchown32 (const char*, uid_t, gid_t) 198
int lchown:lchown32 (const char*, uid_t, gid_t) 198,198,-1
int lchown:lchown (const char*, uid_t, gid_t) -1,-1,16
int mount (const char*, const char*, const char*, unsigned long, const void*) 21 int mount (const char*, const char*, const char*, unsigned long, const void*) 21
int umount(const char*) stub int umount(const char*) stub
int umount2 (const char*, int) 52 int umount2 (const char*, int) 52
int fstat:fstat64(int, struct stat*) 197,197,215 int fstat:fstat64(int, struct stat*) 197
int stat:stat64(const char *, struct stat *) 195,195,213 int stat:stat64(const char *, struct stat *) 195
int lstat:lstat64(const char *, struct stat *) 196,196,214 int lstat:lstat64(const char *, struct stat *) 196
int mkdir(const char *, mode_t) 39 int mkdir(const char *, mode_t) 39
int readlink(const char *, char *, size_t) 85 int readlink(const char *, char *, size_t) 85
int rmdir(const char *) 40 int rmdir(const char *) 40
int rename(const char *, const char *) 38 int rename(const char *, const char *) 38
int __getcwd:getcwd(char * buf, size_t size) 183,183,203 int __getcwd:getcwd(char * buf, size_t size) 183
int access(const char *, int) 33 int access(const char *, int) 33
int faccessat(int, const char *, int, int) 334,307,300
int symlink(const char *, const char *) 83 int symlink(const char *, const char *) 83
int fchdir(int) 133 int fchdir(int) 133
int truncate(const char*, off_t) 92 int truncate(const char*, off_t) 92
int setxattr(const char *, const char *, const void *, size_t, int) 226,226,224 int __statfs64:statfs64(const char *, size_t, struct statfs *) 266,268
int lsetxattr(const char *, const char *, const void *, size_t, int) 227,227,225
ssize_t getxattr(const char *, const char *, void *, size_t) 229,229,227
ssize_t lgetxattr(const char *, const char *, void *, size_t) 230,230,228
ssize_t listxattr(const char *, char *, size_t) 232,232,230
ssize_t llistxattr(const char *, char *, size_t) 233,233,231
int removexattr(const char *, const char *) 235,235,233
int lremovexattr(const char *, const char *) 236,236,234
int __statfs64:statfs64(const char *, size_t, struct statfs *) 266,268,255
long unshare(unsigned long) 337,310,303
# time # time
int pause () 29 int pause () 29
int gettimeofday(struct timeval*, struct timezone*) 78 int gettimeofday(struct timeval*, struct timezone*) 78
int settimeofday(const struct timeval*, const struct timezone*) 79 int settimeofday(const struct timeval*, const struct timezone*) 79
clock_t times(struct tms *) 43 clock_t times(struct tms *) 43
int nanosleep(const struct timespec *, struct timespec *) 162,162,166 int nanosleep(const struct timespec *, struct timespec *) 162
int clock_gettime(clockid_t clk_id, struct timespec *tp) 263,265,263 int clock_gettime(clockid_t clk_id, struct timespec *tp) 263,265
int clock_settime(clockid_t clk_id, const struct timespec *tp) 262,264,262 int clock_settime(clockid_t clk_id, const struct timespec *tp) 262,264
int clock_getres(clockid_t clk_id, struct timespec *res) 264,266,264 int clock_getres(clockid_t clk_id, struct timespec *res) 264,266
int clock_nanosleep(clockid_t clock_id, int flags, const struct timespec *req, struct timespec *rem) 265,267,265 int clock_nanosleep(const struct timespec *req, struct timespec *rem) 265,267
int getitimer(int, const struct itimerval *) 105 int getitimer(int, const struct itimerval *) 105
int setitimer(int, const struct itimerval *, struct itimerval *) 104 int setitimer(int, const struct itimerval *, struct itimerval *) 104
int __timer_create:timer_create(clockid_t clockid, struct sigevent *evp, timer_t *timerid) 257,259,257 int __timer_create:timer_create(clockid_t clockid, struct sigevent *evp, timer_t *timerid) 257,259
int __timer_settime:timer_settime(timer_t, int, const struct itimerspec*, struct itimerspec*) 258,260,258 int __timer_settime:timer_settime(timer_t, int, const struct itimerspec*, struct itimerspec*) 258,260
int __timer_gettime:timer_gettime(timer_t, struct itimerspec*) 259,261,259 int __timer_gettime:timer_gettime(timer_t, struct itimerspec*) 259,261
int __timer_getoverrun:timer_getoverrun(timer_t) 260,262,260 int __timer_getoverrun:timer_getoverrun(timer_t) 260,262
int __timer_delete:timer_delete(timer_t) 261,263,261 int __timer_delete:timer_delete(timer_t) 261,263
int utimes(const char*, const struct timeval tvp[2]) 269,271,267 int utimes(const char*, const struct timeval tvp[2]) 269, 271
int utimensat(int, const char *, const struct timespec times[2], int) 348,320,316 int utimensat(int, const char *, const struct timespec times[2], int) 348, 320, 320
# signals # signals
int sigaction(int, const struct sigaction *, struct sigaction *) 67 int sigaction(int, const struct sigaction *, struct sigaction *) 67
int sigprocmask(int, const sigset_t *, sigset_t *) 126 int sigprocmask(int, const sigset_t *, sigset_t *) 126
int __sigsuspend:sigsuspend(int unused1, int unused2, unsigned mask) 72,72,-1 int __sigsuspend:sigsuspend(int unused1, int unused2, unsigned mask) 72
int __sigsuspend:sigsuspend(const sigset_t *mask) -1,-1,72 int __rt_sigaction:rt_sigaction (int sig, const struct sigaction *act, struct sigaction *oact, size_t sigsetsize) 174
int __rt_sigaction:rt_sigaction (int sig, const struct sigaction *act, struct sigaction *oact, size_t sigsetsize) 174,174,194 int __rt_sigprocmask:rt_sigprocmask (int how, const sigset_t *set, sigset_t *oset, size_t sigsetsize) 175
int __rt_sigprocmask:rt_sigprocmask (int how, const sigset_t *set, sigset_t *oset, size_t sigsetsize) 175,175,195 int __rt_sigtimedwait:rt_sigtimedwait(const sigset_t *set, struct siginfo_t *info, struct timespec_t *timeout, size_t sigset_size) 177
int __rt_sigtimedwait:rt_sigtimedwait(const sigset_t *set, struct siginfo_t *info, struct timespec_t *timeout, size_t sigset_size) 177,177,197
int sigpending(sigset_t *) 73 int sigpending(sigset_t *) 73
int signalfd4(int fd, const sigset_t *mask, size_t sizemask, int flags) 355,327,324
# sockets # sockets
int socket(int, int, int) 281,-1,183 int socket(int, int, int) 281,-1
int socketpair(int, int, int, int*) 288,-1,184 int socketpair(int, int, int, int*) 288,-1
int bind(int, struct sockaddr *, int) 282,-1,169 int bind(int, struct sockaddr *, int) 282,-1
int connect(int, struct sockaddr *, socklen_t) 283,-1,170 int connect(int, struct sockaddr *, socklen_t) 283,-1
int listen(int, int) 284,-1,174 int listen(int, int) 284,-1
int accept(int, struct sockaddr *, socklen_t *) 285,-1,168 int accept(int, struct sockaddr *, socklen_t *) 285,-1
int getsockname(int, struct sockaddr *, socklen_t *) 286,-1,172 int getsockname(int, struct sockaddr *, socklen_t *) 286,-1
int getpeername(int, struct sockaddr *, socklen_t *) 287,-1,171 int getpeername(int, struct sockaddr *, socklen_t *) 287,-1
int sendto(int, const void *, size_t, int, const struct sockaddr *, socklen_t) 290,-1,180 int sendto(int, const void *, size_t, int, const struct sockaddr *, socklen_t) 290,-1
int recvfrom(int, void *, size_t, unsigned int, struct sockaddr *, socklen_t *) 292,-1,176 int recvfrom(int, void *, size_t, unsigned int, struct sockaddr *, socklen_t *) 292,-1
int shutdown(int, int) 293,-1,182 int shutdown(int, int) 293,-1
int setsockopt(int, int, int, const void *, socklen_t) 294,-1,181 int setsockopt(int, int, int, const void *, socklen_t) 294,-1
int getsockopt(int, int, int, void *, socklen_t *) 295,-1,173 int getsockopt(int, int, int, void *, socklen_t *) 295,-1
int sendmsg(int, const struct msghdr *, unsigned int) 296,-1,179 int sendmsg(int, const struct msghdr *, unsigned int) 296,-1
int recvmsg(int, struct msghdr *, unsigned int) 297,-1,177 int recvmsg(int, struct msghdr *, unsigned int) 297,-1
# sockets for x86. These are done as an "indexed" call to socketcall syscall. # sockets for x86. These are done as an "indexed" call to socketcall syscall.
int socket:socketcall:1 (int, int, int) -1,102,-1 int socket:socketcall:1 (int, int, int) -1,102,-1
@@ -261,22 +221,25 @@ int getsockopt:socketcall:15(int, int, int, void *, socklen_t *) -1
int sendmsg:socketcall:16(int, const struct msghdr *, unsigned int) -1,102,-1 int sendmsg:socketcall:16(int, const struct msghdr *, unsigned int) -1,102,-1
int recvmsg:socketcall:17(int, struct msghdr *, unsigned int) -1,102,-1 int recvmsg:socketcall:17(int, struct msghdr *, unsigned int) -1,102,-1
# sockets for sh.
int __socketcall:socketcall(int, unsigned long*) -1,-1,102
# scheduler & real-time # scheduler & real-time
int sched_setscheduler(pid_t pid, int policy, const struct sched_param *param) 156,156,160 int sched_setscheduler(pid_t pid, int policy, const struct sched_param *param) 156
int sched_getscheduler(pid_t pid) 157,157,161 int sched_getscheduler(pid_t pid) 157
int sched_yield(void) 158,158,162 int sched_yield(void) 158
int sched_setparam(pid_t pid, const struct sched_param *param) 154,154,158 int sched_setparam(pid_t pid, const struct sched_param *param) 154
int sched_getparam(pid_t pid, struct sched_param *param) 155,155,159 int sched_getparam(pid_t pid, struct sched_param *param) 155
int sched_get_priority_max(int policy) 159,159,163 int sched_get_priority_max(int policy) 159
int sched_get_priority_min(int policy) 160,160,164 int sched_get_priority_min(int policy) 160
int sched_rr_get_interval(pid_t pid, struct timespec *interval) 161,161,165 int sched_rr_get_interval(pid_t pid, struct timespec *interval) 161
int sched_setaffinity(pid_t pid, size_t setsize, const cpu_set_t* set) 241,241,239 int sched_setaffinity(pid_t pid, size_t setsize, const cpu_set_t* set) 241
int __sched_getaffinity:sched_getaffinity(pid_t pid, size_t setsize, cpu_set_t* set) 242,242,240 int __sched_getaffinity:sched_getaffinity(pid_t pid, size_t setsize, cpu_set_t* set) 242
int __getcpu:getcpu(unsigned *cpu, unsigned *node, void *unused) 345,318,312 int __getcpu:getcpu(unsigned *cpu, unsigned *node, void *unused) 345,318,318
# io priorities # io priorities
int ioprio_set(int which, int who, int ioprio) 314,289,314 int ioprio_set(int which, int who, int ioprio) 314,289,288
int ioprio_get(int which, int who) 315,290,315 int ioprio_get(int which, int who) 315,290,289
# other # other
int uname(struct utsname *) 122 int uname(struct utsname *) 122
@@ -289,28 +252,23 @@ int delete_module(const char*, unsigned int) 129
int klogctl:syslog(int, char *, int) 103 int klogctl:syslog(int, char *, int) 103
int sysinfo(struct sysinfo *) 116 int sysinfo(struct sysinfo *) 116
int personality(unsigned long) 136 int personality(unsigned long) 136
long perf_event_open(struct perf_event_attr *attr_uptr, pid_t pid, int cpu, int group_fd, unsigned long flags) 364,336,333
# futex # futex
int futex(void *, int, int, void *, void *, int) 240,240,238 int futex(void *, int, int, void *, void *, int) 240
# epoll # epoll
int epoll_create(int size) 250,254,248 int epoll_create(int size) 250,254
int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event) 251,255,249 int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event) 251,255
int epoll_wait(int epfd, struct epoll_event *events, int max, int timeout) 252,256,250 int epoll_wait(int epfd, struct epoll_event *events, int max, int timeout) 252,256
int inotify_init(void) 316,291,284 int inotify_init(void) 316,291,290
int inotify_add_watch(int, const char *, unsigned int) 317,292,285 int inotify_add_watch(int, const char *, unsigned int) 317,292,291
int inotify_rm_watch(int, unsigned int) 318,293,286 int inotify_rm_watch(int, unsigned int) 318,293,292
int poll(struct pollfd *, unsigned int, long) 168,168,188 int poll(struct pollfd *, unsigned int, long) 168
int eventfd:eventfd2(unsigned int, int) 356,328,325 int eventfd:eventfd2(unsigned int, int) 356,328
# ARM-specific ARM_NR_BASE == 0x0f0000 == 983040 # ARM-specific ARM_NR_BASE == 0x0f0000 == 983040
int __set_tls:ARM_set_tls(void*) 983045,-1,-1 int __set_tls:ARM_set_tls(void*) 983045,-1
int cacheflush:ARM_cacheflush(long start, long end, long flags) 983042,-1,-1 int cacheflush:ARM_cacheflush(long start, long end, long flags) 983042,-1
# MIPS-specific
int _flush_cache:cacheflush(char *addr, const int nbytes, const int op) -1,-1,147
int syscall(int number,...) -1,-1,0

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2012 The Android Open Source Project * Copyright (C) 2008 The Android Open Source Project
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -25,8 +25,10 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
.global __get_pc
.type __get_pc, %function
__get_pc:
mov r0, pc
bx lr
__attribute__ ((visibility ("hidden")))
__attribute__ ((section (".data")))
void *__dso_handle = &__dso_handle;

View File

@@ -25,10 +25,10 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
.global __get_sp
.type __get_sp, %function
#include <machine/asm.h> __get_sp:
ENTRY(__get_sp)
mov r0, sp mov r0, sp
bx lr bx lr
END(__get_sp)

View File

@@ -25,20 +25,27 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
#include <asm/unistd.h>
#include <machine/asm.h> #include <machine/asm.h>
#include <sys/linux-syscalls.h>
// void _exit_with_stack_teardown(void* stackBase, int stackSize, int retCode) @ void _exit_with_stack_teardown(void * stackBase, int stackSize, int retCode)
ENTRY(_exit_with_stack_teardown) ENTRY(_exit_with_stack_teardown)
#if __ARM_EABI__
mov lr, r2 mov lr, r2
ldr r7, =__NR_munmap ldr r7, =__NR_munmap
swi #0 // the stack is destroyed by this call swi #0 @ the stack is destroyed by this call
mov r0, lr mov r0, lr
ldr r7, =__NR_exit ldr r7, =__NR_exit
swi #0 swi #0
#else
mov lr, r2
swi # __NR_munmap @ the stack is destroyed by this call
mov r0, lr
swi # __NR_exit
#endif
// exit() should never return, cause a crash if it does @ exit() should never return, cause a crash if it does
mov r0, #0 mov r0, #0
ldr r0, [r0] ldr r0, [r0]
END(_exit_with_stack_teardown) END(_exit_with_stack_teardown)

View File

@@ -1,42 +0,0 @@
/*
* Copyright (C) 2012 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <machine/asm.h>
/*
* Coding the abort function in assembly so that registers are guaranteed to
* be preserved properly regardless of GCC's assumption on the "noreturn"
* attribute. When the registers are not properly preserved we won't be able
* to unwind the stack all the way to the bottom to fully reveal the call
* sequence when the crash happens.
*/
ENTRY(abort)
.save {r3, r14}
stmfd sp!, {r3, r14}
blx PIC_SYM(_C_LABEL(__libc_android_abort), PLT)
END(abort)

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2012 The Android Open Source Project * Copyright (C) 2011 The Android Open Source Project
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -26,17 +26,37 @@
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
#ifndef _PRIVATE_SSP_H #ifndef CRT_LEGACY_WORKAROUND
#define _PRIVATE_SSP_H .arch armv5te
.fpu softvfp
__BEGIN_DECLS .eabi_attribute 20, 1
.eabi_attribute 21, 1
/* GCC uses this on ARM and MIPS; we use it on x86 to set the guard in TLS. */ .eabi_attribute 23, 3
extern uintptr_t __stack_chk_guard; .eabi_attribute 24, 1
.eabi_attribute 25, 1
/* GCC calls this if a stack guard check fails. */ .eabi_attribute 26, 2
extern void __stack_chk_fail(); .eabi_attribute 30, 4
.eabi_attribute 18, 4
__END_DECLS .hidden atexit
.code 16
.thumb_func
ENTRY(atexit)
.LFB0:
.save {r4, lr}
push {r4, lr}
.LCFI0:
ldr r3, .L3
mov r1, #0
@ sp needed for prologue
.LPIC0:
add r3, pc
ldr r2, [r3]
bl __cxa_atexit
pop {r4, pc}
.L4:
.align 2
.L3:
.word __dso_handle-(.LPIC0+4)
.LFE0:
END(atexit)
#endif #endif

View File

@@ -0,0 +1,236 @@
/*
* Copyright (C) 2008 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <sys/linux-syscalls.h>
#include <machine/asm.h>
#include <machine/cpu-features.h>
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
#if defined(__ARM_HAVE_LDREX_STREX)
/*
* ===========================================================================
* ARMv6+ implementation
* ===========================================================================
*/
/* r0(addr) -> r0(old) */
ENTRY(__atomic_dec)
mov r1, r0 @ copy addr so we don't clobber it
1: ldrex r0, [r1] @ load current value into r0
sub r2, r0, #1 @ generate new value into r2
strex r3, r2, [r1] @ try to store new value; result in r3
cmp r3, #0 @ success?
bxeq lr @ yes, return
b 1b @ no, retry
END(__atomic_dec)
/* r0(addr) -> r0(old) */
ENTRY(__atomic_inc)
mov r1, r0
1: ldrex r0, [r1]
add r2, r0, #1
strex r3, r2, [r1]
cmp r3, #0
bxeq lr
b 1b
END(__atomic_inc)
/* r0(old) r1(new) r2(addr) -> r0(zero_if_succeeded) */
ENTRY(__atomic_cmpxchg)
1: mov ip, #2 @ ip=2 means "new != old"
ldrex r3, [r2] @ load current value into r3
teq r0, r3 @ new == old?
strexeq ip, r1, [r2] @ yes, try store, set ip to 0 or 1
teq ip, #1 @ strex failure?
beq 1b @ yes, retry
mov r0, ip @ return 0 on success, 2 on failure
bx lr
END(__atomic_cmpxchg)
/* r0(new) r1(addr) -> r0(old) */
ENTRY(__atomic_swap)
1: ldrex r2, [r1]
strex r3, r0, [r1]
teq r3, #0
bne 1b
mov r0, r2
bx lr
END(__atomic_swap)
#else /*not defined __ARM_HAVE_LDREX_STREX*/
/*
* ===========================================================================
* Pre-ARMv6 implementation
* ===========================================================================
*/
/* int __kernel_cmpxchg(int oldval, int newval, int* ptr) */
.equ kernel_cmpxchg, 0xFFFF0FC0
.equ kernel_atomic_base, 0xFFFF0FFF
/* r0(addr) -> r0(old) */
ENTRY(__atomic_dec)
.save {r4, lr}
stmdb sp!, {r4, lr}
mov r2, r0
1: @ atomic_dec
ldr r0, [r2]
mov r3, #kernel_atomic_base
add lr, pc, #4
sub r1, r0, #1
add pc, r3, #(kernel_cmpxchg - kernel_atomic_base)
bcc 1b
add r0, r1, #1
ldmia sp!, {r4, lr}
bx lr
END(__atomic_dec)
/* r0(addr) -> r0(old) */
ENTRY(__atomic_inc)
.save {r4, lr}
stmdb sp!, {r4, lr}
mov r2, r0
1: @ atomic_inc
ldr r0, [r2]
mov r3, #kernel_atomic_base
add lr, pc, #4
add r1, r0, #1
add pc, r3, #(kernel_cmpxchg - kernel_atomic_base)
bcc 1b
sub r0, r1, #1
ldmia sp!, {r4, lr}
bx lr
END(__atomic_inc)
/* r0(old) r1(new) r2(addr) -> r0(zero_if_succeeded) */
ENTRY(__atomic_cmpxchg)
.save {r4, lr}
stmdb sp!, {r4, lr}
mov r4, r0 /* r4 = save oldvalue */
1: @ atomic_cmpxchg
mov r3, #kernel_atomic_base
add lr, pc, #4
mov r0, r4 /* r0 = oldvalue */
add pc, r3, #(kernel_cmpxchg - kernel_atomic_base)
bcs 2f /* swap was made. we're good, return. */
ldr r3, [r2] /* swap not made, see if it's because *ptr!=oldvalue */
cmp r3, r4
beq 1b
2: @ atomic_cmpxchg
ldmia sp!, {r4, lr}
bx lr
END(__atomic_cmpxchg)
/* r0(new) r1(addr) -> r0(old) */
ENTRY(__atomic_swap)
swp r0, r0, [r1]
bx lr
END(__atomic_swap)
#endif /*not defined __ARM_HAVE_LDREX_STREX*/
/* __futex_wait(*ftx, val, *timespec) */
/* __futex_wake(*ftx, counter) */
/* __futex_syscall3(*ftx, op, val) */
/* __futex_syscall4(*ftx, op, val, *timespec) */
.global __futex_wait
.type __futex_wait, %function
.global __futex_wake
.type __futex_wake, %function
.global __futex_syscall3
.type __futex_syscall3, %function
.global __futex_syscall4
.type __futex_syscall4, %function
#if __ARM_EABI__
ENTRY(__futex_syscall3)
stmdb sp!, {r4, r7}
.save {r4, r7}
ldr r7, =__NR_futex
swi #0
ldmia sp!, {r4, r7}
bx lr
END(__futex_syscall3)
ENTRY(__futex_wait)
stmdb sp!, {r4, r7}
.save {r4, r7}
mov r3, r2
mov r2, r1
mov r1, #FUTEX_WAIT
ldr r7, =__NR_futex
swi #0
ldmia sp!, {r4, r7}
bx lr
END(__futex_wait)
ENTRY(__futex_wake)
.save {r4, r7}
stmdb sp!, {r4, r7}
mov r2, r1
mov r1, #FUTEX_WAKE
ldr r7, =__NR_futex
swi #0
ldmia sp!, {r4, r7}
bx lr
END(__futex_wake)
#else
ENTRY(__futex_syscall3)
swi #__NR_futex
bx lr
END(__futex_syscall3)
ENTRY(__futex_wait)
mov r3, r2
mov r2, r1
mov r1, #FUTEX_WAIT
swi #__NR_futex
bx lr
END(__futex_wait)
ENTRY(__futex_wake)
mov r2, r1
mov r1, #FUTEX_WAKE
swi #__NR_futex
bx lr
END(__futex_wake)
#endif
ENTRY(__futex_syscall4)
b __futex_syscall3
END(__futex_syscall4)

View File

@@ -1,87 +0,0 @@
/*
* Copyright (C) 2011 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/* The purpose of this file is to export a small set of atomic-related
* functions from the C library, to ensure binary ABI compatibility for
* the NDK.
*
* These functions were initially exposed by the NDK through <sys/atomics.h>,
* which was unfortunate because their implementation didn't provide any
* memory barriers at all.
*
* This wasn't a problem for the platform code that used them, because it
* used explicit barrier instructions around them. On the other hand, it means
* that any NDK-generated machine code that linked against them would not
* perform correctly when running on multi-core devices.
*
* To fix this, the platform code was first modified to not use any of these
* functions (everything is now inlined through assembly statements, see
* libc/private/bionic_arm_inline.h and the headers it includes.
*
* The functions here are thus only for the benefit of NDK applications,
* and now includes full memory barriers to prevent any random memory ordering
* issue from cropping.
*
* Note that we also provide an updated <sys/atomics.h> header that defines
* always_inlined versions of the functions that use the GCC builtin
* intrinsics to perform the same thing.
*
* NOTE: There is no need for a similar file for non-ARM platforms.
*/
/* DO NOT INCLUDE <sys/atomics.h> HERE ! */
int
__atomic_cmpxchg(int old, int _new, volatile int *ptr)
{
/* We must return 0 on success */
return __sync_val_compare_and_swap(ptr, old, _new) != old;
}
int
__atomic_swap(int _new, volatile int *ptr)
{
int prev;
do {
prev = *ptr;
} while (__sync_val_compare_and_swap(ptr, prev, _new) != prev);
return prev;
}
int
__atomic_dec(volatile int *ptr)
{
return __sync_fetch_and_sub (ptr, 1);
}
int
__atomic_inc(volatile int *ptr)
{
return __sync_fetch_and_add (ptr, 1);
}

View File

@@ -25,39 +25,49 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
#include <machine/asm.h>
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
#include <machine/asm.h>
// int __pthread_clone(int (*fn)(void*), void* child_stack, int flags, void* arg);
ENTRY(__pthread_clone) ENTRY(__pthread_clone)
# Copy the args onto the new stack. @ insert the args onto the new stack
stmdb r1!, {r0, r3} str r0, [r1, #-4]
str r3, [r1, #-8]
@ do the system call
@ get flags
# The sys_clone system call only takes two arguments: 'flags' and 'child_stack'.
# 'child_stack' is already in r1, but we need to move 'flags' into position.
mov r0, r2 mov r0, r2
stmfd sp!, {r4, r7}
# System call. @ new sp is already in r1
#if __ARM_EABI__
stmfd sp!, {r4, r7}
ldr r7, =__NR_clone ldr r7, =__NR_clone
swi #0 swi #0
#else
swi #__NR_clone
#endif
movs r0, r0 movs r0, r0
beq 1f #if __ARM_EABI__
ldmnefd sp!, {r4, r7}
# In parent, reload saved registers then either exit or set errno. #endif
ldmfd sp!, {r4, r7} blt __error
bxne lr bxne lr
b __set_syscall_errno
1: # The child.
# pick the function arg and call address off the stack and jump @ pick the function arg and call address off the stack and jump
# to the C __thread_entry function which does some setup and then @ to the C __thread_entry function which does some setup and then
# calls the thread's start function @ calls the thread's start function
pop {r0, r1}
# __thread_entry needs the TLS pointer ldr r0, [sp, #-4]
mov r2, sp ldr r1, [sp, #-8]
mov r2, sp @ __thread_entry needs the TLS pointer
b __thread_entry b __thread_entry
__error:
mov r0, #-1
bx lr
END(__pthread_clone) END(__pthread_clone)
@@ -68,8 +78,8 @@ END(__pthread_clone)
# pid_t *pid, void *tls, pid_t *ctid, # pid_t *pid, void *tls, pid_t *ctid,
# int (*fn)(void *), void* arg ); # int (*fn)(void *), void* arg );
# #
# NOTE: This is not the same signature as the glibc # NOTE: This is not the same signature than the GLibc
# __clone function. Placing 'fn' and 'arg' # __clone function here !! Placing 'fn' and 'arg'
# at the end of the parameter list makes the # at the end of the parameter list makes the
# implementation much simpler. # implementation much simpler.
# #
@@ -88,18 +98,20 @@ ENTRY(__bionic_clone)
str r5, [r1, #-4] str r5, [r1, #-4]
str r6, [r1, #-8] str r6, [r1, #-8]
# System call # system call
ldr r7, =__NR_clone ldr r7, =__NR_clone
swi #0 swi #0
movs r0, r0 movs r0, r0
beq 1f beq 1f
# In the parent, reload saved registers then either exit or set errno. # in parent, reload saved registers
# then either exit or error
#
ldmfd sp!, {r4, r5, r6, r7} ldmfd sp!, {r4, r5, r6, r7}
bxne lr bxne lr
b __set_syscall_errno b __set_syscall_errno
1: # The child. 1: # in the child - pick arguments
ldr r0, [sp, #-4] ldr r0, [sp, #-4]
ldr r1, [sp, #-8] ldr r1, [sp, #-8]
b __bionic_clone_entry b __bionic_clone_entry

View File

@@ -1,53 +0,0 @@
/*
* Copyright (C) 2012 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include "../../bionic/libc_init_common.h"
#include <stddef.h>
#include <stdint.h>
__attribute__ ((section (".preinit_array")))
void (*__PREINIT_ARRAY__)(void) = (void (*)(void)) -1;
__attribute__ ((section (".init_array")))
void (*__INIT_ARRAY__)(void) = (void (*)(void)) -1;
__attribute__ ((section (".fini_array")))
void (*__FINI_ARRAY__)(void) = (void (*)(void)) -1;
__LIBC_HIDDEN__ void _start() {
structors_array_t array;
array.preinit_array = &__PREINIT_ARRAY__;
array.init_array = &__INIT_ARRAY__;
array.fini_array = &__FINI_ARRAY__;
void* raw_args = (void*) ((uintptr_t) __builtin_frame_address(0) + sizeof(void*));
__libc_init(raw_args, NULL, &main, &array);
}
#include "__dso_handle.h"
#include "atexit.h"

View File

@@ -25,70 +25,64 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
.text
.align 4
.type _start,#function
.globl _start
# this is the small startup code that is first run when
# any executable that is dynamically-linked with Bionic
# runs.
#
# it's purpose is to call __libc_init with appropriate
# arguments, which are:
#
# - the address of the raw data block setup by the Linux
# kernel ELF loader
#
# - address of an "onexit" function, not used on any
# platform supported by Bionic
#
# - address of the "main" function of the program. We
# can't hard-code it in the adr pseudo instruction
# so we use a tiny trampoline that will get relocated
# by the dynamic linker before this code runs
#
# - address of the constructor list
#
_start:
mov r0, sp
mov r1, #0
adr r2, 0f
adr r3, 1f
b __libc_init
0: b main
1: .long __PREINIT_ARRAY__
.long __INIT_ARRAY__
.long __FINI_ARRAY__
.long __CTOR_LIST__
.section .preinit_array, "aw"
.globl __PREINIT_ARRAY__
__PREINIT_ARRAY__:
.long -1
.section .init_array, "aw" .section .init_array, "aw"
.type __INIT_ARRAY__, @object
.globl __INIT_ARRAY__ .globl __INIT_ARRAY__
__INIT_ARRAY__: __INIT_ARRAY__:
.long -1 .long -1
.section .fini_array, "aw" .section .fini_array, "aw"
.type __FINI_ARRAY__, @object
.globl __FINI_ARRAY__ .globl __FINI_ARRAY__
__FINI_ARRAY__: __FINI_ARRAY__:
.long -1 .long -1
.long __do_global_dtors_aux
.abicalls .section .ctors, "aw"
.text .globl __CTOR_LIST__
.align 2 __CTOR_LIST__:
.set nomips16 .long -1
.ent __do_global_dtors_aux
.type __do_global_dtors_aux, @function
__do_global_dtors_aux:
.frame $sp,32,$31 # vars= 0, regs= 1/0, args= 16, gp= 8
.mask 0x80000000,-4
.fmask 0x00000000,0
.set noreorder
.cpload $25
.set nomacro
addiu $sp,$sp,-32
sw $31,28($sp)
.cprestore 16
lw $2,%got(completed.1269)($28)
lbu $2,%lo(completed.1269)($2)
bne $2,$0,$L8
nop
$L4: #include "__dso_handle.S"
lw $2,%got(__cxa_finalize)($28)
beq $2,$0,$L6
nop
lw $2,%got(__dso_handle)($28)
lw $4,0($2)
lw $25,%call16(__cxa_finalize)($28)
.reloc 1f,R_MIPS_JALR,__cxa_finalize
1: jalr $25
nop
lw $28,16($sp)
$L6:
lw $2,%got(completed.1269)($28)
li $3,1 # 0x1
sb $3,%lo(completed.1269)($2)
$L8:
lw $31,28($sp)
addiu $sp,$sp,32
j $31
nop
.set macro
.set reorder
.end __do_global_dtors_aux
.size __do_global_dtors_aux, .-__do_global_dtors_aux
.local completed.1269
.comm completed.1269,1,1
.weak __cxa_finalize
#include "__dso_handle_so.S"
#include "atexit.S" #include "atexit.S"

View File

@@ -25,27 +25,37 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
/* unlike our auto-generated syscall stubs, this code saves lr
on the stack, as well as a few other registers. this makes
our stack unwinder happy, when we generate debug stack
traces after the C library or other parts of the system
abort due to a fatal runtime error (e.g. detection
of a corrupted malloc heap).
*/
#include <sys/linux-syscalls.h> # Implement static C++ destructors when the shared
#include <machine/asm.h> # library is unloaded through dlclose().
#
# A call to this function must be the first entry
# in the .fini_array. See 3.3.5.3.C of C++ ABI
# standard.
#
__on_dlclose:
adr r0, 0f
ldr r0, [r0]
b __cxa_finalize
#ifndef __NR_tgkill 0:
#define __NR_tgkill 268 .long __dso_handle
.section .init_array, "aw"
.globl __INIT_ARRAY__
__INIT_ARRAY__:
.long -1
.section .fini_array, "aw"
.globl __FINI_ARRAY__
__FINI_ARRAY__:
.long -1
.long __on_dlclose
#ifdef CRT_LEGACY_WORKAROUND
#include "__dso_handle.S"
#else
#include "__dso_handle_so.S"
#endif #endif
ENTRY(tgkill) #include "atexit.S"
stmfd sp!, {r4-r7, ip, lr}
ldr r7, =__NR_tgkill
swi #0
ldmfd sp!, {r4-r7, ip, lr}
movs r0, r0
bxpl lr
b __set_syscall_errno
END(tgkill)

View File

@@ -1,58 +0,0 @@
/*
* Copyright (C) 2012 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
extern void __cxa_finalize(void *);
extern void *__dso_handle;
__attribute__((visibility("hidden"),destructor))
void __on_dlclose() {
__cxa_finalize(&__dso_handle);
}
/* CRT_LEGACY_WORKAROUND should only be defined when building
* this file as part of the platform's C library.
*
* The C library already defines a function named 'atexit()'
* for backwards compatibility with older NDK-generated binaries.
*
* For newer ones, 'atexit' is actually embedded in the C
* runtime objects that are linked into the final ELF
* binary (shared library or executable), and will call
* __cxa_atexit() in order to un-register any atexit()
* handler when a library is unloaded.
*
* This function must be global *and* hidden. Only the
* code inside the same ELF binary should be able to access it.
*/
#ifdef CRT_LEGACY_WORKAROUND
#include "__dso_handle.h"
#else
#include "__dso_handle_so.h"
#include "atexit.h"
#endif

View File

@@ -27,8 +27,7 @@
*/ */
.text .text
.align 4 .align 4
.type __start,@function .type _start,#function
.globl __start
.globl _start .globl _start
# this is the small startup code that is first run when # this is the small startup code that is first run when
@@ -44,103 +43,47 @@
# - address of an "onexit" function, not used on any # - address of an "onexit" function, not used on any
# platform supported by Bionic # platform supported by Bionic
# #
# - address of the "main" function of the program. # - address of the "main" function of the program. We
# can't hard-code it in the adr pseudo instruction
# so we use a tiny trampoline that will get relocated
# by the dynamic linker before this code runs
# #
# - address of the constructor list # - address of the constructor list
# #
.ent __start
__start:
_start: _start:
bal 1f mov r0, sp
1: mov r1, #0
.set noreorder adr r2, 0f
.cpload $ra adr r3, 1f
.set reorder b __libc_init
move $a0, $sp 0: b main
move $a1, $0
la $a2, main
la $a3, 1f
subu $sp, 32
la $t9, __libc_init
j $t9
.end __start
1: .long __PREINIT_ARRAY__ 1: .long __PREINIT_ARRAY__
.long __INIT_ARRAY__ .long __INIT_ARRAY__
.long __FINI_ARRAY__ .long __FINI_ARRAY__
.long __CTOR_LIST__
.section .preinit_array, "aw" .section .preinit_array, "aw"
.type __PREINIT_ARRAY__, @object
.globl __PREINIT_ARRAY__ .globl __PREINIT_ARRAY__
__PREINIT_ARRAY__: __PREINIT_ARRAY__:
.long -1 .long -1
.section .init_array, "aw" .section .init_array, "aw"
.type __INIT_ARRAY__, @object
.globl __INIT_ARRAY__ .globl __INIT_ARRAY__
__INIT_ARRAY__: __INIT_ARRAY__:
.long -1 .long -1
.section .fini_array, "aw" .section .fini_array, "aw"
.type __FINI_ARRAY__, @object
.globl __FINI_ARRAY__ .globl __FINI_ARRAY__
__FINI_ARRAY__: __FINI_ARRAY__:
.long -1 .long -1
.long __do_global_dtors_aux
.abicalls .section .ctors, "aw"
.text .globl __CTOR_LIST__
.align 2 __CTOR_LIST__:
.set nomips16 .long -1
.ent __do_global_dtors_aux
.type __do_global_dtors_aux, @function
__do_global_dtors_aux:
.frame $sp,32,$31 # vars= 0, regs= 1/0, args= 16, gp= 8
.mask 0x80000000,-4
.fmask 0x00000000,0
.set noreorder
.cpload $25
.set nomacro
addiu $sp,$sp,-32
sw $31,28($sp)
.cprestore 16
lw $2,%got(completed.1269)($28)
lbu $2,%lo(completed.1269)($2)
bne $2,$0,$L8
nop
$L4:
lw $2,%got(__cxa_finalize)($28)
beq $2,$0,$L6
nop
lw $2,%got(__dso_handle)($28)
lw $4,0($2)
lw $25,%call16(__cxa_finalize)($28)
.reloc 1f,R_MIPS_JALR,__cxa_finalize
1: jalr $25
nop
lw $28,16($sp)
$L6:
lw $2,%got(completed.1269)($28)
li $3,1 # 0x1
sb $3,%lo(completed.1269)($2)
$L8:
lw $31,28($sp)
addiu $sp,$sp,32
j $31
nop
.set macro
.set reorder
.end __do_global_dtors_aux
.size __do_global_dtors_aux, .-__do_global_dtors_aux
.local completed.1269
.comm completed.1269,1,1
.weak __cxa_finalize
#include "__dso_handle.S" #include "__dso_handle.S"
#include "atexit.S" #include "atexit.S"

View File

@@ -35,6 +35,6 @@
.section .fini_array, "aw" .section .fini_array, "aw"
.long 0 .long 0
#if defined(__linux__) && defined(__ELF__) .section .ctors, "aw"
.section .note.GNU-stack,"",%progbits .long 0
#endif

View File

@@ -26,6 +26,13 @@
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
#if defined(__linux__) && defined(__ELF__) /* This is the same than crtend.S except that a shared library
.section .note.GNU-stack,"",%progbits * cannot have a .preinit_array
#endif */
.section .init_array, "aw"
.long 0
.section .fini_array, "aw"
.long 0

View File

@@ -30,6 +30,22 @@
extern int __cxa_atexit(void (*)(void*), void*, void* ); extern int __cxa_atexit(void (*)(void*), void*, void* );
/* Temporary hack: this variable should not be part of the C library
* itself, but placed in the .bss section of each executable or
* shared library instead.
*
* We keep it here temporarily until the build system has been
* modified properly to use crtbegin_so.S and crtend_so.S when
* generating shared libraries.
*
* It must be a 'weak' symbol to avoid conflicts with the definitions
* that have been moved to crtbegin_static.S and crtbegin_dynamic.S
*
* For the record, it is used for static C++ object construction
* and destruction. See http://www.codesourcery.com/public/cxx-abi/abi.html#dso-dtor
*/
void* __attribute__((weak)) __dso_handle;
/* The "C++ ABI for ARM" document states that static C++ constructors, /* The "C++ ABI for ARM" document states that static C++ constructors,
* which are called from the .init_array, should manually call * which are called from the .init_array, should manually call
* __aeabi_atexit() to register static destructors explicitely. * __aeabi_atexit() to register static destructors explicitely.

View File

@@ -25,8 +25,12 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
typedef long unsigned int *_Unwind_Ptr;
#include <link.h> /* Stubbed out in libdl and defined in the dynamic linker.
* Same semantics as __gnu_Unwind_Find_exidx().
*/
extern _Unwind_Ptr dl_unwind_find_exidx(_Unwind_Ptr pc, int *pcount);
/* For a given PC, find the .so that it belongs to. /* For a given PC, find the .so that it belongs to.
* Returns the base address of the .ARM.exidx section * Returns the base address of the .ARM.exidx section

View File

@@ -25,8 +25,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
typedef long unsigned int *_Unwind_Ptr;
#include <link.h>
/* Find the .ARM.exidx section (which in the case of a static executable /* Find the .ARM.exidx section (which in the case of a static executable
* can be identified through its start and end symbols), and return its * can be identified through its start and end symbols), and return its

View File

@@ -66,7 +66,7 @@
* any native shared library generated with it should now be safe from that * any native shared library generated with it should now be safe from that
* problem. On the other hand, existing shared libraries distributed with * problem. On the other hand, existing shared libraries distributed with
* applications that were generated with a previous version of the NDK * applications that were generated with a previous version of the NDK
* still need all 1.5/1.6 helper functions in libc.so and libm.so * still need all 1.5/1.6 helper functions in libc.so and libn.so
* *
* After 3.2, the toolchain was updated again, adding __aeabi_f2uiz to the * After 3.2, the toolchain was updated again, adding __aeabi_f2uiz to the
* list of requirements. Technically, this is due to mis-linked NDK libraries * list of requirements. Technically, this is due to mis-linked NDK libraries
@@ -110,12 +110,9 @@
XX(__aeabi_fsub) \ XX(__aeabi_fsub) \
XX(__aeabi_i2d) \ XX(__aeabi_i2d) \
XX(__aeabi_i2f) \ XX(__aeabi_i2f) \
XX(__aeabi_idiv) \
XX(__aeabi_l2d) \ XX(__aeabi_l2d) \
XX(__aeabi_l2f) \ XX(__aeabi_l2f) \
XX(__aeabi_lmul) \ XX(__aeabi_lmul) \
XX(__aeabi_llsl) \
XX(__aeabi_llsr) \
XX(__aeabi_ui2d) \ XX(__aeabi_ui2d) \
XX(__aeabi_ui2f) \ XX(__aeabi_ui2f) \
XX(__aeabi_ul2d) \ XX(__aeabi_ul2d) \

View File

@@ -29,93 +29,44 @@
#include <machine/cpu-features.h> #include <machine/cpu-features.h>
#include <machine/asm.h> #include <machine/asm.h>
#ifdef HAVE_32_BYTE_CACHE_LINE
#define CACHE_LINE_SIZE 32
#else
#define CACHE_LINE_SIZE 64
#endif
/* /*
* Optimized memcmp() for Cortex-A9. * Optimized memcmp() for ARM9.
* This would not be optimal on XScale or ARM11, where more prefetching
* and use of PLD will be needed.
* The 2 major optimzations here are
* (1) The main loop compares 16 bytes at a time
* (2) The loads are scheduled in a way they won't stall
*/ */
ENTRY(memcmp) ENTRY(memcmp)
pld [r0, #(CACHE_LINE_SIZE * 0)] PLD (r0, #0)
pld [r0, #(CACHE_LINE_SIZE * 1)] PLD (r1, #0)
/* take of the case where length is 0 or the buffers are the same */ /* take of the case where length is 0 or the buffers are the same */
cmp r0, r1 cmp r0, r1
cmpne r2, #0
moveq r0, #0 moveq r0, #0
bxeq lr bxeq lr
pld [r1, #(CACHE_LINE_SIZE * 0)]
pld [r1, #(CACHE_LINE_SIZE * 1)]
/* make sure we have at least 8+4 bytes, this simplify things below
* and avoid some overhead for small blocks
*/
cmp r2, #(8+4)
bmi 10f
/*
* Neon optimization
* Comparing 32 bytes at a time
*/
#if defined(__ARM_NEON__) && defined(NEON_UNALIGNED_ACCESS)
subs r2, r2, #32
blo 3f
/* preload all the cache lines we need. */
pld [r0, #(CACHE_LINE_SIZE * 2)]
pld [r1, #(CACHE_LINE_SIZE * 2)]
1: /* The main loop compares 32 bytes at a time */
vld1.8 {d0 - d3}, [r0]!
pld [r0, #(CACHE_LINE_SIZE * 2)]
vld1.8 {d4 - d7}, [r1]!
pld [r1, #(CACHE_LINE_SIZE * 2)]
/* Start subtracting the values and merge results */
vsub.i8 q0, q2
vsub.i8 q1, q3
vorr q2, q0, q1
vorr d4, d5
vmov r3, ip, d4
/* Check if there are any differences among the 32 bytes */
orrs r3, ip
bne 2f
subs r2, r2, #32
bhs 1b
b 3f
2:
/* Check if the difference was in the first or last 16 bytes */
sub r0, #32
vorr d0, d1
sub r1, #32
vmov r3, ip, d0
orrs r3, ip
/* if the first 16 bytes are equal, we only have to rewind 16 bytes */
ittt eq
subeq r2, #16
addeq r0, #16
addeq r1, #16
3: /* fix-up the remaining count */
add r2, r2, #32
cmp r2, #(8+4)
bmi 10f
#endif
.save {r4, lr} .save {r4, lr}
/* save registers */ /* save registers */
stmfd sp!, {r4, lr} stmfd sp!, {r4, lr}
PLD (r0, #32)
PLD (r1, #32)
/* since r0 hold the result, move the first source /* since r0 hold the result, move the first source
* pointer somewhere else * pointer somewhere else
*/ */
mov r4, r0 mov r4, r0
/* make sure we have at least 8+4 bytes, this simplify things below
* and avoid some overhead for small blocks
*/
cmp r2, #(8+4)
bmi 8f
/* align first pointer to word boundary /* align first pointer to word boundary
* offset = -src & 3 * offset = -src & 3
*/ */
@@ -152,8 +103,8 @@ ENTRY(memcmp)
subs r2, r2, #(32 + 4) subs r2, r2, #(32 + 4)
bmi 1f bmi 1f
0: pld [r4, #(CACHE_LINE_SIZE * 2)] 0: PLD (r4, #64)
pld [r1, #(CACHE_LINE_SIZE * 2)] PLD (r1, #64)
ldr r0, [r4], #4 ldr r0, [r4], #4
ldr lr, [r1, #4]! ldr lr, [r1, #4]!
eors r0, r0, ip eors r0, r0, ip
@@ -219,24 +170,12 @@ ENTRY(memcmp)
9: /* restore registers and return */ 9: /* restore registers and return */
ldmfd sp!, {r4, lr} ldmfd sp!, {r4, lr}
bx lr bx lr
10: /* process less than 12 bytes */
cmp r2, #0
moveq r0, #0
bxeq lr
mov r3, r0
11:
ldrb r0, [r3], #1
ldrb ip, [r1], #1
subs r0, ip
bxne lr
subs r2, r2, #1
bne 11b
bx lr
END(memcmp) END(memcmp)
5: /*************** non-congruent case ***************/ 5: /*************** non-congruent case ***************/
and r0, r1, #3 and r0, r1, #3
cmp r0, #2 cmp r0, #2
@@ -253,8 +192,8 @@ END(memcmp)
bic r1, r1, #3 bic r1, r1, #3
ldr lr, [r1], #4 ldr lr, [r1], #4
6: pld [r1, #(CACHE_LINE_SIZE * 2)] 6: PLD (r1, #64)
pld [r4, #(CACHE_LINE_SIZE * 2)] PLD (r4, #64)
mov ip, lr, lsr #16 mov ip, lr, lsr #16
ldr lr, [r1], #4 ldr lr, [r1], #4
ldr r0, [r4], #4 ldr r0, [r4], #4

View File

@@ -29,43 +29,31 @@
#include <machine/cpu-features.h> #include <machine/cpu-features.h>
#include <machine/asm.h> #include <machine/asm.h>
#if defined(__ARM_NEON__) && !defined(ARCH_ARM_USE_NON_NEON_MEMCPY) #if defined(__ARM_NEON__)
.text .text
.fpu neon .fpu neon
#ifdef HAVE_32_BYTE_CACHE_LINE
/* a prefetch distance of 2 cache-lines */
#define CACHE_LINE_SIZE 32
#else
/* a prefetch distance of 4 cache-lines works best experimentally */ /* a prefetch distance of 4 cache-lines works best experimentally */
#define CACHE_LINE_SIZE 64 #define CACHE_LINE_SIZE 64
#endif #define PREFETCH_DISTANCE (CACHE_LINE_SIZE*4)
ENTRY(memcpy) ENTRY(memcpy)
.save {r0, lr} .save {r0, lr}
stmfd sp!, {r0, lr}
/* start preloading as early as possible */ /* start preloading as early as possible */
pld [r1, #(CACHE_LINE_SIZE*0)] pld [r1, #(CACHE_LINE_SIZE*0)]
stmfd sp!, {r0, lr}
pld [r1, #(CACHE_LINE_SIZE*1)] pld [r1, #(CACHE_LINE_SIZE*1)]
/* If Neon supports unaligned access then remove the align code,
* unless a size limit has been specified.
*/
#ifndef NEON_UNALIGNED_ACCESS
/* do we have at least 16-bytes to copy (needed for alignment below) */ /* do we have at least 16-bytes to copy (needed for alignment below) */
cmp r2, #16 cmp r2, #16
blo 5f blo 5f
/* check if buffers are aligned. If so, run arm-only version */ /* align destination to half cache-line for the write-buffer */
eor r3, r0, r1
ands r3, r3, #0x3
beq 11f
/* align destination to cache-line for the write-buffer */
rsb r3, r0, #0 rsb r3, r0, #0
ands r3, r3, #0xF ands r3, r3, #0xF
beq 2f beq 0f
/* copy up to 15-bytes (count in r3) */ /* copy up to 15-bytes (count in r3) */
sub r2, r2, r3 sub r2, r2, r3
@@ -86,14 +74,14 @@ ENTRY(memcpy)
vld1.8 {d0}, [r1]! vld1.8 {d0}, [r1]!
vst1.8 {d0}, [r0, :64]! vst1.8 {d0}, [r0, :64]!
2: 2:
/* preload immediately the next cache line, which we may need */
0: /* preload immediately the next cache line, which we may need */
pld [r1, #(CACHE_LINE_SIZE*0)] pld [r1, #(CACHE_LINE_SIZE*0)]
pld [r1, #(CACHE_LINE_SIZE*1)] pld [r1, #(CACHE_LINE_SIZE*1)]
#ifdef HAVE_32_BYTE_CACHE_LINE /* make sure we have at least 64 bytes to copy */
/* make sure we have at least 32 bytes to copy */ subs r2, r2, #64
subs r2, r2, #32 blo 2f
blo 4f
/* preload all the cache lines we need. /* preload all the cache lines we need.
* NOTE: the number of pld below depends on PREFETCH_DISTANCE, * NOTE: the number of pld below depends on PREFETCH_DISTANCE,
@@ -101,32 +89,14 @@ ENTRY(memcpy)
* avoid the goofy code below. In practice this doesn't seem to make * avoid the goofy code below. In practice this doesn't seem to make
* a big difference. * a big difference.
*/ */
pld [r1, #(PREFETCH_DISTANCE)]
1: /* The main loop copies 32 bytes at a time */
vld1.8 {d0 - d3}, [r1]!
pld [r1, #(PREFETCH_DISTANCE)]
subs r2, r2, #32
vst1.8 {d0 - d3}, [r0, :128]!
bhs 1b
#else
/* make sure we have at least 64 bytes to copy */
subs r2, r2, #64
blo 2f
/* preload all the cache lines we need. */
pld [r1, #(CACHE_LINE_SIZE*2)] pld [r1, #(CACHE_LINE_SIZE*2)]
pld [r1, #(CACHE_LINE_SIZE*3)] pld [r1, #(CACHE_LINE_SIZE*3)]
pld [r1, #(PREFETCH_DISTANCE)]
1: /* The main loop copies 64 bytes at a time */ 1: /* The main loop copies 64 bytes at a time */
vld1.8 {d0 - d3}, [r1]! vld1.8 {d0 - d3}, [r1]!
vld1.8 {d4 - d7}, [r1]! vld1.8 {d4 - d7}, [r1]!
#ifdef HAVE_32_BYTE_CACHE_LINE pld [r1, #(PREFETCH_DISTANCE)]
pld [r1, #(CACHE_LINE_SIZE * 2)]
pld [r1, #(CACHE_LINE_SIZE * 3)]
#else
pld [r1, #(CACHE_LINE_SIZE * 3)]
#endif
subs r2, r2, #64 subs r2, r2, #64
vst1.8 {d0 - d3}, [r0, :128]! vst1.8 {d0 - d3}, [r0, :128]!
vst1.8 {d4 - d7}, [r0, :128]! vst1.8 {d4 - d7}, [r0, :128]!
@@ -142,7 +112,7 @@ ENTRY(memcpy)
subs r2, r2, #32 subs r2, r2, #32
vst1.8 {d0 - d3}, [r0, :128]! vst1.8 {d0 - d3}, [r0, :128]!
bhs 3b bhs 3b
#endif
4: /* less than 32 left */ 4: /* less than 32 left */
add r2, r2, #32 add r2, r2, #32
tst r2, #0x10 tst r2, #0x10
@@ -150,6 +120,7 @@ ENTRY(memcpy)
// copies 16 bytes, 128-bits aligned // copies 16 bytes, 128-bits aligned
vld1.8 {d0, d1}, [r1]! vld1.8 {d0, d1}, [r1]!
vst1.8 {d0, d1}, [r0, :128]! vst1.8 {d0, d1}, [r0, :128]!
5: /* copy up to 15-bytes (count in r2) */ 5: /* copy up to 15-bytes (count in r2) */
movs ip, r2, lsl #29 movs ip, r2, lsl #29
bcc 1f bcc 1f
@@ -168,164 +139,6 @@ ENTRY(memcpy)
ldmfd sp!, {r0, lr} ldmfd sp!, {r0, lr}
bx lr bx lr
#else /* NEON_UNALIGNED_ACCESS */
// Check so divider is at least 16 bytes, needed for alignment code.
cmp r2, #16
blo 5f
#ifdef NEON_MEMCPY_ALIGNMENT_DIVIDER
/* Check the upper size limit for Neon unaligned memory access in memcpy */
#if NEON_MEMCPY_ALIGNMENT_DIVIDER >= 16
cmp r2, #NEON_MEMCPY_ALIGNMENT_DIVIDER
blo 3f
#endif
/* check if buffers are aligned. If so, run arm-only version */
eor r3, r0, r1
ands r3, r3, #0x3
beq 11f
/* align destination to 16 bytes for the write-buffer */
rsb r3, r0, #0
ands r3, r3, #0xF
beq 3f
/* copy up to 15-bytes (count in r3) */
sub r2, r2, r3
movs ip, r3, lsl #31
ldrmib lr, [r1], #1
strmib lr, [r0], #1
ldrcsb ip, [r1], #1
ldrcsb lr, [r1], #1
strcsb ip, [r0], #1
strcsb lr, [r0], #1
movs ip, r3, lsl #29
bge 1f
// copies 4 bytes, destination 32-bits aligned
vld1.32 {d0[0]}, [r1]!
vst1.32 {d0[0]}, [r0, :32]!
1: bcc 2f
// copies 8 bytes, destination 64-bits aligned
vld1.8 {d0}, [r1]!
vst1.8 {d0}, [r0, :64]!
2:
/* preload immediately the next cache line, which we may need */
pld [r1, #(CACHE_LINE_SIZE * 0)]
pld [r1, #(CACHE_LINE_SIZE * 1)]
3:
#endif
/* make sure we have at least 64 bytes to copy */
subs r2, r2, #64
blo 2f
/* preload all the cache lines we need */
pld [r1, #(CACHE_LINE_SIZE * 2)]
pld [r1, #(CACHE_LINE_SIZE * 3)]
1: /* The main loop copies 64 bytes at a time */
vld1.8 {d0 - d3}, [r1]!
vld1.8 {d4 - d7}, [r1]!
#ifdef HAVE_32_BYTE_CACHE_LINE
pld [r1, #(CACHE_LINE_SIZE * 2)]
pld [r1, #(CACHE_LINE_SIZE * 3)]
#else
pld [r1, #(CACHE_LINE_SIZE * 3)]
#endif
subs r2, r2, #64
vst1.8 {d0 - d3}, [r0]!
vst1.8 {d4 - d7}, [r0]!
bhs 1b
2: /* fix-up the remaining count and make sure we have >= 32 bytes left */
add r2, r2, #64
subs r2, r2, #32
blo 4f
3: /* 32 bytes at a time. These cache lines were already preloaded */
vld1.8 {d0 - d3}, [r1]!
subs r2, r2, #32
vst1.8 {d0 - d3}, [r0]!
bhs 3b
4: /* less than 32 left */
add r2, r2, #32
tst r2, #0x10
beq 5f
// copies 16 bytes, 128-bits aligned
vld1.8 {d0, d1}, [r1]!
vst1.8 {d0, d1}, [r0]!
5: /* copy up to 15-bytes (count in r2) */
movs ip, r2, lsl #29
bcc 1f
vld1.8 {d0}, [r1]!
vst1.8 {d0}, [r0]!
1: bge 2f
vld1.32 {d0[0]}, [r1]!
vst1.32 {d0[0]}, [r0]!
2: movs ip, r2, lsl #31
ldrmib r3, [r1], #1
ldrcsb ip, [r1], #1
ldrcsb lr, [r1], #1
strmib r3, [r0], #1
strcsb ip, [r0], #1
strcsb lr, [r0], #1
ldmfd sp!, {r0, lr}
bx lr
#endif /* NEON_UNALIGNED_ACCESS */
11:
/* Simple arm-only copy loop to handle aligned copy operations */
stmfd sp!, {r4, r5, r6, r7, r8}
pld [r1, #(CACHE_LINE_SIZE * 2)]
/* Check alignment */
rsb r3, r1, #0
ands r3, #3
beq 2f
/* align source to 32 bits. We need to insert 2 instructions between
* a ldr[b|h] and str[b|h] because byte and half-word instructions
* stall 2 cycles.
*/
movs r12, r3, lsl #31
sub r2, r2, r3 /* we know that r3 <= r2 because r2 >= 4 */
ldrmib r3, [r1], #1
ldrcsb r4, [r1], #1
ldrcsb r5, [r1], #1
strmib r3, [r0], #1
strcsb r4, [r0], #1
strcsb r5, [r0], #1
2:
subs r2, #32
blt 5f
pld [r1, #(CACHE_LINE_SIZE * 3)]
3: /* Main copy loop, copying 32 bytes at a time */
pld [r1, #(CACHE_LINE_SIZE * 4)]
ldmia r1!, {r3, r4, r5, r6, r7, r8, r12, lr}
subs r2, r2, #32
stmia r0!, {r3, r4, r5, r6, r7, r8, r12, lr}
bge 3b
5: /* Handle any remaining bytes */
adds r2, #32
beq 6f
movs r12, r2, lsl #28
ldmcsia r1!, {r3, r4, r5, r6} /* 16 bytes */
ldmmiia r1!, {r7, r8} /* 8 bytes */
stmcsia r0!, {r3, r4, r5, r6}
stmmiia r0!, {r7, r8}
movs r12, r2, lsl #30
ldrcs r3, [r1], #4 /* 4 bytes */
ldrmih r4, [r1], #2 /* 2 bytes */
strcs r3, [r0], #4
strmih r4, [r0], #2
tst r2, #0x1
ldrneb r3, [r1] /* last byte */
strneb r3, [r0]
6:
ldmfd sp!, {r4, r5, r6, r7, r8}
ldmfd sp!, {r0, pc}
END(memcpy) END(memcpy)

View File

@@ -26,7 +26,6 @@
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
#include <machine/cpu-features.h>
#include <machine/asm.h> #include <machine/asm.h>
/* /*
@@ -35,104 +34,15 @@
* memset() returns its first argument. * memset() returns its first argument.
*/ */
#if defined(__ARM_NEON__)
.fpu neon
#endif
ENTRY(bzero) ENTRY(bzero)
mov r2, r1 mov r2, r1
mov r1, #0 mov r1, #0
END(bzero) END(bzero)
ENTRY(memset) ENTRY(memset)
#if defined(__ARM_NEON__)
#ifdef NEON_MEMSET_DIVIDER
cmp r2, #NEON_MEMSET_DIVIDER
bhi 11f
#endif
.save {r0}
stmfd sp!, {r0}
vdup.8 q0, r1
#ifndef NEON_UNALIGNED_ACCESS
/* do we have at least 16-bytes to write (needed for alignment below) */
cmp r2, #16
blo 3f
/* align destination to 16 bytes for the write-buffer */
rsb r3, r0, #0
ands r3, r3, #0xF
beq 2f
/* write up to 15-bytes (count in r3) */
sub r2, r2, r3
movs ip, r3, lsl #31
strmib r1, [r0], #1
strcsb r1, [r0], #1
strcsb r1, [r0], #1
movs ip, r3, lsl #29
bge 1f
// writes 4 bytes, 32-bits aligned
vst1.32 {d0[0]}, [r0, :32]!
1: bcc 2f
// writes 8 bytes, 64-bits aligned
vst1.8 {d0}, [r0, :64]!
2:
#endif
/* make sure we have at least 32 bytes to write */
subs r2, r2, #32
blo 2f
vmov q1, q0
1: /* The main loop writes 32 bytes at a time */
subs r2, r2, #32
#ifndef NEON_UNALIGNED_ACCESS
vst1.8 {d0 - d3}, [r0, :128]!
#else
vst1.8 {d0 - d3}, [r0]!
#endif
bhs 1b
2: /* less than 32 left */
add r2, r2, #32
tst r2, #0x10
beq 3f
// writes 16 bytes, 128-bits aligned
#ifndef NEON_UNALIGNED_ACCESS
vst1.8 {d0, d1}, [r0, :128]!
#else
vst1.8 {d0, d1}, [r0]!
#endif
3: /* write up to 15-bytes (count in r2) */
movs ip, r2, lsl #29
bcc 1f
vst1.8 {d0}, [r0]!
1: bge 2f
vst1.32 {d0[0]}, [r0]!
2: movs ip, r2, lsl #31
strmib r1, [r0], #1
strcsb r1, [r0], #1
strcsb r1, [r0], #1
ldmfd sp!, {r0}
bx lr
11:
#endif
/*
* Optimized memset() for ARM.
*
* memset() returns its first argument.
*/
/* compute the offset to align the destination /* compute the offset to align the destination
* offset = (4-(src&3))&3 = -src & 3 * offset = (4-(src&3))&3 = -src & 3
*/ */
.save {r0, r4-r7, lr} .save {r0, r4-r7, lr}
stmfd sp!, {r0, r4-r7, lr} stmfd sp!, {r0, r4-r7, lr}
rsb r3, r0, #0 rsb r3, r0, #0
@@ -168,7 +78,7 @@ ENTRY(memset)
andhi r3, r2, #0x1C andhi r3, r2, #0x1C
sub r2, r2, r3 sub r2, r2, r3
/* conditionally writes 0 to 7 words (length in r3) */ /* conditionnaly writes 0 to 7 words (length in r3) */
movs r3, r3, lsl #28 movs r3, r3, lsl #28
stmcsia r0!, {r1, lr} stmcsia r0!, {r1, lr}
stmcsia r0!, {r1, lr} stmcsia r0!, {r1, lr}
@@ -185,7 +95,7 @@ ENTRY(memset)
bhs 1b bhs 1b
2: add r2, r2, #32 2: add r2, r2, #32
/* conditionally stores 0 to 31 bytes */ /* conditionnaly stores 0 to 31 bytes */
movs r2, r2, lsl #28 movs r2, r2, lsl #28
stmcsia r0!, {r1,r3,r12,lr} stmcsia r0!, {r1,r3,r12,lr}
stmmiia r0!, {r1, lr} stmmiia r0!, {r1, lr}

View File

@@ -25,11 +25,20 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
#include <machine/asm.h>
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(syscall)
.text
.align 4
.type syscall,#function
.globl syscall
.text
.align
#if __ARM_EABI__
syscall:
mov ip, sp mov ip, sp
stmfd sp!, {r4, r5, r6, r7} stmfd sp!, {r4, r5, r6, r7}
mov r7, r0 mov r7, r0
@@ -42,4 +51,21 @@ ENTRY(syscall)
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno
END(syscall)
#else
#ifndef __NR_syscall
#define __NR_syscall 113
#endif
syscall:
stmfd sp!, {r4, r5, lr}
ldr r4, [sp, #12]
ldr r5, [sp, #16]
swi __NR_syscall
ldmfd sp!, {r4, r5, lr}
movs r0, r0
bxpl lr
b __set_syscall_errno
#endif

View File

@@ -77,7 +77,7 @@
#endif /* __ARM_ARCH__ */ #endif /* __ARM_ARCH__ */
#endif /* __GNUC__ */ #endif /* __GNUC__ */
#if defined(__ARMEB__) #ifdef __ARMEB__
#define _BYTE_ORDER _BIG_ENDIAN #define _BYTE_ORDER _BIG_ENDIAN
#else #else
#define _BYTE_ORDER _LITTLE_ENDIAN #define _BYTE_ORDER _LITTLE_ENDIAN

View File

@@ -35,6 +35,17 @@
#ifndef _ARM__TYPES_H_ #ifndef _ARM__TYPES_H_
#define _ARM__TYPES_H_ #define _ARM__TYPES_H_
#if !defined(__ARM_EABI__)
/* the kernel defines size_t as unsigned int, but g++ wants it to be unsigned long */
#define _SIZE_T
#define _SSIZE_T
#define _PTRDIFF_T
typedef unsigned long size_t;
typedef long ssize_t;
typedef long ptrdiff_t;
#endif
/* 7.18.1.1 Exact-width integer types */ /* 7.18.1.1 Exact-width integer types */
typedef __signed char __int8_t; typedef __signed char __int8_t;
typedef unsigned char __uint8_t; typedef unsigned char __uint8_t;
@@ -87,8 +98,6 @@ typedef unsigned long __psize_t;
/* Standard system types */ /* Standard system types */
typedef int __clock_t; typedef int __clock_t;
typedef int __clockid_t; typedef int __clockid_t;
typedef double __double_t;
typedef float __float_t;
typedef long __ptrdiff_t; typedef long __ptrdiff_t;
typedef int __time_t; typedef int __time_t;
typedef int __timer_t; typedef int __timer_t;
@@ -107,4 +116,10 @@ typedef int __rune_t;
typedef void * __wctrans_t; typedef void * __wctrans_t;
typedef void * __wctype_t; typedef void * __wctype_t;
#ifdef __ARMEB__
#define _BYTE_ORDER _BIG_ENDIAN
#else
#define _BYTE_ORDER _LITTLE_ENDIAN
#endif
#endif /* _ARM__TYPES_H_ */ #endif /* _ARM__TYPES_H_ */

View File

@@ -97,12 +97,6 @@
#define ASENTRY_NP(y) _ENTRY(_ASM_LABEL(y)) #define ASENTRY_NP(y) _ENTRY(_ASM_LABEL(y))
#define ASEND(y) _END(_ASM_LABEL(y)) #define ASEND(y) _END(_ASM_LABEL(y))
#ifdef __ELF__
#define ENTRY_PRIVATE(y) ENTRY(y); .hidden _C_LABEL(y)
#else
#define ENTRY_PRIVATE(y) ENTRY(y)
#endif
#define ASMSTR .asciz #define ASMSTR .asciz
#if defined(__ELF__) && defined(PIC) #if defined(__ELF__) && defined(PIC)

View File

@@ -1,138 +0,0 @@
/* $NetBSD: elf_machdep.h,v 1.10 2012/08/05 04:12:46 matt Exp $ */
#ifndef _ARM_ELF_MACHDEP_H_
#define _ARM_ELF_MACHDEP_H_
#if defined(__ARMEB__)
#define ELF32_MACHDEP_ENDIANNESS ELFDATA2MSB
#else
#define ELF32_MACHDEP_ENDIANNESS ELFDATA2LSB
#endif
#define ELF64_MACHDEP_ENDIANNESS XXX /* break compilation */
#define ELF64_MACHDEP_ID_CASES \
/* no 64-bit ELF machine types supported */
/* Processor specific flags for the ELF header e_flags field. */
#define EF_ARM_RELEXEC 0x00000001
#define EF_ARM_HASENTRY 0x00000002
#define EF_ARM_INTERWORK 0x00000004 /* GNU binutils 000413 */
#define EF_ARM_SYMSARESORTED 0x00000004 /* ARM ELF A08 */
#define EF_ARM_APCS_26 0x00000008 /* GNU binutils 000413 */
#define EF_ARM_DYNSYMSUSESEGIDX 0x00000008 /* ARM ELF B01 */
#define EF_ARM_APCS_FLOAT 0x00000010 /* GNU binutils 000413 */
#define EF_ARM_MAPSYMSFIRST 0x00000010 /* ARM ELF B01 */
#define EF_ARM_PIC 0x00000020
#define EF_ARM_ALIGN8 0x00000040 /* 8-bit structure alignment. */
#define EF_ARM_NEW_ABI 0x00000080
#define EF_ARM_OLD_ABI 0x00000100
#define EF_ARM_SOFT_FLOAT 0x00000200
#define EF_ARM_EABIMASK 0xff000000
#define EF_ARM_EABI_VER1 0x01000000
#define EF_ARM_EABI_VER2 0x02000000
#define EF_ARM_EABI_VER3 0x03000000
#define EF_ARM_EABI_VER4 0x04000000
#define EF_ARM_EABI_VER5 0x05000000
#define ELF32_MACHDEP_ID_CASES \
case EM_ARM: \
break;
#define ELF32_MACHDEP_ID EM_ARM
#define ARCH_ELFSIZE 32 /* MD native binary size */
/* Processor specific relocation types */
#define R_ARM_NONE 0
#define R_ARM_PC24 1
#define R_ARM_ABS32 2
#define R_ARM_REL32 3
#define R_ARM_PC13 4
#define R_ARM_ABS16 5
#define R_ARM_ABS12 6
#define R_ARM_THM_ABS5 7
#define R_ARM_ABS8 8
#define R_ARM_SBREL32 9
#define R_ARM_THM_PC22 10
#define R_ARM_THM_PC8 11
#define R_ARM_AMP_VCALL9 12
#define R_ARM_SWI24 13
#define R_ARM_THM_SWI8 14
#define R_ARM_XPC25 15
#define R_ARM_THM_XPC22 16
/* TLS relocations */
#define R_ARM_TLS_DTPMOD32 17 /* ID of module containing symbol */
#define R_ARM_TLS_DTPOFF32 18 /* Offset in TLS block */
#define R_ARM_TLS_TPOFF32 19 /* Offset in static TLS block */
/* 20-31 are reserved for ARM Linux. */
#define R_ARM_COPY 20
#define R_ARM_GLOB_DAT 21
#define R_ARM_JUMP_SLOT 22
#define R_ARM_RELATIVE 23
#define R_ARM_GOTOFF 24
#define R_ARM_GOTPC 25
#define R_ARM_GOT32 26
#define R_ARM_PLT32 27
#define R_ARM_ALU_PCREL_7_0 32
#define R_ARM_ALU_PCREL_15_8 33
#define R_ARM_ALU_PCREL_23_15 34
#define R_ARM_ALU_SBREL_11_0 35
#define R_ARM_ALU_SBREL_19_12 36
#define R_ARM_ALU_SBREL_27_20 37
/* 96-111 are reserved to G++. */
#define R_ARM_GNU_VTENTRY 100
#define R_ARM_GNU_VTINHERIT 101
#define R_ARM_THM_PC11 102
#define R_ARM_THM_PC9 103
/* More TLS relocations */
#define R_ARM_TLS_GD32 104 /* PC-rel 32 bit for global dynamic */
#define R_ARM_TLS_LDM32 105 /* PC-rel 32 bit for local dynamic */
#define R_ARM_TLS_LDO32 106 /* 32 bit offset relative to TLS */
#define R_ARM_TLS_IE32 107 /* PC-rel 32 bit for GOT entry of */
#define R_ARM_TLS_LE32 108
#define R_ARM_TLS_LDO12 109
#define R_ARM_TLS_LE12 110
#define R_ARM_TLS_IE12GP 111
/* 112-127 are reserved for private experiments. */
#define R_ARM_RXPC25 249
#define R_ARM_RSBREL32 250
#define R_ARM_THM_RPC22 251
#define R_ARM_RREL32 252
#define R_ARM_RABS32 253
#define R_ARM_RPC24 254
#define R_ARM_RBASE 255
#define R_TYPE(name) __CONCAT(R_ARM_,name)
/* Processor specific program header flags */
#define PF_ARM_SB 0x10000000
#define PF_ARM_PI 0x20000000
#define PF_ARM_ENTRY 0x80000000
/* Processor specific section header flags */
#define SHF_ENTRYSECT 0x10000000
#define SHF_COMDEF 0x80000000
/* Processor specific symbol types */
#define STT_ARM_TFUNC STT_LOPROC
#ifdef _KERNEL
#ifdef ELFSIZE
#define ELF_MD_PROBE_FUNC ELFNAME2(arm_netbsd,probe)
#endif
struct exec_package;
int arm_netbsd_elf32_probe(struct lwp *, struct exec_package *, void *, char *,
vaddr_t *);
#endif
#endif /* _ARM_ELF_MACHDEP_H_ */

View File

@@ -14,11 +14,9 @@ syscall_src += arch-arm/syscalls/getegid.S
syscall_src += arch-arm/syscalls/getresuid.S syscall_src += arch-arm/syscalls/getresuid.S
syscall_src += arch-arm/syscalls/getresgid.S syscall_src += arch-arm/syscalls/getresgid.S
syscall_src += arch-arm/syscalls/gettid.S syscall_src += arch-arm/syscalls/gettid.S
syscall_src += arch-arm/syscalls/readahead.S
syscall_src += arch-arm/syscalls/getgroups.S syscall_src += arch-arm/syscalls/getgroups.S
syscall_src += arch-arm/syscalls/getpgid.S syscall_src += arch-arm/syscalls/getpgid.S
syscall_src += arch-arm/syscalls/getppid.S syscall_src += arch-arm/syscalls/getppid.S
syscall_src += arch-arm/syscalls/getsid.S
syscall_src += arch-arm/syscalls/setsid.S syscall_src += arch-arm/syscalls/setsid.S
syscall_src += arch-arm/syscalls/setgid.S syscall_src += arch-arm/syscalls/setgid.S
syscall_src += arch-arm/syscalls/__setreuid.S syscall_src += arch-arm/syscalls/__setreuid.S
@@ -59,8 +57,6 @@ syscall_src += arch-arm/syscalls/mprotect.S
syscall_src += arch-arm/syscalls/madvise.S syscall_src += arch-arm/syscalls/madvise.S
syscall_src += arch-arm/syscalls/mlock.S syscall_src += arch-arm/syscalls/mlock.S
syscall_src += arch-arm/syscalls/munlock.S syscall_src += arch-arm/syscalls/munlock.S
syscall_src += arch-arm/syscalls/mlockall.S
syscall_src += arch-arm/syscalls/munlockall.S
syscall_src += arch-arm/syscalls/mincore.S syscall_src += arch-arm/syscalls/mincore.S
syscall_src += arch-arm/syscalls/__ioctl.S syscall_src += arch-arm/syscalls/__ioctl.S
syscall_src += arch-arm/syscalls/readv.S syscall_src += arch-arm/syscalls/readv.S
@@ -88,10 +84,6 @@ syscall_src += arch-arm/syscalls/mkdirat.S
syscall_src += arch-arm/syscalls/fchownat.S syscall_src += arch-arm/syscalls/fchownat.S
syscall_src += arch-arm/syscalls/fchmodat.S syscall_src += arch-arm/syscalls/fchmodat.S
syscall_src += arch-arm/syscalls/renameat.S syscall_src += arch-arm/syscalls/renameat.S
syscall_src += arch-arm/syscalls/fsetxattr.S
syscall_src += arch-arm/syscalls/fgetxattr.S
syscall_src += arch-arm/syscalls/flistxattr.S
syscall_src += arch-arm/syscalls/fremovexattr.S
syscall_src += arch-arm/syscalls/link.S syscall_src += arch-arm/syscalls/link.S
syscall_src += arch-arm/syscalls/unlink.S syscall_src += arch-arm/syscalls/unlink.S
syscall_src += arch-arm/syscalls/unlinkat.S syscall_src += arch-arm/syscalls/unlinkat.S
@@ -111,20 +103,10 @@ syscall_src += arch-arm/syscalls/rmdir.S
syscall_src += arch-arm/syscalls/rename.S syscall_src += arch-arm/syscalls/rename.S
syscall_src += arch-arm/syscalls/__getcwd.S syscall_src += arch-arm/syscalls/__getcwd.S
syscall_src += arch-arm/syscalls/access.S syscall_src += arch-arm/syscalls/access.S
syscall_src += arch-arm/syscalls/faccessat.S
syscall_src += arch-arm/syscalls/symlink.S syscall_src += arch-arm/syscalls/symlink.S
syscall_src += arch-arm/syscalls/fchdir.S syscall_src += arch-arm/syscalls/fchdir.S
syscall_src += arch-arm/syscalls/truncate.S syscall_src += arch-arm/syscalls/truncate.S
syscall_src += arch-arm/syscalls/setxattr.S
syscall_src += arch-arm/syscalls/lsetxattr.S
syscall_src += arch-arm/syscalls/getxattr.S
syscall_src += arch-arm/syscalls/lgetxattr.S
syscall_src += arch-arm/syscalls/listxattr.S
syscall_src += arch-arm/syscalls/llistxattr.S
syscall_src += arch-arm/syscalls/removexattr.S
syscall_src += arch-arm/syscalls/lremovexattr.S
syscall_src += arch-arm/syscalls/__statfs64.S syscall_src += arch-arm/syscalls/__statfs64.S
syscall_src += arch-arm/syscalls/unshare.S
syscall_src += arch-arm/syscalls/pause.S syscall_src += arch-arm/syscalls/pause.S
syscall_src += arch-arm/syscalls/gettimeofday.S syscall_src += arch-arm/syscalls/gettimeofday.S
syscall_src += arch-arm/syscalls/settimeofday.S syscall_src += arch-arm/syscalls/settimeofday.S
@@ -150,7 +132,6 @@ syscall_src += arch-arm/syscalls/__rt_sigaction.S
syscall_src += arch-arm/syscalls/__rt_sigprocmask.S syscall_src += arch-arm/syscalls/__rt_sigprocmask.S
syscall_src += arch-arm/syscalls/__rt_sigtimedwait.S syscall_src += arch-arm/syscalls/__rt_sigtimedwait.S
syscall_src += arch-arm/syscalls/sigpending.S syscall_src += arch-arm/syscalls/sigpending.S
syscall_src += arch-arm/syscalls/signalfd4.S
syscall_src += arch-arm/syscalls/socket.S syscall_src += arch-arm/syscalls/socket.S
syscall_src += arch-arm/syscalls/socketpair.S syscall_src += arch-arm/syscalls/socketpair.S
syscall_src += arch-arm/syscalls/bind.S syscall_src += arch-arm/syscalls/bind.S
@@ -189,7 +170,6 @@ syscall_src += arch-arm/syscalls/delete_module.S
syscall_src += arch-arm/syscalls/klogctl.S syscall_src += arch-arm/syscalls/klogctl.S
syscall_src += arch-arm/syscalls/sysinfo.S syscall_src += arch-arm/syscalls/sysinfo.S
syscall_src += arch-arm/syscalls/personality.S syscall_src += arch-arm/syscalls/personality.S
syscall_src += arch-arm/syscalls/perf_event_open.S
syscall_src += arch-arm/syscalls/futex.S syscall_src += arch-arm/syscalls/futex.S
syscall_src += arch-arm/syscalls/epoll_create.S syscall_src += arch-arm/syscalls/epoll_create.S
syscall_src += arch-arm/syscalls/epoll_ctl.S syscall_src += arch-arm/syscalls/epoll_ctl.S

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(__brk) ENTRY(__brk)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_brk ldr r7, =__NR_brk
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(__fcntl) ENTRY(__fcntl)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_fcntl ldr r7, =__NR_fcntl
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(__fcntl64) ENTRY(__fcntl64)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_fcntl64 ldr r7, =__NR_fcntl64
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(__fork) ENTRY(__fork)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_fork ldr r7, =__NR_fork
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(__fstatfs64) ENTRY(__fstatfs64)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_fstatfs64 ldr r7, =__NR_fstatfs64
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(__getcpu) ENTRY(__getcpu)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_getcpu ldr r7, =__NR_getcpu
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(__getcwd) ENTRY(__getcwd)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_getcwd ldr r7, =__NR_getcwd
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(__getpriority) ENTRY(__getpriority)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_getpriority ldr r7, =__NR_getpriority
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(__ioctl) ENTRY(__ioctl)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_ioctl ldr r7, =__NR_ioctl
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(__open) ENTRY(__open)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_open ldr r7, =__NR_open
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(__openat) ENTRY(__openat)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_openat ldr r7, =__NR_openat
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(__ptrace) ENTRY(__ptrace)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_ptrace ldr r7, =__NR_ptrace
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(__reboot) ENTRY(__reboot)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_reboot ldr r7, =__NR_reboot
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(__rt_sigaction) ENTRY(__rt_sigaction)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_rt_sigaction ldr r7, =__NR_rt_sigaction
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(__rt_sigprocmask) ENTRY(__rt_sigprocmask)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_rt_sigprocmask ldr r7, =__NR_rt_sigprocmask
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(__rt_sigtimedwait) ENTRY(__rt_sigtimedwait)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_rt_sigtimedwait ldr r7, =__NR_rt_sigtimedwait
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(__sched_getaffinity) ENTRY(__sched_getaffinity)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_sched_getaffinity ldr r7, =__NR_sched_getaffinity
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(__set_tls) ENTRY(__set_tls)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_ARM_set_tls ldr r7, =__NR_ARM_set_tls
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(__setresuid) ENTRY(__setresuid)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_setresuid32 ldr r7, =__NR_setresuid32
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(__setreuid) ENTRY(__setreuid)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_setreuid32 ldr r7, =__NR_setreuid32
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(__setuid) ENTRY(__setuid)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_setuid32 ldr r7, =__NR_setuid32
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(__sigsuspend) ENTRY(__sigsuspend)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_sigsuspend ldr r7, =__NR_sigsuspend
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(__statfs64) ENTRY(__statfs64)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_statfs64 ldr r7, =__NR_statfs64
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(__syslog) ENTRY(__syslog)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_syslog ldr r7, =__NR_syslog
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(__timer_create) ENTRY(__timer_create)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_timer_create ldr r7, =__NR_timer_create
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(__timer_delete) ENTRY(__timer_delete)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_timer_delete ldr r7, =__NR_timer_delete
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(__timer_getoverrun) ENTRY(__timer_getoverrun)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_timer_getoverrun ldr r7, =__NR_timer_getoverrun
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(__timer_gettime) ENTRY(__timer_gettime)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_timer_gettime ldr r7, =__NR_timer_gettime
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(__timer_settime) ENTRY(__timer_settime)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_timer_settime ldr r7, =__NR_timer_settime
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(__wait4) ENTRY(__wait4)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_wait4 ldr r7, =__NR_wait4
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(_exit) ENTRY(_exit)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_exit_group ldr r7, =__NR_exit_group
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(_exit_thread) ENTRY(_exit_thread)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_exit ldr r7, =__NR_exit
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(accept) ENTRY(accept)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_accept ldr r7, =__NR_accept
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(access) ENTRY(access)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_access ldr r7, =__NR_access
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(acct) ENTRY(acct)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_acct ldr r7, =__NR_acct
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(bind) ENTRY(bind)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_bind ldr r7, =__NR_bind
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(cacheflush) ENTRY(cacheflush)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_ARM_cacheflush ldr r7, =__NR_ARM_cacheflush
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(capget) ENTRY(capget)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_capget ldr r7, =__NR_capget
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(capset) ENTRY(capset)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_capset ldr r7, =__NR_capset
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(chdir) ENTRY(chdir)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_chdir ldr r7, =__NR_chdir
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(chmod) ENTRY(chmod)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_chmod ldr r7, =__NR_chmod
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(chown) ENTRY(chown)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_chown32 ldr r7, =__NR_chown32
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(chroot) ENTRY(chroot)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_chroot ldr r7, =__NR_chroot
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(clock_getres) ENTRY(clock_getres)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_clock_getres ldr r7, =__NR_clock_getres
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(clock_gettime) ENTRY(clock_gettime)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_clock_gettime ldr r7, =__NR_clock_gettime
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(clock_nanosleep) ENTRY(clock_nanosleep)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_clock_nanosleep ldr r7, =__NR_clock_nanosleep
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(clock_settime) ENTRY(clock_settime)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_clock_settime ldr r7, =__NR_clock_settime
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(close) ENTRY(close)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_close ldr r7, =__NR_close
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(connect) ENTRY(connect)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_connect ldr r7, =__NR_connect
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(delete_module) ENTRY(delete_module)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_delete_module ldr r7, =__NR_delete_module
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(dup) ENTRY(dup)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_dup ldr r7, =__NR_dup
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(dup2) ENTRY(dup2)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_dup2 ldr r7, =__NR_dup2
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(epoll_create) ENTRY(epoll_create)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_epoll_create ldr r7, =__NR_epoll_create
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(epoll_ctl) ENTRY(epoll_ctl)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_epoll_ctl ldr r7, =__NR_epoll_ctl
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(epoll_wait) ENTRY(epoll_wait)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_epoll_wait ldr r7, =__NR_epoll_wait
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(eventfd) ENTRY(eventfd)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_eventfd2 ldr r7, =__NR_eventfd2
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(execve) ENTRY(execve)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_execve ldr r7, =__NR_execve
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -1,13 +0,0 @@
/* autogenerated by gensyscalls.py */
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
ENTRY(faccessat)
mov ip, r7
ldr r7, =__NR_faccessat
swi #0
mov r7, ip
movs r0, r0
bxpl lr
b __set_syscall_errno
END(faccessat)

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(fchdir) ENTRY(fchdir)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_fchdir ldr r7, =__NR_fchdir
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(fchmod) ENTRY(fchmod)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_fchmod ldr r7, =__NR_fchmod
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(fchmodat) ENTRY(fchmodat)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_fchmodat ldr r7, =__NR_fchmodat
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(fchown) ENTRY(fchown)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_fchown32 ldr r7, =__NR_fchown32
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(fdatasync) ENTRY(fdatasync)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_fdatasync ldr r7, =__NR_fdatasync
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

View File

@@ -1,13 +0,0 @@
/* autogenerated by gensyscalls.py */
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
ENTRY(fgetxattr)
mov ip, r7
ldr r7, =__NR_fgetxattr
swi #0
mov r7, ip
movs r0, r0
bxpl lr
b __set_syscall_errno
END(fgetxattr)

View File

@@ -1,13 +0,0 @@
/* autogenerated by gensyscalls.py */
#include <machine/asm.h>
#include <sys/linux-syscalls.h>
ENTRY(flistxattr)
mov ip, r7
ldr r7, =__NR_flistxattr
swi #0
mov r7, ip
movs r0, r0
bxpl lr
b __set_syscall_errno
END(flistxattr)

View File

@@ -3,10 +3,11 @@
#include <sys/linux-syscalls.h> #include <sys/linux-syscalls.h>
ENTRY(flock) ENTRY(flock)
mov ip, r7 .save {r4, r7}
stmfd sp!, {r4, r7}
ldr r7, =__NR_flock ldr r7, =__NR_flock
swi #0 swi #0
mov r7, ip ldmfd sp!, {r4, r7}
movs r0, r0 movs r0, r0
bxpl lr bxpl lr
b __set_syscall_errno b __set_syscall_errno

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