bionic: Fix aliasing violations

This makes bionic compile with compilers enforcing
strict adherence to aliasing rules (e.g. gcc 4.6+
with -Wstrict-aliasing=2 -Werror=strict-aliasing).

Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
libm: Add a proper sincos() implementation

Add a proper sincos() implementation that unifies the common
calculations for sin and cos instead of running them twice.

This should cause a speedup even in code not using that
(fairly uncommon) function because gcc can optimize separate
sin() and cos() calls into sincos() calls.

Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
bionic:Add new header files for graphics

The header files "hwmem.h" and "b2r2_blt.h" are needed
by the ST-Ericsson graphics implementation.

Signed-off-by: Patrik Ryd <patrik.ryd@stericsson.com>
bionic: Add ARMv7 optimized string handling routines

Add ARMv7 - and especially Cortex-A9 - optimized string handling
routines based on the versions found in the cortex-strings library.

Change-Id: I497075bea5b82aef8989625bdec512029676fe7f
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
bionic: Add workarounds for current compilers

With current compilers, we're getting "this function cannot be inlined"
errors on vsnprintf and strlcpy because the always_inline attribute is
set.

Before marking this a "fix" instead of a "workaround", we should figure
out why the functions can't be inlined.

Change-Id: Id6c5464defafb3f9044c102d32a57e70d760b05d
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
Revert "sha1: Use bswap* to optimize byte order"

This reverts commit 259b660f6a51be7f627e7c2a6376af0b21b55fbb.
This was triggering the new ssp checks and killing processes
bionic: Optimizations for gettimeofday and clock_gettime.

Use the kernel user helper feature to calculate the results
of gettimeofday and clock_gettime without actually calling
into kernel space. If the user helper patches have not been
applied to the kernel, the regular system calls are used as
a fallback.

Change-Id: I3aebc6ac19ab4743725648a1a279819e624cc5c4
timezone: data file should be 32 bit aligned

The zoneinfo.dat file is memory mapped and then read as an int array.
On some platforms this is causing alignment errors (SIGBUS) because
the records are not 32 bit aligned.

My changes: Fixes for 4.2 and also updates zoneinfo to the latest version

Change-Id: Ieea8ef07e49ef86d139c52ebfccf4159c0ebd887
FORTIFY_SOURCE: fortify strchr

Detect when strchr reads off the end of a buffer.

Change-Id: I0e952eedcff5c36d646a9c3bc4e1337b959224f2
FORTIFY_SOURCE: fortify strrchr

This change compliments 049e58369c37fdeacd0380a6bf1e078d9baf819f

Change-Id: I27d015d70a520713c7472558a3c427f546d36ee4
x86: Add missing bionic/memmove_words.c to x86 source to list.

This was causing libdvm to fail with undefined references
when building for the mini_x86 target.

Change-Id: I3c3af3acc87b46c660bf8f46339dfa0509c14c01
Merge "timezone: data file should be 32 bit aligned" into mr1-staging
Add optimized version of memcpy for Cortex A9

Adds new code to memcpy function, optimized for Cortex A9.
Adds new ARM-only loop, for operations where source and
destination are aligned.

Copyright (C) ST-Ericsson SA 2010

Modified neon implementation to fit Cortex A9 cache line size,
for those running 32 bytes L2 cache line size.
Also split the implementation in aligned and unaligned access,
for those that allows unaligned memory access with Neon.
For totally aligned operations, arm-only code is used.

Change-Id: I95ebf6164cd6486b12a7e3e98e369db21e7e18d2
Author: Henrik Smiding henrik.smiding@stericsson.com for ST-Ericsson.
Signed-off-by: Christian Bejram <christian.bejram@stericsson.com>
bionic: Make use of new memcpy, tweak settings

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

Change-Id: Ie65d14992a399e9bc2709a3d710d52b5b1a62e87
Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
Merge remote-tracking branch 'linaro/linaro_android_4.2.1' into jellybean-google
Merge remote-tracking branch 'cm/cm-10.1' into jellybean-google