OSDN Git Service

android-x86/bionic.git
12 years agoam b00d7a33: am eae1f1fb: Merge "res_send: Avoid spurious close()s and (rare) failure"
Jean-Baptiste Queru [Wed, 18 Jan 2012 02:18:29 +0000 (18:18 -0800)]
am b00d7a33: am eae1f1fb: Merge "res_send: Avoid spurious close()s and (rare) failure"

* commit 'b00d7a331c9f2a578a4cfc4dfe0d626aa58fa702':
  res_send: Avoid spurious close()s and (rare) failure

12 years agoam eae1f1fb: Merge "res_send: Avoid spurious close()s and (rare) failure"
Jean-Baptiste Queru [Wed, 18 Jan 2012 02:16:10 +0000 (18:16 -0800)]
am eae1f1fb: Merge "res_send: Avoid spurious close()s and (rare) failure"

* commit 'eae1f1fba33cb105302227b044a14e5abcbe55e7':
  res_send: Avoid spurious close()s and (rare) failure

12 years agoDon't generate sys/linux-unistd.h
Nick Kralevich [Tue, 17 Jan 2012 23:56:26 +0000 (15:56 -0800)]
Don't generate sys/linux-unistd.h

linux-unistd.h was here for reference purposes, but shouldn't
have been accessible to client code. Delete it.

Change-Id: I60c264ff6ca489a48117914bdf6daa486737af8c

12 years agoMerge "update personality.h"
Nick Kralevich [Tue, 17 Jan 2012 23:46:54 +0000 (15:46 -0800)]
Merge "update personality.h"

12 years agoMerge "res_send: Avoid spurious close()s and (rare) failure"
Jean-Baptiste Queru [Tue, 17 Jan 2012 23:26:17 +0000 (15:26 -0800)]
Merge "res_send: Avoid spurious close()s and (rare) failure"

12 years agoam 06f51ba1: am f44de270: add personality() system call.
Nick Kralevich [Tue, 17 Jan 2012 21:09:53 +0000 (13:09 -0800)]
am 06f51ba1: am f44de270: add personality() system call.

* commit '06f51ba1af2fafeec7fdfcba5d635bd001a31b3e':
  add personality() system call.

12 years agoupdate personality.h
Nick Kralevich [Tue, 17 Jan 2012 21:03:11 +0000 (13:03 -0800)]
update personality.h

Pull in an updated version of personality.h from the linux
kernel.

This file was generated using the following command:

cd bionic/libc/kernel/
./tools/clean_header.py -u ../../../external/kernel-headers/original/linux/personality.h

Change-Id: I860ce21110ebf7e7499fb8165584d296a73aa602

12 years agoam f44de270: add personality() system call.
Nick Kralevich [Tue, 17 Jan 2012 19:45:25 +0000 (11:45 -0800)]
am f44de270: add personality() system call.

* commit 'f44de270bba32c9b1b5eff8a34be07b10ddff238':
  add personality() system call.

12 years agores_send: Avoid spurious close()s and (rare) failure
Jim Huang [Mon, 12 Dec 2011 08:32:56 +0000 (16:32 +0800)]
res_send: Avoid spurious close()s and (rare) failure

When looping over the current list of sockets we are connected to,
use getpeername() not getsockname() to find out who the remote
end is.  This change avoids spurious close() and (rare) failure.

Origin: ISC bug #18625 and fixed in libbind 6.0

Change-Id: I5e85f9ff4b98c237978e4bf4bd85ba0a90d768e6

12 years agoadd personality() system call.
Nick Kralevich [Fri, 13 Jan 2012 22:03:01 +0000 (14:03 -0800)]
add personality() system call.

Change-Id: Ie899def8ea1d705930ed83adae1343c1353e7c57

12 years agoMerge "libc: Copy private C library declarations to private/"
David 'Digit' Turner [Fri, 13 Jan 2012 22:25:25 +0000 (14:25 -0800)]
Merge "libc: Copy private C library declarations to private/"

12 years agoFix misspelled Python variable name and typos
Glenn Kasten [Mon, 19 Dec 2011 19:27:50 +0000 (11:27 -0800)]
Fix misspelled Python variable name and typos

Typos:
 - Update pathname in README.txt
 - Fix missing newlines in header update script.

Change-Id: Ib0e053f92a27ff10071b9805fa64e5653ab31b0c

12 years agolibc: Copy private C library declarations to private/
David 'Digit' Turner [Fri, 13 Jan 2012 12:26:50 +0000 (13:26 +0100)]
libc: Copy private C library declarations to private/

This patch is the first in a series that aims at cleaning up the
public C library headers (which end up being distributed with the NDK).

<resolv.h> and <time.h> contain declarations that should not be public.
They are used by other parts of the platform, but NDK applications should
not use or rely on them.

So copy them to private <bionic_time.h> and <resolv_iface.h> headers
and use a guard macro to avoid conflicts when both headers are included
at the same time.

The idea is that we're going to fix the other platform modules to
include these private headers. After this is done, we will remove the
duplicate definitions from <resolv.h> and <time.h>

Change-Id: I121c11936951c98ca7165e811126ed8a4a3a394d

12 years agoam 82c4be54: am ecd0e95a: Adding a timeout to tcp dns lookup connects.
Robert Greenwalt [Thu, 12 Jan 2012 23:05:57 +0000 (15:05 -0800)]
am 82c4be54: am ecd0e95a: Adding a timeout to tcp dns lookup connects.

* commit '82c4be54da0825ebe74b524932c9db733419057a':
  Adding a timeout to tcp dns lookup connects.

12 years agoam ecd0e95a: Adding a timeout to tcp dns lookup connects.
Robert Greenwalt [Thu, 12 Jan 2012 23:03:52 +0000 (15:03 -0800)]
am ecd0e95a: Adding a timeout to tcp dns lookup connects.

* commit 'ecd0e95a0276c1ba72c7331f5e4617815f015f22':
  Adding a timeout to tcp dns lookup connects.

12 years agoAdding a timeout to tcp dns lookup connects.
Robert Greenwalt [Wed, 11 Jan 2012 18:04:48 +0000 (10:04 -0800)]
Adding a timeout to tcp dns lookup connects.

TCP isn't supported on some dns servers, which makes the old code
hang forever.

NOT adding a stopship to remove debugging stuff - it was too painful
(14s timeout on failed tcp dns lookups) so we decided not to bother people.

bug:5766949
Change-Id: I381c20c3e11b8e994438d4f7c58ef643cd36554e

12 years agoMerge "Execute .preinit_array before any shared object initialization functions."
David Turner [Thu, 12 Jan 2012 09:04:46 +0000 (01:04 -0800)]
Merge "Execute .preinit_array before any shared object initialization functions."

12 years agoExecute .preinit_array before any shared object initialization functions.
Evgeniy Stepanov [Wed, 21 Dec 2011 09:03:54 +0000 (13:03 +0400)]
Execute .preinit_array before any shared object initialization functions.

This change makes linker handling of .preinit_array compliant with the
System V ABI:

"These [pre-initialization] functions are executed after the dynamic linker has
built the process image and performed relocations but before any shared object
initialization functions."
http://www.sco.com/developers/gabi/latest/ch5.dynamic.html#init_fini

Change-Id: Iebfee22bb1ebe1d7c7e69cb4686e4ebae0dfc4bb

12 years agoMerge "implement pthread mutex deadlock detection"
Mathias Agopian [Thu, 5 Jan 2012 22:05:30 +0000 (14:05 -0800)]
Merge "implement pthread mutex deadlock detection"

12 years agoam e30e9093: sreadahead: adding readahead system call into bionic libc
Bruce Beare [Wed, 4 Jan 2012 02:37:28 +0000 (18:37 -0800)]
am e30e9093: sreadahead: adding readahead system call into bionic libc

* commit 'e30e909363c5c706f394050d9cd00ce222caadbf':
  sreadahead: adding readahead system call into bionic libc

12 years agosreadahead: adding readahead system call into bionic libc
Bruce Beare [Wed, 13 Jul 2011 17:23:50 +0000 (10:23 -0700)]
sreadahead: adding readahead system call into bionic libc

Add bionic libc to support readahead system call.
This is needed to enable sreadahead to work.

Change-Id: I3856e1a3833db82e6cf42fd34af7631bd40cc723
Author: Winson Yung <winson.w.yung@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
12 years agoMerge "Add the posix_memalign(3) function to bionic"
Ken Sumrall [Tue, 20 Dec 2011 23:06:52 +0000 (15:06 -0800)]
Merge "Add the posix_memalign(3) function to bionic"

12 years agoam a37f3729: readdir: fix interface to kernel getdents64 function
Bruce Beare [Mon, 19 Dec 2011 19:36:48 +0000 (11:36 -0800)]
am a37f3729: readdir: fix interface to kernel getdents64 function

* commit 'a37f3729730e4e7345977915d67adc3eea93dfe4':
  readdir: fix interface to kernel getdents64 function

12 years agoreaddir: fix interface to kernel getdents64 function
Bruce Beare [Tue, 2 Aug 2011 13:43:52 +0000 (06:43 -0700)]
readdir: fix interface to kernel getdents64 function

Issue:
  The kernel will pad the entry->d_reclen in a getdents64 call to a
  long-word boundary.  For very long records, this could exceed the
  size of a struct dirent. The mismatch in the size was causing error
  paranoid checking code in bionic to fail... thus causing an early
  "end" when reading the dirent structures from the kernel buffer.

Test:
 ls
 mkdir abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstu
 ls

Change-Id: I75d1f8e45e1655fdd7bac4a08a481d086f28073a
Author: Bruce Beare <bruce.j.beare@intel.com>

12 years agoAdd the posix_memalign(3) function to bionic
Ken Sumrall [Thu, 15 Dec 2011 04:50:01 +0000 (20:50 -0800)]
Add the posix_memalign(3) function to bionic

The posix_memalign(3) function is very similar to the traditional
memalign(3) function, but with better error reporting and a guarantee
that the memory it allocates can be freed.  In bionic, memalign(3)
allocated memory can be freed, so posix_memalign(3) is just a wrapper
around memalign(3).

Change-Id: I62ee908aa5ba6b887d8446a00d8298d080a6a299

12 years agolibc: x86: Use SSE2 or SSSE3 optimized routines when possible.
David 'Digit' Turner [Wed, 14 Dec 2011 17:23:40 +0000 (18:23 +0100)]
libc: x86: Use SSE2 or SSSE3 optimized routines when possible.

This patch uses the new hardware feature macros for x86 to define
various compile-time macros used to make the C library use
SSE2 and/or SSSE3 optimized memory functions for target CPUs
that support these features.

Note that previously, we relied on the macros being defined by
build/core/combo/TARGET_linux-x86.mk, but this is no longer the
case.

Change-Id: Ieae5ff5284c0c839bc920953fb6b91d2f2633afc

12 years agoam c2d5944e: Reconcile with ics-mr1-release
The Android Open Source Project [Wed, 14 Dec 2011 03:11:25 +0000 (19:11 -0800)]
am c2d5944e: Reconcile with ics-mr1-release

* commit 'c2d5944e19863bb2d831b13893a3bb78e0d53783':

12 years agoReconcile with ics-mr1-release
The Android Open Source Project [Wed, 14 Dec 2011 03:10:03 +0000 (19:10 -0800)]
Reconcile with ics-mr1-release

Change-Id: I62bace5c4272d043a51d3f0f698556716838aa51

12 years agomerge in ics-mr1-release history after reset to ics-mr1
The Android Automerger [Wed, 14 Dec 2011 01:35:59 +0000 (17:35 -0800)]
merge in ics-mr1-release history after reset to ics-mr1

12 years agoam 8d28b043: am 94963af2: update video/dsscomp.h
Erik Gilling [Wed, 14 Dec 2011 01:29:12 +0000 (17:29 -0800)]
am 8d28b043: am 94963af2: update video/dsscomp.h

* commit '8d28b043e93d323684add3406ebae6b8fe6475d5':
  update video/dsscomp.h

12 years agoam 94963af2: update video/dsscomp.h
Erik Gilling [Wed, 14 Dec 2011 00:02:50 +0000 (16:02 -0800)]
am 94963af2: update video/dsscomp.h

* commit '94963af28e445384e19775a838a29e6a71708179':
  update video/dsscomp.h

12 years agoupdate video/dsscomp.h
Erik Gilling [Tue, 13 Dec 2011 22:48:51 +0000 (14:48 -0800)]
update video/dsscomp.h

Change-Id: I9da47f7fb7f34f9c4baa860bb767cb8fd4f8020c
Signed-off-by: Erik Gilling <konkers@android.com>
12 years agoam f3087c6e: am af96d4da: x86: libc may use the gcc flags from TARGET_linux-x86.mk
Bruce Beare [Mon, 12 Dec 2011 23:39:04 +0000 (15:39 -0800)]
am f3087c6e: am af96d4da: x86: libc may use the gcc flags from TARGET_linux-x86.mk

* commit 'f3087c6e86f54874538669d899d8a2ede59f7433':
  x86: libc may use the gcc flags from TARGET_linux-x86.mk

12 years agoam 68ec71eb: am 7d03c9cb: pathconf: dead loop in bionic function __2_symlinks
Bruce Beare [Mon, 12 Dec 2011 23:30:11 +0000 (15:30 -0800)]
am 68ec71eb: am 7d03c9cb: pathconf: dead loop in bionic function __2_symlinks

* commit '68ec71ebd6df12596dc5688c907c76ea4b32c9b4':
  pathconf: dead loop in bionic function __2_symlinks

12 years agoam c14ea96f: Reconcile with ics-mr1-release
The Android Open Source Project [Mon, 12 Dec 2011 23:29:53 +0000 (15:29 -0800)]
am c14ea96f: Reconcile with ics-mr1-release

* commit 'c14ea96f2f4e36f7a3b3d9676df845afb09c2245':

12 years agoam ffe65783: am bba5c314: update video/dsscomp.h
Erik Gilling [Mon, 12 Dec 2011 20:34:57 +0000 (12:34 -0800)]
am ffe65783: am bba5c314: update video/dsscomp.h

* commit 'ffe65783b4afc3f687a54b582a4e236caa22ed30':
  update video/dsscomp.h

12 years agoam af96d4da: x86: libc may use the gcc flags from TARGET_linux-x86.mk
Bruce Beare [Sat, 10 Dec 2011 00:19:30 +0000 (16:19 -0800)]
am af96d4da: x86: libc may use the gcc flags from TARGET_linux-x86.mk

* commit 'af96d4dadc3f3d8466dbbeaf3a816e6871715fbc':
  x86: libc may use the gcc flags from TARGET_linux-x86.mk

12 years agoimplement pthread mutex deadlock detection
Mathias Agopian [Tue, 6 Sep 2011 06:54:55 +0000 (23:54 -0700)]
implement pthread mutex deadlock detection

this works by building a directed graph of acquired
pthread mutexes and making sure there are no loops in
that graph.

this feature is enabled with:

    setprop debug.libc.pthread 1

when a potential deadlock is detected, a large warning is
output to the log with appropriate back traces.

currently disabled at compile-time. set PTHREAD_DEBUG_ENABLED=1
to enable.

Change-Id: I916eed2319599e8aaf8f229d3f18a8ddbec3aa8a

12 years agoam c448c082: Reconcile with ics-mr1-release
The Android Open Source Project [Fri, 9 Dec 2011 22:25:56 +0000 (14:25 -0800)]
am c448c082: Reconcile with ics-mr1-release

* commit 'c448c082cf834f95afcfa3296eba2c67780727cf':

12 years agox86: libc may use the gcc flags from TARGET_linux-x86.mk
Bruce Beare [Fri, 9 Dec 2011 21:52:19 +0000 (13:52 -0800)]
x86: libc may use the gcc flags from TARGET_linux-x86.mk

Change-Id: Iaf4d864d4b6fe388bd3c2d7c4d7d6e42aebb0d35
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
12 years agoam 7d03c9cb: pathconf: dead loop in bionic function __2_symlinks
Bruce Beare [Fri, 9 Dec 2011 18:19:37 +0000 (10:19 -0800)]
am 7d03c9cb: pathconf: dead loop in bionic function __2_symlinks

* commit '7d03c9cbcedb1dc7e3a8210ac0001120558ec6df':
  pathconf: dead loop in bionic function __2_symlinks

12 years agoReconcile with ics-mr1-release
The Android Open Source Project [Fri, 9 Dec 2011 15:10:40 +0000 (07:10 -0800)]
Reconcile with ics-mr1-release

Change-Id: I0a43c4d104894fdde4eff9970bc78ed0aeb88ec2

12 years agomerge in ics-mr1-release history after reset to ics-mr1
The Android Automerger [Fri, 9 Dec 2011 01:34:07 +0000 (17:34 -0800)]
merge in ics-mr1-release history after reset to ics-mr1

12 years agoam bba5c314: update video/dsscomp.h
Erik Gilling [Thu, 8 Dec 2011 22:57:00 +0000 (14:57 -0800)]
am bba5c314: update video/dsscomp.h

* commit 'bba5c314b2420483e2c0e3e441bf54bda6935bc1':
  update video/dsscomp.h

12 years agoupdate video/dsscomp.h
Erik Gilling [Thu, 8 Dec 2011 22:42:04 +0000 (14:42 -0800)]
update video/dsscomp.h

Change-Id: Ic5f1c01add1f2adb5a09d05c94129f3dc9cc3f1f
Signed-off-by: Erik Gilling <konkers@android.com>
12 years agoReconcile with ics-mr1-release
The Android Open Source Project [Thu, 8 Dec 2011 18:17:32 +0000 (10:17 -0800)]
Reconcile with ics-mr1-release

Change-Id: Icc9d31cb9a4f379354808a4c7e913685dfa22e80

12 years agolibc: optimize pthread mutex lock/unlock operations (1/2)
David 'Digit' Turner [Wed, 7 Dec 2011 13:02:17 +0000 (14:02 +0100)]
libc: optimize pthread mutex lock/unlock operations (1/2)

This patch provides several small optimizations to the
implementation of mutex locking and unlocking. Note that
a following patch will get rid of the global recursion
lock, and provide a few more aggressive changes, I
though it'd be simpler to split this change in two parts.

+ New behaviour: pthread_mutex_lock et al now detect
  recursive mutex overflows and will return EAGAIN in
  this case, as suggested by POSIX. Before, the counter
  would just wrap to 0.

- Remove un-necessary reloads of the mutex value from memory
  by storing it in a local variable (mvalue)

- Remove un-necessary reload of the mutex value by passing
  the 'shared' local variable to _normal_lock / _normal_unlock

- Remove un-necessary reload of the mutex value by using a
  new macro (MUTEX_VALUE_OWNER()) to compare the thread id
  for recursive/errorcheck mutexes

- Use a common inlined function to increment the counter
  of a recursive mutex. Also do not use the global
  recursion lock in this case to speed it up.

Change-Id: I106934ec3a8718f8f852ef547f3f0e9d9435c816

12 years agolibc: optimize pthread_once() implementation.
David 'Digit' Turner [Wed, 7 Dec 2011 11:20:44 +0000 (12:20 +0100)]
libc: optimize pthread_once() implementation.

This patch changes the implementation of pthread_once()
to avoid the use of a single global recursive mutex. This
should also slightly speed up the non-common case where
we have to call the init function, or wait for another
thread to finish the call.

Change-Id: I8a93f4386c56fb89b5d0eb716689c2ce43bdcad9

12 years agopathconf: dead loop in bionic function __2_symlinks
Bruce Beare [Fri, 21 Oct 2011 02:16:11 +0000 (10:16 +0800)]
pathconf: dead loop in bionic function __2_symlinks

Fix dead loops in file ./bionic/libc/unistd/pathconf.c

Change-Id: I7a1e6bcd9879c96bacfd376b88a1f899793295c8
Author: Jin Wei <wei.a.jin@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
12 years agoam a73de44b: am 177ba8cb: Prevent deadlock when using fork
Rabin Vincent [Wed, 7 Dec 2011 00:04:56 +0000 (16:04 -0800)]
am a73de44b: am 177ba8cb: Prevent deadlock when using fork

* commit 'a73de44b7c0a50908ea8afe16134316cfc6cfbbe':
  Prevent deadlock when using fork

12 years agoam 177ba8cb: Prevent deadlock when using fork
Rabin Vincent [Tue, 6 Dec 2011 21:59:56 +0000 (13:59 -0800)]
am 177ba8cb: Prevent deadlock when using fork

* commit '177ba8cb42ed6d232e7c8bcad5e6ee21fc51a0e8':
  Prevent deadlock when using fork

12 years agoPrevent deadlock when using fork
Rabin Vincent [Fri, 8 Apr 2011 06:50:48 +0000 (08:50 +0200)]
Prevent deadlock when using fork

When forking of a new process in bionic, it is critical that it
does not allocate any memory according to the comment in
java_lang_ProcessManager.c:
"Note: We cannot malloc() or free() after this point!
A no-longer-running thread may be holding on to the heap lock, and
an attempt to malloc() or free() would result in deadlock."
However, as fork is using standard lib calls when tracing it a bit,
they might allocate memory, and thus causing the deadlock.
This is a rewrite so that the function cpuacct_add, that fork calls,
will use system calls instead of standard lib calls.

Signed-off-by: christian bejram <christian.bejram@stericsson.com>
Change-Id: Iff22ea6b424ce9f9bf0ac8e9c76593f689e0cc86

12 years agoMerge 35765066 from ics-mr1-plus-aosp
Jean-Baptiste Queru [Tue, 6 Dec 2011 16:35:08 +0000 (08:35 -0800)]
Merge 35765066 from ics-mr1-plus-aosp

Change-Id: Ibaeb49dc20f3c736417d5cb68769e7b501a61632

12 years agoam cb835cd7: am cb1df916: string: Fix wrong comparison semantics
Bruce Beare [Tue, 6 Dec 2011 06:13:21 +0000 (22:13 -0800)]
am cb835cd7: am cb1df916: string: Fix wrong comparison semantics

* commit 'cb835cd77c8e60b4a9fb8a54a06d4fd4039ae1b0':
  string: Fix wrong comparison semantics

12 years agoam e4a21c89: signal: Align the sigset_t size passed to from user space to kernel.
Bruce Beare [Tue, 6 Dec 2011 06:12:08 +0000 (22:12 -0800)]
am e4a21c89: signal: Align the sigset_t size passed to from user space to kernel.

* commit 'e4a21c89a8b24b32f7a2637b45522dfa59f2aaa4':
  signal: Align the sigset_t size passed to from user space to kernel.

12 years agoam cb1df916: string: Fix wrong comparison semantics
Bruce Beare [Tue, 6 Dec 2011 06:12:07 +0000 (22:12 -0800)]
am cb1df916: string: Fix wrong comparison semantics

* commit 'cb1df9161666db2a312814752de67fc623149a9b':
  string: Fix wrong comparison semantics

12 years agosignal: Align the sigset_t size passed to from user space to kernel.
Bruce Beare [Mon, 5 Dec 2011 19:25:37 +0000 (11:25 -0800)]
signal: Align the sigset_t size passed to from user space to kernel.

Pass kernel space sigset_t size to __rt_sigprocmask to workaround
the miss-match of NSIG/sigset_t definition between kernel and bionic.

Note: Patch originally from Google...
Change-Id: I4840fdc56d0b90d7ce2334250f04a84caffcba2a
Signed-off-by: Chenyang Du <chenyang.du@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
12 years agostring: Fix wrong comparison semantics
Bruce Beare [Tue, 25 Oct 2011 09:06:09 +0000 (13:06 +0400)]
string: Fix wrong comparison semantics

Chars are signed for x86 -- correct the comparison semantics.

Change-Id: I2049e98eb063c0b4e83ea973d3fcae49c6817dde
Author: Liubov Dmitrieva <liubov.dmitrieva@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
12 years agoam 75039baf: am 89d3fdca: MALLOC_DEBUG: enable the option libc.debug.malloc = 10
Bruce Beare [Tue, 6 Dec 2011 01:02:20 +0000 (17:02 -0800)]
am 75039baf: am 89d3fdca: MALLOC_DEBUG: enable the option libc.debug.malloc = 10

* commit '75039bafde8e6f03caffa9d6aa7142a09ba50952':
  MALLOC_DEBUG: enable the option libc.debug.malloc = 10

12 years agoam 89d3fdca: MALLOC_DEBUG: enable the option libc.debug.malloc = 10
Bruce Beare [Tue, 6 Dec 2011 01:01:13 +0000 (17:01 -0800)]
am 89d3fdca: MALLOC_DEBUG: enable the option libc.debug.malloc = 10

* commit '89d3fdcae26980bf81a4622c3c83e48ead4c1c3a':
  MALLOC_DEBUG: enable the option libc.debug.malloc = 10

12 years agoget rid of unused "main" function.
Nick Kralevich [Tue, 6 Dec 2011 00:09:30 +0000 (16:09 -0800)]
get rid of unused "main" function.

confuses gdb.

Change-Id: I1c64357ce122fe5a2564ee96bb4caa32b733f6ea

12 years agoMALLOC_DEBUG: enable the option libc.debug.malloc = 10
Bruce Beare [Wed, 21 Sep 2011 10:44:05 +0000 (12:44 +0200)]
MALLOC_DEBUG: enable the option libc.debug.malloc = 10

Fix the compile warning to let the libc.debug.malloc=10 works well
Due to unsuitable value comparison, which cause compiler optimize the
code of comparing two digits.

Change-Id: I0bedd596c9ca2ba308fb008da20ecb328d8548f5
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Author: liu chuansheng <chuansheng.liu@intel.com>

12 years agoam 0c3d21e6: am e480fc83: bionic: fix pthread_{create, exit}/signal race condition
Jack Ren [Wed, 30 Nov 2011 18:50:59 +0000 (10:50 -0800)]
am 0c3d21e6: am e480fc83: bionic: fix pthread_{create, exit}/signal race condition

* commit '0c3d21e63c6e75ae73aaf2b8d64af0bd8caa6beb':
  bionic: fix pthread_{create, exit}/signal race condition

12 years agoam 621df526: am 31e72bc3: bionic: fix __get_tls( ) crash issue
Jack Ren [Wed, 30 Nov 2011 18:50:58 +0000 (10:50 -0800)]
am 621df526: am 31e72bc3: bionic: fix __get_tls( ) crash issue

* commit '621df52644cc19001688c0964ad425c5ed6c8990':
  bionic: fix __get_tls( ) crash issue

12 years agoam 1ad08626: am 897815a1: bionic: add machine type check
Zhenghua Wang [Wed, 30 Nov 2011 18:50:57 +0000 (10:50 -0800)]
am 1ad08626: am 897815a1: bionic: add machine type check

* commit '1ad08626a143dc684e92f56754c7176cc4914ce8':
  bionic: add machine type check

12 years agoam e480fc83: bionic: fix pthread_{create, exit}/signal race condition
Jack Ren [Wed, 30 Nov 2011 06:42:32 +0000 (22:42 -0800)]
am e480fc83: bionic: fix pthread_{create, exit}/signal race condition

* commit 'e480fc83b2887388d469eb3bf58c86c610f5b082':
  bionic: fix pthread_{create, exit}/signal race condition

12 years agoam 31e72bc3: bionic: fix __get_tls( ) crash issue
Jack Ren [Wed, 30 Nov 2011 06:42:31 +0000 (22:42 -0800)]
am 31e72bc3: bionic: fix __get_tls( ) crash issue

* commit '31e72bc3289acdd85b0b745fbf64c5949ca33432':
  bionic: fix __get_tls( ) crash issue

12 years agoam 897815a1: bionic: add machine type check
Zhenghua Wang [Wed, 30 Nov 2011 06:42:30 +0000 (22:42 -0800)]
am 897815a1: bionic: add machine type check

* commit '897815a1feff230be3ea42655a77dcbb9a8dcca9':
  bionic: add machine type check

12 years agobionic: fix pthread_{create, exit}/signal race condition
Jack Ren [Wed, 21 Sep 2011 10:44:11 +0000 (12:44 +0200)]
bionic: fix pthread_{create, exit}/signal race condition

(1) in pthread_create:
    If the one signal is received before esp is subtracted by 16 and
    __thread_entry( ) is called, the stack will be cleared by kernel
    when it tries to contruct the signal stack frame. That will cause
    that __thread_entry will get a wrong tls pointer from the stack
    which leads to the segment fault when trying to access tls content.

(2) in pthread_exit
    After pthread_exit called system call unmap(), its stack will be
    freed.  If one signal is received at that time, there is no stack
    available for it.

Fixed by subtracting the child's esp by 16 before the clone system
call and by blocking signal handling before pthread_exit is started.

Author: Jack Ren <jack.ren@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
12 years agobionic: fix __get_tls( ) crash issue
Jack Ren [Mon, 1 Aug 2011 10:44:55 +0000 (18:44 +0800)]
bionic: fix __get_tls( ) crash issue

When running the stress test of pthread create/destroy, a crash may
oocur in __get_tls(). That is caused by the race condition with __set_tls( ):

Author: Jack Ren <jack.ren@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
12 years agobionic: add machine type check
Zhenghua Wang [Tue, 18 Oct 2011 16:29:14 +0000 (00:29 +0800)]
bionic: add machine type check

android linker doesn't check machine type, it may load some
libraries which it doesn't support sometimes.

Author: Zhenghua Wang <zhenghua.wang@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
12 years agoMerge "Request both v4 and v6 dns when on secondary net"
Robert Greenwalt [Tue, 29 Nov 2011 23:48:48 +0000 (15:48 -0800)]
Merge "Request both v4 and v6 dns when on secondary net"

12 years agoupdate capabilities.h
Nick Kralevich [Mon, 28 Nov 2011 21:41:21 +0000 (13:41 -0800)]
update capabilities.h

Pull in an updated version of capabilities.h from the linux
kernel.

This file was generated using the following command:

cd bionic/libc/kernel/
./tools/clean_header.py -u ../../../external/kernel-headers/original/linux/capability.h

Change-Id: I43c8f014954f543858006f24e60a2e69955349da

12 years agolibc: Fix typo that broke NDK compatibility.
David 'Digit' Turner [Wed, 23 Nov 2011 13:38:36 +0000 (14:38 +0100)]
libc: Fix typo that broke NDK compatibility.

The function must be named __atomic_cmpxchg, not __android_cmpxchg.
This typo broke existing prebuilt binaries (they couldn't be loaded
at runtime anymore).

Change-Id: I25ca7d18329817f0056e616a0409113269ad7b1f

12 years agoRequest both v4 and v6 dns when on secondary net
Robert Greenwalt [Mon, 21 Nov 2011 23:14:19 +0000 (15:14 -0800)]
Request both v4 and v6 dns when on secondary net

We can't easily tell the protocol family of the secondary network,
so try both and trust that the carrier has configured dns servers
according to the protocols supported on its network.

bug:5468224
Change-Id: If4f017573d313a6ad8354574076de6d63d43b444

12 years agoMerge "libc: provide atomic operations will full barriers for NDK apps."
David 'Digit' Turner [Tue, 22 Nov 2011 10:10:06 +0000 (02:10 -0800)]
Merge "libc: provide atomic operations will full barriers for NDK apps."

12 years agoMerge "Add tgkill syscall."
Jeff Brown [Mon, 21 Nov 2011 21:13:26 +0000 (13:13 -0800)]
Merge "Add tgkill syscall."

12 years agoAdd tgkill syscall.
Jeff Brown [Fri, 18 Nov 2011 23:17:07 +0000 (15:17 -0800)]
Add tgkill syscall.

Use tgkill instead of tkill to implement pthread_kill.
This is safer in the event that the thread has already terminated
and its id has been reused by a different process.

Change-Id: Ied715e11d7eadeceead79f33db5e2b5722954ac9

12 years agoReconcile with ics-mr1-release
The Android Open Source Project [Fri, 18 Nov 2011 23:42:18 +0000 (15:42 -0800)]
Reconcile with ics-mr1-release

Change-Id: I5bf77ac8b8c77cf7a075c6f0ffa99fa696ce13d3

12 years agoASLR: enable pthread stack location randomization
Nick Kralevich [Thu, 17 Nov 2011 20:58:20 +0000 (12:58 -0800)]
ASLR: enable pthread stack location randomization

Allow the kernel to choose a memory location to put the
thread stack, rather than hard coding 0x10000000

Change-Id: Ib1f37cf0273d4977e8d274fbdab9431ec1b7cb4f

12 years agoMerge "Make the linker relocatable."
Nick Kralevich [Wed, 16 Nov 2011 18:43:56 +0000 (10:43 -0800)]
Merge "Make the linker relocatable."

12 years agolibc: provide atomic operations will full barriers for NDK apps.
David 'Digit' Turner [Wed, 16 Nov 2011 16:37:15 +0000 (17:37 +0100)]
libc: provide atomic operations will full barriers for NDK apps.

__atomic_cmpxchg and other related atomic operations did not
provide memory barriers, which can be a problem for non-platform
code that links against them when it runs on multi-core devices.

This patch does two things to fix this:

- It modifies the existing implementation of the functions
  that are exported by the C library to always provide
  full memory barriers. We need to keep them exported by
  the C library to prevent breaking existing application
  machine code.

- It also modifies <sys/atomics.h> to only export
  always-inlined versions of the functions, to ensure that
  any application code compiled against the new header will
  not rely on the platform version of the functions.

  This ensure that said machine code will run properly on
  all multi-core devices.

This is based on the GCC built-in sync primitives.

The end result should be only slightly slower than the
previous implementation.

Note that the platform code does not use these functions
at all. A previous patch completely removed their usage in
the pthread and libstdc++ code.

+ rename arch-arm/bionic/atomics_arm.S to futex_arm.S
+ rename arch-x86/bionic/atomics_x86.S to futex_x86.S
+ remove arch-x86/include/sys/atomics.h which already
  provided inlined functions to the x86 platform.

Change-Id: I752a594475090cf37fa926bb38209c2175dda539

12 years agoMerge "libc: speed-up flockfile()/funlockfile()"
David 'Digit' Turner [Wed, 16 Nov 2011 15:31:31 +0000 (07:31 -0800)]
Merge "libc: speed-up flockfile()/funlockfile()"

12 years agoMerge "bionic: Do not use <sys/atomics.h> for platform code."
David Turner [Wed, 16 Nov 2011 15:29:59 +0000 (07:29 -0800)]
Merge "bionic: Do not use <sys/atomics.h> for platform code."

12 years agobionic: Do not use <sys/atomics.h> for platform code.
David 'Digit' Turner [Tue, 15 Nov 2011 14:47:02 +0000 (15:47 +0100)]
bionic: Do not use <sys/atomics.h> for platform code.

We're going to modify the __atomic_xxx implementation to provide
full memory barriers, to avoid problems for NDK machine code that
link to these functions.

First step is to remove their usage from our platform code.
We now use inlined versions of the same functions for a slight
performance boost.

+ remove obsolete atomics_x86.c (was never compiled)

NOTE: This improvement was benchmarked on various devices.
      Comparing a pthread mutex lock + atomic increment + unlock
      we get:

  - ARMv7 emulator, running on a 2.4 GHz Xeon:
       before: 396 ns    after: 288 ns

  - x86 emulator in KVM mode on same machine:
       before: 27 ns     after: 27 ns

  - Google Nexus S, in ARMv7 mode (single-core):
       before: 82 ns     after: 76 ns

  - Motorola Xoom, in ARMv7 mode (multi-core):
       before: 121 ns    after: 120 ns

The code has also been rebuilt in ARMv5TE mode for correctness.

Change-Id: Ic1dc72b173d59b2e7af901dd70d6a72fb2f64b17

12 years agomerge in ics-mr1-release history after reset to ics-mr1
The Android Automerger [Wed, 16 Nov 2011 14:45:21 +0000 (06:45 -0800)]
merge in ics-mr1-release history after reset to ics-mr1

12 years agoam 0d9f87a3: Add auto-exposure/auto-white balance lock support to soc2030 image sensor.
Eino-Ville Talvala [Wed, 16 Nov 2011 02:25:18 +0000 (18:25 -0800)]
am 0d9f87a3: Add auto-exposure/auto-white balance lock support to soc2030 image sensor.

* commit '0d9f87a3b71057cf804b2d7aa8589e3bf94eab28':
  Add auto-exposure/auto-white balance lock support to soc2030 image sensor.

12 years agolinker: Fix the computation of si->base
David 'Digit' Turner [Tue, 15 Nov 2011 16:17:28 +0000 (17:17 +0100)]
linker: Fix the computation of si->base

The computation of si->base assumed that the first entry in the
program header table is a PT_PHDR. This results in the dynamic
linker crashing with a SIGSEGV/MAPERR when trying to load some
of the NDK unit test programs, which happen to have an EXIDX
header first, followed byu a PHDR one.

This patch fixes the computation by parsing the program header
table, looking explicitely for the PHDR entry. This fixes the
load of the NDK unit test programs, and doesn't affect system
libraries.

Change-Id: Id18ea6037dbe950b5abbbce816c2960321f0b81d

12 years agolibc: speed-up flockfile()/funlockfile()
David 'Digit' Turner [Mon, 29 Aug 2011 19:43:46 +0000 (21:43 +0200)]
libc: speed-up flockfile()/funlockfile()

For Honeycomb, we added proper file thread-safety for
all FILE* operations. However, we did implement that by
using an out-of-band hash table to map FILE* pointers
to phtread_mutex_t mutexes, because we couldn't change
the size of 'struct _sFILE' without breaking the ABI.

It turns out that our BSD-derived code already has
some support code to extend FILE* objects, so use it
instead. See libc/stdio/fileext.h

This patch gets rid of the hash table, and put the
mutex directly into the sFILE extension.

Change-Id: If1c3fe0a0a89da49c568e9a7560b7827737ff4d0

12 years agoMerge "generate PIC code."
Nick Kralevich [Mon, 14 Nov 2011 23:12:43 +0000 (15:12 -0800)]
Merge "generate PIC code."

12 years agolibc: fix the pthread_sigmask implementation
David 'Digit' Turner [Mon, 14 Nov 2011 11:57:47 +0000 (12:57 +0100)]
libc: fix the pthread_sigmask implementation

The old code didn't work because the kernel expects a 64-bit sigset_t
while the one provided by our ABI is only 32-bit. This is originally
due to the fact that the kernel headers themselves define sigset_t
as a 32-bit type when __KERNEL__ is not defined (apparently to cater
to libc5 or some similarly old C library).

We can't modify the size of sigset_t without breaking the NDK ABI,
so instead perform runtime translation during the call.

Change-Id: Ibfdc3cbceaff864af7a05ca193aa050047b4773f

12 years agoMake the linker relocatable.
Nick Kralevich [Fri, 11 Nov 2011 23:53:17 +0000 (15:53 -0800)]
Make the linker relocatable.

Previously, the linker always loaded itself into the same
location in memory, which inhibited the effectiveness of Android's
ASLR implementation. Modify the linker code so it can be relocatable
and link itself at runtime.

Change-Id: Ia80273d7a00ff648b4da545f4b69debee6343968

12 years agogenerate PIC code.
Nick Kralevich [Fri, 11 Nov 2011 23:47:24 +0000 (15:47 -0800)]
generate PIC code.

Change-Id: I6740c30e2782ae203aa7ddaeaf3b233e90de9c4d

12 years agolinker: set LOCAL_NO_CRT := true
Nick Kralevich [Fri, 4 Nov 2011 17:11:26 +0000 (10:11 -0700)]
linker: set LOCAL_NO_CRT := true

Use LOCAL_NO_CRT to prevent linking against crtbegin.o, rather than
messing with build rules. This also prevents linking against crtend.o,
which isn't needed for the linker.

Change-Id: I0c5b9999be7e8676560fe145c1c033ffce8db4d1

12 years agoRevert "Make the linker relocatable."
Nick Kralevich [Thu, 3 Nov 2011 16:25:06 +0000 (09:25 -0700)]
Revert "Make the linker relocatable."

This reverts commit 994e9a5ed1c4e9f23a8bed79caea684eaa270027.

Broke x86 build.

12 years agoMake the linker relocatable.
Nick Kralevich [Tue, 1 Nov 2011 17:51:22 +0000 (10:51 -0700)]
Make the linker relocatable.

Previously, the linker always loaded itself into the same
location in memory, which inhibited the effectiveness of Android's
ASLR implementation. Modify the linker code so it can be relocatable
and link itself at runtime.

Change-Id: I90d064743abdd29450ac0482ed28752b2196286c

12 years agoMerge "Update to tzdata2011n."
Elliott Hughes [Mon, 31 Oct 2011 21:43:50 +0000 (14:43 -0700)]
Merge "Update to tzdata2011n."

12 years agoUpdate to tzdata2011n.
Elliott Hughes [Mon, 31 Oct 2011 21:11:32 +0000 (14:11 -0700)]
Update to tzdata2011n.

There are three changes of note - most urgently, Cuba (America/Havana)
has extended summer time by two weeks, now to end on Nov 13, rather than
the (already past) Oct 30.   Second, the Pridnestrovian Moldavian Republic
(Europe/Tiraspol) decided not to split from the rest of Moldova after
all, and consequently that zone has been removed (again) and reinstated
in the "backward" file as a link to Europe/Chisinau.   And third, the
end date for Fiji's summer time this summer was moved forward from the
earlier planned Feb 26, to Jan 22.

Apart from that, Moldova (MD) returns to a single entry in zone.tab
(and the incorrect syntax that was in the 2011m version of that file
is so fixed - it would have been fixed in a different way had this
change not happened - that's the "missing" sccs version id).

Change-Id: I7a0fba88d1fc6face649648013aaf2b111c29d7f

12 years agoReconcile with ics-mr1-release
The Android Open Source Project [Mon, 31 Oct 2011 20:19:03 +0000 (13:19 -0700)]
Reconcile with ics-mr1-release

Change-Id: Ifc8b7e46968eb77bb47eb85274aa7ab35ed36925

12 years agoAdd auto-exposure/auto-white balance lock support to soc2030 image
Eino-Ville Talvala [Mon, 31 Oct 2011 17:52:50 +0000 (10:52 -0700)]
Add auto-exposure/auto-white balance lock support to soc2030 image
sensor.

Bug: 4980604
Change-Id: I1be07a23573b70eeddd9ecb2370605713aea3d03