Commit Graph

2339 Commits

Author SHA1 Message Date
Ben Cheng
b9ef7f4e12 am 52b3aed7: am c5c6cb3f: am 66273ac2: Merge "Adding strcmp tuned for Cortex-A15."
* commit '52b3aed7982e9d68aad0652f54d5ee180ddf1c5a':
  Adding strcmp tuned for Cortex-A15.
2013-03-01 18:28:25 +00:00
Ben Cheng
ae280bcdbe am 55fc93a9: am 8f149da0: am b3b1ab62: Merge "Adding memcpy tuned for Cortex-A15."
* commit '55fc93a90961022e38ef0bb63bcb81d2b4e5aef6':
  Adding memcpy tuned for Cortex-A15.
2013-03-01 18:28:25 +00:00
Nick Kralevich
04190c53e3 am cc646773: am 305a9995: am 8fa924e5: Merge "unistd.h: don\'t include sys/capability.h"
* commit 'cc64677342209d38f88138c03d3ded0e1d61637c':
  unistd.h: don't include sys/capability.h
2013-03-01 18:28:24 +00:00
Ben Cheng
52b3aed798 am c5c6cb3f: am 66273ac2: Merge "Adding strcmp tuned for Cortex-A15."
* commit 'c5c6cb3f13642386e08acf687b4bc39f568bad0c':
  Adding strcmp tuned for Cortex-A15.
2013-03-01 10:26:52 -08:00
Ben Cheng
55fc93a909 am 8f149da0: am b3b1ab62: Merge "Adding memcpy tuned for Cortex-A15."
* commit '8f149da08dc3125824e168f8d29613be80b2085c':
  Adding memcpy tuned for Cortex-A15.
2013-03-01 10:26:52 -08:00
Nick Kralevich
cc64677342 am 305a9995: am 8fa924e5: Merge "unistd.h: don\'t include sys/capability.h"
* commit '305a999589a8dfde077589106853522d483d24d2':
  unistd.h: don't include sys/capability.h
2013-03-01 10:26:51 -08:00
Ben Cheng
c5c6cb3f13 am 66273ac2: Merge "Adding strcmp tuned for Cortex-A15."
* commit '66273ac2b6b8c2042350204575bd290d96dea681':
  Adding strcmp tuned for Cortex-A15.
2013-03-01 10:24:58 -08:00
Ben Cheng
8f149da08d am b3b1ab62: Merge "Adding memcpy tuned for Cortex-A15."
* commit 'b3b1ab6213df15f99c9af3088cfe733428816fd3':
  Adding memcpy tuned for Cortex-A15.
2013-03-01 10:24:58 -08:00
Nick Kralevich
305a999589 am 8fa924e5: Merge "unistd.h: don\'t include sys/capability.h"
* commit '8fa924e5dff4588cca8586e0e727b9a544db7083':
  unistd.h: don't include sys/capability.h
2013-03-01 10:24:57 -08:00
Ben Cheng
66273ac2b6 Merge "Adding strcmp tuned for Cortex-A15." 2013-03-01 18:18:34 +00:00
Ben Cheng
b3b1ab6213 Merge "Adding memcpy tuned for Cortex-A15." 2013-03-01 18:18:05 +00:00
Nick Kralevich
6524d3cad7 unistd.h: don't include sys/capability.h
Don't pull in unnecessary header files. AFAIK, I've fixed all
the code which didn't include the correct header files.

Change-Id: If0b7bba74e77cb24a0cf9ce8968aa07400855e58
2013-03-01 10:10:55 -08:00
Greta Yorsh
eb149e954e Adding strcmp tuned for Cortex-A15.
The attached patch provides a new implementation of strcmp for ARM,
using LDRD instead of LDR whenever possible.

For older architectures that do not support LDRD, this implementation
uses the same algorithm as before.

Testing and benchmarking:
* Validation: successfully passes a test that compares different strings
of length 1-128 and offsets 0-8 from a word boundary. Checked on
qemu/A15/A9, ARM/Thumb mode, Big/Little Endian.
* Integration with gcc: no regression on qemu for arm-none-eabi --with-cpu
a15/a9 --with-mode arm/thumb.

Change-Id: I9e230e1b99dbdc9119b69ee858a89038c516a4ea
Signed-off-by: Vassilis Laganakos <vasileios.laganakos@arm.com>
2013-03-01 10:41:01 +00:00
Greta Yorsh
5b349fc22e Adding memcpy tuned for Cortex-A15.
The strategy for large block sizes is LDRD and STRD with offset addressing,
where the main loop copies 64 bytes in every iteration, (i.e., 8 calls to
LDRD and STRD pairs), interleaving load and stores (i.e., the pairs of LDRD
and STRD of the same data are consecutive instructions), and the writeback
of an updated address is a separate instruction, which allows us to write
back the accumulated update once per iteration.

This strategy is implemented in memcpy.S. In some configurations, a plain
version of memcpy (included from memcpy-stub.c) is used instead of the
optimized one.

Validation:
* Correctness: checked memcpy using a test harness for block sizes
ranging between 1 to 128, and source and destination buffers alignment
ranging in { 0,1,2,3,4,8,12 } bytes each.
* Performance: benchmarking on Cortex-A15 FPGA indicates that this strategy
is better for A15 than the strategy used by glibc and even slightly better
than using NEON. Benchmarking on Cortex-A9 bare metal and Linux shows
that the proposed strategy is reasonable: not as fast as the version of
memcpy from glibc (which is the best open source strategy for A9), but
comparable with csl and bionic.
* Integration with GCC: no regression for arm-none-eabi --with-cpu
cortex-a15 and cortex-a9.

Change-Id: Ied56354d8992c62ae3e02d582a2bd55585d814b9
Signed-off-by: Vassilis Laganakos <vasileios.laganakos@arm.com>
2013-03-01 10:40:50 +00:00
Christopher Ferris
7c83a1ed81 Break bionic implementations into arch versions. DO NOT MERGE
Move arch specific code for arm, mips, x86 into separate
makefiles.
In addition, add different arm cpu versions of memcpy/memset.

Bug: 8005082

(cherry picked from commit acdde8c1cf)

Change-Id: I0108d432af9f6283ae99adfc92a3399e5ab3e31d
2013-02-28 17:45:16 -08:00
Elliott Hughes
04766565d3 am 9c102ccf: am 7fe8229b: am 9c1912c4: Merge "Avoid changing the C++ ABI with ssize_t."
* commit '9c102ccf9517637f9d293b4e52f9a40573d8fc1d':
  Avoid changing the C++ ABI with ssize_t.
2013-02-28 19:46:19 +00:00
Elliott Hughes
9c102ccf95 am 7fe8229b: am 9c1912c4: Merge "Avoid changing the C++ ABI with ssize_t."
* commit '7fe8229b49ea091d769b63052247ca12280975eb':
  Avoid changing the C++ ABI with ssize_t.
2013-02-28 11:44:20 -08:00
Elliott Hughes
7fe8229b49 am 9c1912c4: Merge "Avoid changing the C++ ABI with ssize_t."
* commit '9c1912c4bf5eb0edc07bfd333226c4e0b7a629eb':
  Avoid changing the C++ ABI with ssize_t.
2013-02-28 11:43:11 -08:00
Elliott Hughes
e255642dc1 Avoid changing the C++ ABI with ssize_t.
Bug: 8253769
Change-Id: Ia325003ed6e59da553e2bdde7c43515bc191b8ba
2013-02-28 10:51:31 -08:00
Nick Kralevich
30f1622a34 am 82f4cc5d: am 58b997c8: am f5f906c1: Merge "libc: create sys/capability.h"
* commit '82f4cc5de495c6cc3d3736ab075ccd05285beabc':
  libc: create sys/capability.h
2013-02-26 21:55:28 +00:00
Nick Kralevich
82f4cc5de4 am 58b997c8: am f5f906c1: Merge "libc: create sys/capability.h"
* commit '58b997c8121455ecb9aa1b80d7c796115149ec2a':
  libc: create sys/capability.h
2013-02-26 13:51:26 -08:00
Nick Kralevich
58b997c812 am f5f906c1: Merge "libc: create sys/capability.h"
* commit 'f5f906c184677b8295523231cfeead9ed94661ad':
  libc: create sys/capability.h
2013-02-26 13:50:03 -08:00
Nick Kralevich
7c0dd555c0 libc: create sys/capability.h
Per "man capset", sys/capability.h is the appropriate header file
for the capget / capset definition, not unistd.h. Fixed.

As a short term hack, continue to include sys/capability.h in
unistd.h, until we can fix all the code which uses capget / capset.

Change-Id: I6e7cf55955d761ca785a14c5e4b7a44125d8fc15
2013-02-26 13:27:15 -08:00
Elliott Hughes
aa13eaa934 am d9cb6988: am 406968b2: am c0e9ddd0: Merge "Reimplement scandir(3)."
* commit 'd9cb69881a062c615a8009be0a70270c70eb35da':
  Reimplement scandir(3).
2013-02-25 22:58:44 +00:00
Elliott Hughes
d9cb69881a am 406968b2: am c0e9ddd0: Merge "Reimplement scandir(3)."
* commit '406968b2444bf29e449acebdfb7ff174abd1e0ad':
  Reimplement scandir(3).
2013-02-25 14:56:51 -08:00
Elliott Hughes
406968b244 am c0e9ddd0: Merge "Reimplement scandir(3)."
* commit 'c0e9ddd002f6084c29c26236d741d64d01713c15':
  Reimplement scandir(3).
2013-02-25 14:54:54 -08:00
Elliott Hughes
701bec2af3 Reimplement scandir(3).
The old scandir implementation didn't take into account the varying
size of directory entries, and didn't correctly clean up on its
error exits.

Bug: 7339844
Change-Id: Ib40e3564709752241a3119a496cbb2192e3f9abe
2013-02-25 13:14:31 -08:00
Elliott Hughes
92ce5cc4bc am ed1068c8: am 7b8bf681: am f6bb5bf4: Merge "Add the glibc-compatible names to <sys/endian.h>."
* commit 'ed1068c86ea0380e4b4909252367ffacc812ad57':
  Add the glibc-compatible names to <sys/endian.h>.
2013-02-22 14:09:30 -08:00
Elliott Hughes
ed1068c86e am 7b8bf681: am f6bb5bf4: Merge "Add the glibc-compatible names to <sys/endian.h>."
* commit '7b8bf68133cda6c5ff9207248b563c2f6297e22a':
  Add the glibc-compatible names to <sys/endian.h>.
2013-02-22 14:06:12 -08:00
Elliott Hughes
7b8bf68133 am f6bb5bf4: Merge "Add the glibc-compatible names to <sys/endian.h>."
* commit 'f6bb5bf498810d0622f66020059c87b96738c35b':
  Add the glibc-compatible names to <sys/endian.h>.
2013-02-22 14:02:44 -08:00
Elliott Hughes
f6bb5bf498 Merge "Add the glibc-compatible names to <sys/endian.h>." 2013-02-22 21:46:59 +00:00
Elliott Hughes
726642cfa5 am dd843914: am 440bc83d: am 7b2c6385: Merge "Fix <memory.h> to be a synonym for <string.h> like in glibc."
* commit 'dd8439141aeac6dc3a64e25f313d08833e1d85f5':
  Fix <memory.h> to be a synonym for <string.h> like in glibc.
2013-02-22 12:16:14 -08:00
Elliott Hughes
dd8439141a am 440bc83d: am 7b2c6385: Merge "Fix <memory.h> to be a synonym for <string.h> like in glibc."
* commit '440bc83d924fa616614b4b426da66c2893048887':
  Fix <memory.h> to be a synonym for <string.h> like in glibc.
2013-02-22 12:12:45 -08:00
Elliott Hughes
440bc83d92 am 7b2c6385: Merge "Fix <memory.h> to be a synonym for <string.h> like in glibc."
* commit '7b2c6385effbb6d6e98bfe29cc6c144211128d9e':
  Fix <memory.h> to be a synonym for <string.h> like in glibc.
2013-02-22 12:10:15 -08:00
Nick Kralevich
bcedca25d3 am 41fb968c: am cadc8583: am bc0e7ee1: Merge "libc: add sys/signal.h for compatibility"
* commit '41fb968c4268d080b0be4493876672efc4a71e16':
  libc: add sys/signal.h for compatibility
2013-02-22 11:59:38 -08:00
Nick Kralevich
41fb968c42 am cadc8583: am bc0e7ee1: Merge "libc: add sys/signal.h for compatibility"
* commit 'cadc858329a5929911eff5f9a208229112e36a93':
  libc: add sys/signal.h for compatibility
2013-02-22 11:56:39 -08:00
Nick Kralevich
cadc858329 am bc0e7ee1: Merge "libc: add sys/signal.h for compatibility"
* commit 'bc0e7ee18157c2ffe65644514555689f4259ccfe':
  libc: add sys/signal.h for compatibility
2013-02-22 11:53:05 -08:00
Elliott Hughes
7b2c6385ef Merge "Fix <memory.h> to be a synonym for <string.h> like in glibc." 2013-02-22 19:49:39 +00:00
Nick Kralevich
5d36baee95 Merge "gethostbyname: fix crash" 2013-02-22 19:32:37 +00:00
Elliott Hughes
6f1b7a6407 Fix <memory.h> to be a synonym for <string.h> like in glibc.
Change-Id: If23589c5d85dffd28788e04b010303620fa178ca
2013-02-22 11:11:48 -08:00
Elliott Hughes
cf820d7e96 Add the glibc-compatible names to <sys/endian.h>.
Also remove declarations for functions that don't exist; these
are all macros.

Bug: http://code.google.com/p/android/issues/detail?id=41769
Change-Id: Ia3774ab2ff7d3c535f83774eac61068f9b11e194
2013-02-22 11:04:27 -08:00
Nick Kralevich
b22a684990 libc: add sys/signal.h for compatibility
Some applications look for sys/signal.h instead of signal.h.
Work around those apps.

Change-Id: I76ac7744ebc56d196b5f0cb9ed381d32817436b9
2013-02-22 10:38:28 -08:00
Nick Kralevich
bfe0640e41 Don't pass pid to dnsproxyd
dnsproxyd can already determine our pid by looking at our
socket connection. It's dangerous (and unneeded) to pass it
ourselves.

Change-Id: I2596d02e361b302259ddb084be2fb75be59889c5
2013-02-21 21:34:11 -08:00
Nick Kralevich
a6b24b7afb gethostbyname: fix crash
When an app doesn't have the internet permission, android_open_proxy
returns NULL, causing a segfault when calling fprintf. Fixed.

Change-Id: I598855350ed0db3cc88e5ae3b400145418a3a615
2013-02-21 20:12:42 -08:00
Elliott Hughes
7dfc6a3cd1 am e974e951: am 2a5b57db: am 580a7073: Merge "Stop advertising rindex(3), which is both deprecated and unimplemented."
* commit 'e974e951606d2efbad4bafe5edbd09c13d875f6a':
  Stop advertising rindex(3), which is both deprecated and unimplemented.
2013-02-21 18:01:17 -08:00
Elliott Hughes
e974e95160 am 2a5b57db: am 580a7073: Merge "Stop advertising rindex(3), which is both deprecated and unimplemented."
* commit '2a5b57db8c711b6f33581a68cfb7b82298ad988c':
  Stop advertising rindex(3), which is both deprecated and unimplemented.
2013-02-21 17:57:53 -08:00
Elliott Hughes
2a5b57db8c am 580a7073: Merge "Stop advertising rindex(3), which is both deprecated and unimplemented."
* commit '580a707376d81bfcb39919f0a1203b39a39dbd8a':
  Stop advertising rindex(3), which is both deprecated and unimplemented.
2013-02-21 17:55:28 -08:00
Nick Kralevich
d470955eb5 am 72e983d6: am 398f46dd: am a0259b42: Merge "libc: remove bcmp prototype"
* commit '72e983d62828e1db5049800b7edef5a1b0cbbcbd':
  libc: remove bcmp prototype
2013-02-21 17:45:27 -08:00
Nick Kralevich
72e983d628 am 398f46dd: am a0259b42: Merge "libc: remove bcmp prototype"
* commit '398f46dd92fbb72e2a275cddccffdfde384bb3b4':
  libc: remove bcmp prototype
2013-02-21 17:42:07 -08:00
Elliott Hughes
538f6fc202 Stop advertising rindex(3), which is both deprecated and unimplemented.
Change-Id: I3c775d9974e49c3f76a53e46e022659657b89034
2013-02-21 17:39:06 -08:00