bionic/libm: fix x86 support regression

Support for x86 and MIPS broke due to an incorrect merge conflict
resolution in commit 5015fe9.  Commit d348cd5 repaired MIPS support
but not x86.  This commit repairs the incorrect merge conflict
resolution, bringing back support for x86 (and potential future
architectures).

Change-Id: I8994d653e5a2f79c9bfacb1c87159c8cdd4f81a7
bionic/libc: fix getsid() syscall number for mips

According to libc/kernel/arch-mips/asm/unistd.h, the syscall number
for mips is 151, not 147.

Only bionic/libc/SYSCALLS.TXT was manually edited;
bionic/libc/include/sys/linux-syscalls.h was generated from
SYSCALLS.TXT by running bionic/libc/tools/gensyscalls.py.

Change-Id: Ia14da35acbc36aafd44a059146a37271bd358ae2
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>
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>
Add stack unwinding directives to memcpy.

Also include some Android specific header files.

Change-Id: Idbcbd43458ba945ca8c61bfbc04ea15fc0ae4e00
Dynamically allocate soinfo-structs in linker

Request memory from the system when needed instead of having a fixed
array for soinfo structs. Note that malloc() et al can't be used in
linker, so use mmap() instead.

Change-Id: Ia77e6a835db0f4a0bfeccc4a6610b857459fd437
Merge pull request #2 from CyanogenMod/cm-10.1

Cm 10.1
bionic/libm: fix x86 support regression

Support for x86 and MIPS broke due to an incorrect merge conflict
resolution in commit 5015fe9.  Commit d348cd5 repaired MIPS support
but not x86.  This commit repairs the incorrect merge conflict
resolution, bringing back support for x86 (and potential future
architectures).

Change-Id: I8994d653e5a2f79c9bfacb1c87159c8cdd4f81a7
bionic/libc: fix getsid() syscall number for mips

According to libc/kernel/arch-mips/asm/unistd.h, the syscall number
for mips is 151, not 147.

Only bionic/libc/SYSCALLS.TXT was manually edited;
bionic/libc/include/sys/linux-syscalls.h was generated from
SYSCALLS.TXT by running bionic/libc/tools/gensyscalls.py.

Change-Id: Ia14da35acbc36aafd44a059146a37271bd358ae2
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>
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>
Add stack unwinding directives to memcpy.

Also include some Android specific header files.

Change-Id: Idbcbd43458ba945ca8c61bfbc04ea15fc0ae4e00
Dynamically allocate soinfo-structs in linker

Request memory from the system when needed instead of having a fixed
array for soinfo structs. Note that malloc() et al can't be used in
linker, so use mmap() instead.

Change-Id: Ia77e6a835db0f4a0bfeccc4a6610b857459fd437
Merge commit '7f08676a4c37ed99608b4259670268f48ef1f6cc' into 4.2.2