Revert "bionic_atomic_arm.h: Remove < ARMv6 support"

This reverts commit e91f71783bf86cb10ad52f5618ad07d4e7152b2f.

Change-Id: Ia9847ef454fa294b68f3b4f1d9e06d4ec753266f
armv6: REX routines are currently broken, use alternatives

Change-Id: I7ac05ab6add7802a4cc24fe36f7181e7cdfe07e0
Implement armv6 optimized strlen from glibc 2.18

Change-Id: Ief985c9ca08cb74d9d7e41d3a583e62699f745cf
squashed: revert recent armv6 additions

Revert "Implement armv6 optimized strlen from glibc 2.18"

This reverts commit eeaf61d9771b6268353f04690d3378b71e723fa5.

Revert "armv6: REX routines are currently broken, use alternatives"

This reverts commit 1e7aa69987cb322a9000ca400d05e8c1b00f7580.

Revert "Revert "bionic_atomic_arm.h: Remove < ARMv6 support""

This reverts commit fa51494b5d5d1518b352608abdfaedf8b579865a.

Change-Id: Ib7e489eae623f061d1b50af672c101929846ed8f
Clean up some ARMv4/ARMv5 cruft.

Change-Id: I29e836fea4b53901e29f96c6888869c35f6726be
Clean up the pthread-only atomic stuff a little.

It looks like we can probably just use the generic GCC stuff instead;
the generated code looks pretty similar. We should come back to that.

These routines are only used by the pthread implementation, and
__bionic_atomic_inc isn't used, so we can remove it.

Change-Id: I8b5b8cb30a1b159f0e85c3675aee06ddef39b429
ARM: Change dmb domain for bionic_atomic_barrier()

This patch changes the domain that the memory barrier operates on. Assumes
that the scope of bionic_atomic_barrier() does not include device memory,
memory shared with the GPU or any other memory external to the processor
cluster.

Change-Id: I291e741c98a64c86f3a3cf99811bbf1e714ac9aa
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
Remove harmful attempts to be helpful in pthread_mutex functions.

Most callers won't check for EINVAL, so it's best to fail early.
GCC takes the nonnull attribute as a guarantee that an argument
won't be NULL, so these hacks were already ineffective, which is
how we found that at least one commercial game was using NULL
as if it's a mutex, but actually getting no-op behavior.

Bug: 11971278
Change-Id: I89646e043d931778805a8b692e07a34d076ee6bf
libm: sync with upstream freebsd

Summary:
New long double functions have been included,
but are not in use due to the android double long
handling. imprecise.c is not built for the same reason.

Test Plan: verified

Reviewers: randall.rushing

Differential Revision: http://review.codefirex.com/D232

Change-Id: I77f2b6e202dd500ed38d62edf187a5ac10b3002c
Signed-off-by: DHOMD <DHO@dho.im>
libm: add fmal long double stub

Summary:
This is needed in some target cases, and has since been fixed internally in the AOSP.

From enh@google.com regarding this change:
you were right, and this was the way we should have done it, but i didn't work that out until i fixed this in the same way as part of the aarch64 work (where the weak reference didn't work).

Test Plan: verified

Reviewers: randall.rushing, jriordan001, synergy

Reviewed By: synergy

Differential Revision: http://review.codefirex.com/D234

Change-Id: Ia57674b89e110a7fff4a90c534f67a6bbef57c68
Signed-off-by: DHOMD <DHO@dho.im>
Make use of new memcpy, tweak settings

Summary:
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The new memcpy() is slightly faster than the cortex-strings version,
and fixes the Galaxy Nexus camera issue.

Signed-off-by: Amit Pundir <amit.pundir@linaro.org>

Test Plan: verified in micro bench

Reviewers: randall.rushing, jriordan001, anders3408, synergy

Reviewed By: synergy

Differential Revision: http://review.codefirex.com/D235

Conflicts:
	libc/Android.mk

Change-Id: I89fd0f71c271e047595199e5a6c2f83dd39305a3
Signed-off-by: DHOMD <DHO@dho.im>
libc: support __errno_location

Summary:
Android's errno behavior is the same as glibc's __errno_location.
Support __errno_location for compatibility.

Test Plan: verified fully

Reviewers: randall.rushing, synergy

Reviewed By: synergy

Differential Revision: http://review.codefirex.com/D236

Change-Id: I2f48168d31a870836271319460e3a941c6498022
Signed-off-by: DHOMD <DHO@dho.im>
libc stdlib: implement C99 _Exit and C11 quick_exit API

Summary: needed for some newer changes shortly :)

Test Plan: verified

Reviewers: randall.rushing, jriordan001, synergy

Reviewed By: synergy

Differential Revision: http://review.codefirex.com/D237

Change-Id: I2b34a9cfc2a71721e4bda47b9b06553a096a813c
Signed-off-by: DHOMD <DHO@dho.im>
[ARM] libc: optimized strnlen, strncat, strncmp, and strlcat

Summary:
Date:   Mon Sep 23 14:45:06 2013 -0700

    [ARM] libc: use basic ASM strnlen implementation

    Summary:
    This is based on the current naive strlen routine from
    netbsd

    Test Plan: significant implemented bench gains

    Reviewers: randall.rushing, synergy

    Reviewed By: synergy

    Differential Revision: http://review.codefirex.com/D499

    Conflicts:
        libc/Android.mk

Author: synergydev <synergye@codefi.re>
Date:   Mon Sep 23 14:43:27 2013 -0700

    [ARM] libc: use optimized ASM strncmp implementation

    Summary:
    This strncmp implementation is based on the current
    arm netbsd implementation

    Test Plan: https://sourceware.org/git/?p=glibc.git;a=blob;f=benchtests/bench-strncmp.c;h=25df3dbc2eb25346d9a897f8d7a2ada9725584e3;hb=master and integrated bionic-benchmark

    Reviewers: randall.rushing

Author: synergydev <synergye@codefi.re>
Date:   Sat Sep 21 23:45:58 2013 -0700

    [ARM] libc: use basic ASM strncat implementation

    Summary:
    This implementation is the naive strncat implementation
    for ARM from netbsd upstream.

    Test Plan: Someone else test please, bench gain is significant with http://repo.or.cz/w/glibc.git/blob_plain/ec901dcf2886cfb81d88f9a63cfcd62b9efe6381:/benchtests/bench-strncat.c (no currently integrated bench, only test which is good with this change).

    Reviewers: randall.rushing, ConnorBaker, synergy

    Reviewed By: synergy

Author: synergydev <synergye@codefi.re>
Date:   Mon Sep 23 14:42:47 2013 -0700

    [ARM] libc: use basic ASM strlcat implementation

    Summary: This is based on the netbsd naive strlcat implementation

    Test Plan: +1 here

    Reviewers: randall.rushing, synergy

    Reviewed By: synergy

Test Plan: significant implemented bench gains

Reviewers: randall.rushing, synergy

Reviewed By: synergy

Differential Revision: http://review.codefirex.com/D238

Conflicts:
	libc/Android.mk

Change-Id: Ie9409391cab54527e8949fc879788cf0288db161
Signed-off-by: DHOMD <DHO@dho.im>
[ARM] libc: define return and conditional return macros

Summary: Required by the new strncat, strlcat, strncmp, and strnlen

Test Plan: verified

Reviewers: randall.rushing, jriordan001, anders3408, synergy

Reviewed By: synergy

Differential Revision: http://review.codefirex.com/D239

Change-Id: Id0f59bdf3efafdb06f8ea588bcc08b8fdc5483c5
Signed-off-by: DHOMD <DHO@dho.im>
libc: counting, rounding, and min/max macros

Summary:
These macros are the same as in gnu libc
and bsd's sys/sys/param.h

Test Plan: verified, and used in aosp internally now from glibc set for new linux-perf building.

Reviewers: randall.rushing, jriordan001, synergy

Reviewed By: synergy

Differential Revision: http://review.codefirex.com/D314

Change-Id: I23b32e37f25ece55003da4f883b861240f167117
Re-export libgcc's __aeabi_uidivmod and __popcount_tab

This is required to make the Nexus 10 graphics driver work on a system
compiled with gcc 4.9.

Change-Id: If3f3d488652a736d9ea3e583548d74fae3ffa902
Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>