platform_bionic/libc/private
Christopher Ferris 59a13c122e Optimize __memset_chk, __memcpy_chk. DO NOT MERGE.
This change creates assembler versions of __memcpy_chk/__memset_chk
that is implemented in the memcpy/memset assembler code. This change
avoids an extra call to memcpy/memset, instead allowing a simple fall
through to occur from the chk code into the body of the real
implementation.

Testing:

- Ran the libc_test on __memcpy_chk/__memset_chk on all nexus devices.
- Wrote a small test executable that has three calls to __memcpy_chk and
  three calls to __memset_chk. First call dest_len is length + 1. Second
  call dest_len is length. Third call dest_len is length - 1.
  Verified that the first two calls pass, and the third fails. Examined
  the logcat output on all nexus devices to verify that the fortify
  error message was sent properly.
- I benchmarked the new __memcpy_chk and __memset_chk on all systems. For
  __memcpy_chk and large copies, the savings is relatively small (about 1%).
  For small copies, the savings is large on cortex-a15/krait devices
  (between 5% to 30%).
  For cortex-a9 and small copies, the speed up is present, but relatively
  small (about 3% to 5%).
  For __memset_chk and large copies, the savings is also small (about 1%).
  However, all processors show larger speed-ups on small copies (about 30% to
  100%).

Bug: 9293744

Merge from internal master.

(cherry-picked from 7c860db074)

Change-Id: I916ad305e4001269460ca6ebd38aaa0be8ac7f52
2013-08-14 18:14:43 -07:00
..
__dso_handle.h arm: rewrite crtbegin* as C files. 2012-06-01 14:41:27 -07:00
__dso_handle_so.h Rename __dso_handle_so.c to __dso_handle_so.h 2012-09-07 12:49:41 +08:00
arpa_nameser.h Clean up internal libc logging. 2013-03-15 16:12:58 -07:00
arpa_nameser_compat.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
bionic_atomic_arm.h bionic_atomic_arm.h: Remove < ARMv6 support 2013-07-03 14:14:06 -07:00
bionic_atomic_gcc_builtin.h Fix implementation of generic atomic operations 2012-07-24 13:56:38 -07:00
bionic_atomic_inline.h Report errors to the log, not just stderr. 2012-07-27 17:43:38 -07:00
bionic_atomic_mips.h [MIPS] Add atomic routines 2012-07-24 10:30:22 -07:00
bionic_atomic_x86.h bionic: Do not use <sys/atomics.h> for platform code. 2011-11-16 16:28:10 +01:00
bionic_auxv.h Ensure header files using __BEGIN_DECLS include sys/cdefs.h. 2013-06-05 17:58:08 -07:00
bionic_futex.h Ensure header files using __BEGIN_DECLS include sys/cdefs.h. 2013-06-05 17:58:08 -07:00
bionic_pthread.h Handle pthread-related changes (mutex/atfork) 2012-03-26 15:38:59 -07:00
bionic_ssp.h Simplify __stack_chk_fail, and fix it so we get debuggerd stack traces. 2013-02-14 14:37:34 -08:00
bionic_time.h Ensure header files using __BEGIN_DECLS include sys/cdefs.h. 2013-06-05 17:58:08 -07:00
bionic_tls.h Define PTHREAD_KEYS_MAX and _POSIX_THREAD_KEYS_MAX in a POSIX-compliant way. 2013-07-29 17:09:36 -07:00
cpuacct.h Remove compiler warnings when building Bionic. 2010-06-22 17:51:41 -07:00
ctype_private.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
ErrnoRestorer.h Revert "Revert "More pthreads cleanup."" 2013-02-12 15:27:18 -08:00
kernel_sigset_t.h Only have one copy of the kernel_sigset_t hack, and add more tests. 2013-01-10 14:42:14 -08:00
KernelArgumentBlock.h Make abort messages available to debuggerd. 2013-04-05 11:24:19 -07:00
libc_events.h Optimize __memset_chk, __memcpy_chk. DO NOT MERGE. 2013-08-14 18:14:43 -07:00
libc_logging.h Optimize __memset_chk, __memcpy_chk. DO NOT MERGE. 2013-08-14 18:14:43 -07:00
nsswitch.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
rand48.h Upgrade to the current NetBSD rand implementation. 2012-10-01 13:53:41 -07:00
resolv_cache.h resolv_cache: hide some libc private functions 2013-03-29 13:56:05 -07:00
resolv_iface.h dns cache per interface iteration 2 2013-02-07 09:40:16 -08:00
resolv_private.h am 87b4286f: Merge "Expose dn_comp and dn_expand to system C code." 2013-07-02 16:02:30 -07:00
resolv_static.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
ScopedPthreadMutexLocker.h Fix dlerror(3). 2012-10-11 16:08:51 -07:00
ScopedReaddir.h Reimplement scandir(3). 2013-02-25 13:14:31 -08:00
syscommon.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
thread_private.h Clean up useless declaration in thread_private.h 2013-06-05 11:26:24 +08:00
ThreadLocalBuffer.h Revert "Revert "More pthreads cleanup."" 2013-02-12 15:27:18 -08:00