Commit graph

719 commits

Author SHA1 Message Date
Todd Kjos
88b5892d74 resolve merge conflicts of ed60788968 to mnc-dr2-dev-plus-aosp.
Change-Id: I9b07dd8dcb8fc74b658466b8dd47546cefffab1d
2015-11-18 08:31:03 -08:00
Josh Gao
cab716f101 Revert "libcutils: don't build for Windows."
This reverts commit bb3f9ce0aa.
2015-11-17 14:28:33 -08:00
Josh Gao
bb3f9ce0aa libcutils: don't build for Windows.
Change-Id: Ice07f892a346bbba2ed6bfdcddf7222799e76f9d
2015-11-16 16:21:22 -08:00
Todd Kjos
ba8a47531c Actively mangage EAS schedtune nodes
Move foreground tasks to /sys/fs/cgroup/stune/boost/tasks (boosted
weight in EAS scheduler). Move background tasks to
/sys/fs/cgroup/stune/tasks (default weight). For services started
with init, set "foreground" services to boosted.

Change-Id: I0e489fad9510727c13e6754dabaf311c2391f395
2015-11-16 14:57:47 -08:00
Todd Kjos
ed60788968 Actively mangage EAS schedtune nodes
Move foreground tasks to /sys/fs/cgroup/stune/boost/tasks (boosted
weight in EAS scheduler). Move background tasks to
/sys/fs/cgroup/stune/tasks (default weight). For services started
with init, set "foreground" services to boosted.

Change-Id: I0e489fad9510727c13e6754dabaf311c2391f395
2015-11-16 08:53:04 -08:00
Gilad Arnold
1bc7888104 Fix permissions for /data/nativetest{,64}/tests.txt.
This is not an executable so we have to specifically set its permissions
accordingly.

Bug: 25668833
Change-Id: I502f69bad75b4da4fdc29eb3ebaa42a19ae04d27
2015-11-14 18:25:31 -08:00
Gilad Arnold
47af47f4c1 Sane ownership/permissions for directories in /data/nativetest{,64}.
This makes native test directories 750 root:shell. This matches the
value for files within those directories, and results in a more usable
access paradigm when (say) unprivileged test tools need to discover
these test binaries.

Bug: 25668833
Change-Id: I9bd2081b2c211b4383b5873238aaf64597756714
2015-11-12 14:34:57 -08:00
Daniel Erat
5510c13991 libcutils: Make /data/nativetest{,64}/* executable.
Make test files under /data/nativetest{,64} 0750 root:shell
to avoid needing to manually chmod them.

Bug: 25340994
Change-Id: I174cc226195907c0effa99063a8aa0082f85722b
2015-11-02 09:45:04 -07:00
Christopher Ferris
634df89db6 Make allocations use unique_ptr.
Change-Id: I4b84b8106faeaeb61847f8f9d13fd6444f474efd
2015-10-14 14:03:29 -07:00
Nick Kralevich
e2b2996d96 fs_config.c: remove setuid from procrank
procrank only exists on userdebug/eng builds. For those builds,
procrank can be executed by running "su 0 procrank" instead of
relying on the binary being setuid root. This reduces the number
of setuid binaries on Android and allows for the deletion of
SELinux policy to support this.

Bug: 18342188
Change-Id: I982283f2e0f6fbe5efaffc08501c1ec175f65373
2015-10-07 16:41:47 -07:00
Jorge Lucangeli Obes
fd7a9f79f2 am 66d32c74: Merge "Use CAP_MASK_LONG for file capabilities."
* commit '66d32c7488e12545218e83195738c95c183760ef':
  Use CAP_MASK_LONG for file capabilities.
2015-09-03 15:55:32 +00:00
Jorge Lucangeli Obes
66d32c7488 Merge "Use CAP_MASK_LONG for file capabilities." 2015-09-03 15:48:01 +00:00
Dan Willemsen
a4b8f9f1c2 am bfe32228: Merge "Remove USE_MINGW/CYGWIN; Whitelist windows modules"
* commit 'bfe322285fdbe86fdc01fdc4c711e22e894bdaee':
  Remove USE_MINGW/CYGWIN; Whitelist windows modules
2015-09-03 00:39:19 +00:00
Jorge Lucangeli Obes
e920c46e7d Use CAP_MASK_LONG for file capabilities.
Extract the |1ULL << $CAP_NAME| construct to a macro, to avoid
repeating it.

Change-Id: I9312c27130d7e6c5b6ab3b4cc5c70a6b98378b98
2015-09-02 17:18:44 -07:00
Dan Willemsen
87a419c8b1 Remove USE_MINGW/CYGWIN; Whitelist windows modules
CYGWIN is not supported, USE_MINGW and HOST_OS==windows are being
replaced with LOCAL_..._windows variables.

Bug: 23566667
Change-Id: I3e4a1e4097dc994cf5abdce6939e83a91758fd75
2015-09-02 17:10:35 -07:00
Nick Kralevich
eb45890579 am f4355868: Merge "android_memset.c: Use sanitized shifts"
* commit 'f4355868cbce0713331bbb04b063515d6de4c795':
  android_memset.c: Use sanitized shifts
2015-08-27 23:24:35 +00:00
Duane Sand
c348a88376 android_memset.c: Use sanitized shifts
Avoid checks and traps on msb=1 unsigned shifts.

Change-Id: I5203a4290296b5557c0420ce0debad3b60d48233
2015-08-27 14:32:17 -07:00
Nick Kralevich
b7699c6550 am e6d3cf39: Merge "android_memset.c: Use __attribute__((no_sanitize("integer")))"
* commit 'e6d3cf393749556d6bb6b8ea51bb1252cfb061f3':
  android_memset.c: Use __attribute__((no_sanitize("integer")))
2015-08-27 20:44:40 +00:00
Nick Kralevich
d9eda62875 android_memset.c: Use __attribute__((no_sanitize("integer")))
Turn off integer sanitization on android_memset. memset()ing is
expected to be a fast operation.

Avoid the use of the "while (size--) { }" construct, which harmlessly
underflows.

Change-Id: Ia61ff2323c759bf52df7e70b8be2fae0b0366dda
2015-08-27 13:14:36 -07:00
Nick Kralevich
212e4f1fe1 am d34f4198: Merge "strdup16to8.c: fix benign integer underflow."
* commit 'd34f419826e74640dfe88c50d171a0cd8580eeda':
  strdup16to8.c: fix benign integer underflow.
2015-08-27 18:01:44 +00:00
Nick Kralevich
2b98a9eec0 strdup16to8.c: fix benign integer underflow.
A size_t value is not allowed to go below zero.

Change-Id: Ic888c6605d911e0b5dbee1a2fe1daf41e616e106
2015-08-27 10:30:50 -07:00
Nick Kralevich
3192689b21 am 63141512: am 53f11b62: Merge "libcutils: enable LOCAL_SANITIZE := integer"
* commit '631415129c51a24cd5c9843694bd5283fe3b9345':
  libcutils: enable LOCAL_SANITIZE := integer
2015-08-26 18:51:02 +00:00
Nick Kralevich
78d632a01d am 38f4a139: am 532e6cde: Merge "libcutils: cleanups for -fsanitize=integer"
* commit '38f4a1391e499c2392cd8136061153cc35438eb3':
  libcutils: cleanups for -fsanitize=integer
2015-08-26 18:51:00 +00:00
Nick Kralevich
fc82dd9179 libcutils: enable LOCAL_SANITIZE := integer
Call abort() on undefined or sketchy integer behavior.
Protects against integer overflow attacks.

Tested on Nexus 5 and Nexus 9 with no obvious problems.

Change-Id: I6cb28b4a0f5feed69ea472dfac8804fb0bf99719
2015-08-26 11:32:31 -07:00
Nick Kralevich
7390478f19 libcutils: cleanups for -fsanitize=integer
Hash functions rely on overflow behavior, so whitelist them.

ATRACE_TAG_NOT_READY: use an unsigned constant when shifting bits.
Otherwise, the value overflows on shift. The users of this constant
assign it to a uint64_t variable.

Change-Id: I21c437ce2083525e906c3ead3259ec34a1ef4b66
2015-08-26 10:40:00 -07:00
Elliott Hughes
145afc2cc4 am fb1ecbc5: am e6e71608: Merge "Use __ANDROID__ instead of HAVE_ANDROID_OS."
* commit 'fb1ecbc55e7edeafb138eb2a60ca89ba9a7b1f0f':
  Use __ANDROID__ instead of HAVE_ANDROID_OS.
2015-07-30 16:50:15 +00:00
Elliott Hughes
e6e71608bd Merge "Use __ANDROID__ instead of HAVE_ANDROID_OS." 2015-07-30 16:34:47 +00:00
Elliott Hughes
9b828adfad Use __ANDROID__ instead of HAVE_ANDROID_OS.
Change-Id: I9967f3fd758c2a5b40be5b60ae72be7e2fb75136
2015-07-30 09:33:43 -07:00
Elliott Hughes
c6dbc85845 am 42dbc4b1: am 44443bea: Merge "Use _WIN32 rather than HAVE_WINSOCK."
* commit '42dbc4b1859fe4de16b19e9b74324b345c5fcb9d':
  Use _WIN32 rather than HAVE_WINSOCK.
2015-07-30 15:17:07 +00:00
Elliott Hughes
adbf442a51 Use _WIN32 rather than HAVE_WINSOCK.
Change-Id: I9855b6fe72e2f2f3a8360c0993a67cb988024ee4
2015-07-29 17:45:24 -07:00
Tao Bao
5c151c4a4b am beb13044: am 1cae8cc1: Merge "Set mode bits for /system/etc/recovery.img."
* commit 'beb1304469c916bedf625ab126d75b38a688c62f':
  Set mode bits for /system/etc/recovery.img.
2015-07-28 21:24:21 +00:00
Tao Bao
1cae8cc13a Merge "Set mode bits for /system/etc/recovery.img." 2015-07-28 20:47:00 +00:00
Tao Bao
c6e93fec84 Set mode bits for /system/etc/recovery.img.
/system/etc/recovery.img defaults to 0644. Change it to 0440.

Bug: 22641135
Change-Id: I45cdb0cc1b58f35fbcd0f16e7cc6c4eef63b0b74
(cherry picked from commit b602e6f9a3)
2015-07-27 19:17:15 -07:00
Elliott Hughes
8a8953bb3d Fix libcutils build.
Change-Id: I4df2065f60f5363877809161298c1f9718252934
2015-07-24 20:28:31 -07:00
Elliott Hughes
3dced0d2c6 am 12d912bc: am ed217967: Merge "Fix socket_network_client_timeout error check."
* commit '12d912bc4facd9490becd9d1306a54fd079a8800':
  Fix socket_network_client_timeout error check.
2015-07-25 03:06:47 +00:00
Elliott Hughes
8b262b9de4 resolved conflicts for merge of 038b76c2 to mnc-dev-plus-aosp
Change-Id: Id84946b67f207a7586cfa9c918ee6e4ae335fe86
2015-07-24 20:02:31 -07:00
Elliott Hughes
ed21796754 Merge "Fix socket_network_client_timeout error check." 2015-07-25 01:58:57 +00:00
Elliott Hughes
eabe8af7e3 Fix socket_network_client_timeout error check.
Change-Id: Ia30ffc1a7815c63d247d9ba298c2fe9d7a780af2
2015-07-24 18:54:02 -07:00
Elliott Hughes
8fea1ede67 Turn on warnings for libcutils, fix a bug.
This doesn't actually spot the bug I'm about to fix, but maybe one day...

Change-Id: Ib8a2016ecd8a426f38960a05d439646255ea6cd8
2015-07-24 18:48:31 -07:00
Elliott Hughes
5937a860f3 am 1f76c1ab: am 9727a6a0: Merge "Report getaddrinfo failures correctly."
* commit '1f76c1abea3196a61f85164a078d44505d3a6b5e':
  Report getaddrinfo failures correctly.
2015-07-24 21:02:36 +00:00
Elliott Hughes
381cfa9a8b Report getaddrinfo failures correctly.
Also move us off the "convenience" function because you can't get useful
error reporting from it.

Change-Id: I5fcc6a6d762f5f60906980a7835f01a35045be65
2015-07-23 21:14:38 -07:00
Yusuke Sato
7c842b57fe am ab64465d: am 0e3ce82b: Merge "Use fsck.f2fs -a instead of -f for faster boot"
* commit 'ab64465d1f16f414c0bde5e3c4707c32b8220bbc':
  Use fsck.f2fs -a instead of -f for faster boot
2015-07-21 18:25:57 +00:00
Yusuke Sato
0e3ce82b94 Merge "Use fsck.f2fs -a instead of -f for faster boot" 2015-07-21 16:06:40 +00:00
Elliott Hughes
32cfa95271 am 099ec31b: am ff201659: Merge "Fix the Mac libcutils build."
* commit '099ec31bdb910020c5c86b4ad8711940616bcbaf':
  Fix the Mac libcutils build.
2015-07-18 18:21:13 +00:00
Elliott Hughes
0f8f70beb4 Fix the Mac libcutils build.
The stupid Mac doesn't have SOCK_NONBLOCK.

Bug: http://b/22559299
Change-Id: I476dadd0ba0076f5e61a4cd9b1f39cf3508f4188
2015-07-18 10:47:59 -07:00
Elliott Hughes
cb599d34b9 am 5403d155: am e36b10a8: Merge "Switch libcutils from gethostbyname to getaddrinfo."
* commit '5403d155a3677ff334246eb5524ced4166fd1c96':
  Switch libcutils from gethostbyname to getaddrinfo.
2015-07-18 17:20:13 +00:00
Elliott Hughes
94ae41874a Switch libcutils from gethostbyname to getaddrinfo.
Needed for IPv6 support.

Bug: http://b/22559299
Change-Id: Id10d958b434b207e84bc2ec2ff83221f2c4e8168
2015-07-17 23:45:15 -07:00
Yusuke Sato
0df08271fb Use fsck.f2fs -a instead of -f for faster boot
and run fsck with -f on clean shutdown instead.

With -f, fsck.f2fs always performs a full scan of the /data
partition regardless of whether the partition is clean or not.
The full scan takes more than 2 seconds on volantis-userdebug
and delays the OS boot.

With -a, the command does almost nothing when the partition
is clean and finishes within 20-30ms on volantis-userdebug.
When the partition has an error or its check point has
CP_FSCK_FLAG (aka "need_fsck"), the command does exactly the
same full scan as -f to fix it.

Bug: 21853106
Change-Id: I126263caf34c0f5bb8f5e6794454d4e72526ce38
2015-07-15 10:13:51 -07:00
Daniel Rosenberg
6b6687bec9 am 00392411: am e7ed68ad: Merge "libcutils: fs_config: Add folders normally created in init.rc"
* commit '0039241124ae3ef9b19c805b0341120e11f9561e':
  libcutils: fs_config: Add folders normally created in init.rc
2015-07-14 22:28:11 +00:00
Thierry Strudel
a0fbb90885 am 8703bea1: Merge "fs_config: replace getenv(\'OUT\') by new fs_config parameter" into mnc-dev
* commit '8703bea1807326fef9835bc474e7a7288c725925':
  fs_config: replace getenv('OUT') by new fs_config parameter
  fs_mgr: Use ro.boot.veritymode
2015-07-10 18:44:51 +00:00
Thierry Strudel
df33ffadd2 fs_config: replace getenv('OUT') by new fs_config parameter
Using a getenv('OUT') in such a deep down function is a wrong design
choice. Replacing with explicit parameter that may be NULL in case
device specific files can be accessed from /.
Since TARGET_COPY_OUT_SYSTEM may be defined to something different than
system we also ensure that we use a path relative to TARGET_OUT to
compute path to fs_config_* files.

Bug: 21989305
Bug: 22048934
Change-Id: Id91bc183b29beac7379d1117ad83bd3346e6897b
Signed-off-by: Thierry Strudel <tstrudel@google.com>
2015-07-09 21:47:07 -07:00
Daniel Rosenberg
bbe796d231 libcutils: fs_config: Add folders normally created in init.rc
When the ramdisk is built into the system image, we need to create
those folders during the build.

Change-Id: I40881940c75e379d7599dc1f743b35fbc7cc66e8
2015-07-08 16:37:13 -07:00
Todd Kjos
7c3e2696c5 am 1fb6e24f: Merge "Fix janky navbar ripples -- incorrect timerslack values" into mnc-dev
* commit '1fb6e24f19533c2d7bfa1e8e69443d752e9df3ce':
  Fix janky navbar ripples -- incorrect timerslack values
2015-06-29 22:55:34 +00:00
Todd Kjos
1fb6e24f19 Merge "Fix janky navbar ripples -- incorrect timerslack values" into mnc-dev 2015-06-29 22:29:54 +00:00
Todd Kjos
4cdce427f9 Fix janky navbar ripples -- incorrect timerslack values
If a thread is created while the parent thread is "Background",
then the default timerslack value gets set to the current
timerslack value of the parent (40ms). The default value is
used when transitioning to "Foreground" -- so the effect is that
the timerslack value becomes 40ms regardless of foreground/background.

This does occur intermittently for systemui when creating its
render thread (pretty often on hammerhead and has been seen on
shamu). If this occurs, then some systemui animations like navbar
ripples can wait for up to 40ms to draw a frame when they intended
to wait 3ms -- jank.

This fix is to explicitly set the foreground timerslack to 50us.

A consequence of setting timerslack behind the process' back is
that any custom values for timerslack get lost whenever the thread
has transition between fg/bg.

See Bug: 19398120

Change-Id: Idc259717f62fa2255f8bafbbf88b68c0043f29cf
2015-06-25 14:29:07 -07:00
Tim Murray
f7180d1d2d am 98c6de69: Merge "Don\'t set cgroup policy when updating cpusets." into mnc-dev
* commit '98c6de6926e65615caff5be72236a24339258dee':
  Don't set cgroup policy when updating cpusets.
2015-06-22 22:09:19 +00:00
Tim Murray
999102664c Don't set cgroup policy when updating cpusets.
bug 21782794

Change-Id: I3b2cf8ae4f3ed0c14f206584ae7fa2b1a1d11ad0
2015-06-22 14:00:56 -07:00
Tim Murray
63e383136b am e5b0c837: Merge "add cpuset support to libcutils" into mnc-dev
* commit 'e5b0c837856007812ace8ec5849f6852015d5d2b':
  add cpuset support to libcutils
2015-06-12 19:03:30 +00:00
Tim Murray
b769c8d24f add cpuset support to libcutils
bug 21782794

Change-Id: I249531754fb29442dc3c7434d77dbb103f4220a7
2015-06-11 18:35:46 -07:00
Elliott Hughes
af02e2403a am 9fc83437: Don\'t use TEMP_FAILURE_RETRY on close in system/core.
* commit '9fc834377297cb2dcc418e4ce7e38e89dd09812b':
  Don't use TEMP_FAILURE_RETRY on close in system/core.
2015-05-27 20:51:25 +00:00
Elliott Hughes
9fc8343772 Don't use TEMP_FAILURE_RETRY on close in system/core.
Bug: http://b/20501816
Change-Id: I1839b48ee4f891b8431ecb809e37a4566a5b3e50
(cherry picked from commit 47b0134ec2)
2015-05-27 13:27:06 -07:00
Elliott Hughes
3464c77b8d Merge "Don't use TEMP_FAILURE_RETRY on close in system/core." 2015-05-27 20:24:08 +00:00
Nick Kralevich
27fe3cb63f am 7eb3abdb: klog: don\'t unconditionally call mknod()
* commit '7eb3abdb3ba500d3acca82b95705f34128251015':
  klog: don't unconditionally call mknod()
2015-05-19 23:03:19 +00:00
Nick Kralevich
7eb3abdb3b klog: don't unconditionally call mknod()
If /dev/kmsg already exists, it's unnecessary for klog_init()
to create it's own copy. This avoids needing to grant the mknod
permission to everyone who uses kmsg. Typically the only time
/dev/kmsg doesn't exist is before ueventd starts.

(cherrypicked from commit 4d32a486fe)

Bug: 21242418
Change-Id: I0c88d80feca6899fcdbc8c9f2f99448ee0a3422d
2015-05-19 15:19:25 -07:00
Nick Kralevich
4d32a486fe klog: don't unconditionally call mknod()
If /dev/kmsg already exists, it's unnecessary for klog_init()
to create it's own copy. This avoids needing to grant the mknod
permission to everyone who uses kmsg. Typically the only time
/dev/kmsg doesn't exist is before ueventd starts.

Bug: 21242418
Change-Id: I0c88d80feca6899fcdbc8c9f2f99448ee0a3422d
2015-05-18 18:43:28 -07:00
Adam Lesinski
b278ab2f0f am 0ebd13f0: Merge "Prevent integer overflow when allocating native_handle_t" into mnc-dev
* commit '0ebd13f0639ddfc3e6e96bbcc6ce5465ca489808':
  Prevent integer overflow when allocating native_handle_t
2015-05-19 00:55:12 +00:00
Elliott Hughes
47b0134ec2 Don't use TEMP_FAILURE_RETRY on close in system/core.
Bug: http://b/20501816
Change-Id: I1839b48ee4f891b8431ecb809e37a4566a5b3e50
2015-05-15 19:16:40 -07:00
Adam Lesinski
07edc3b3b3 Prevent integer overflow when allocating native_handle_t
User specified values of numInts and numFds can overflow
and cause malloc to allocate less than we expect, causing
heap corruption in subsequent operations on the allocation.

Bug: 19334482
Change-Id: I43c75f536ea4c08f14ca12ca6288660fd2d1ec55
2015-05-15 13:09:39 -07:00
Dan Albert
428fad97a0 Remove libbacktrace definition of gettid.
Also simplifies the Darwin implementation of gettid, because
apparently libbacktrace had a better way of doing it.

Bug: 19517541

(cherry picked from commit 23f750b068)

Change-Id: I2f888e8ed7a2f5719973786cbcbb399a81867ee9
2015-05-13 13:44:34 -07:00
Dan Albert
cd206b3900 Fix gettid() on Windows.
Accidentally had this all hidden by an #ifndef _WIN32 when I wrote it.

Bug: 19517541

(cherry picked from commit b3a36ca5ee)

Change-Id: Ifbd5d19e506e7313700e2e29a2dae5736e049844
2015-05-13 13:43:32 -07:00
Elliott Hughes
36284db817 Switch arch-arm/memset32.S to unified syntax.
This fixes the clang build.

Change-Id: I492c7dc016986020de3f70a77e0ace6610f50765
2015-05-11 22:22:13 -07:00
Dan Albert
23f750b068 Remove libbacktrace definition of gettid.
Also simplifies the Darwin implementation of gettid, because
apparently libbacktrace had a better way of doing it.

Change-Id: I9e14f9176b167405a5aaa5b8a0db0327c7126271
2015-04-30 12:52:21 -07:00
Dan Albert
b3a36ca5ee Fix gettid() on Windows.
Accidentally had this all hidden by an #ifndef _WIN32 when I wrote it.

Change-Id: I3a6afefe23b799ea7aa0f9a380f5a743673096d0
2015-04-29 17:13:32 -07:00
Elliott Hughes
d5ff3e9449 Remove dead code.
We weren't even building this.

Change-Id: I8b2afbc76d784a7b24bbe0be6502b9fbcf0b5c09
2015-04-21 12:24:50 -07:00
Elliott Hughes
2cba9405f9 Merge "[MIPS] Fast android_memset for Mips64, Mipsr6" 2015-04-17 02:07:32 +00:00
Duane Sand
1ef9ccd772 [MIPS] Fast android_memset for Mips64, Mipsr6
Fix broken mips64 build by replacing mips32r2-only android_memset.S.
Use HW-bonded pairs of 64-bit stores to fill 128 bits/cycle.
Rely on HW automatic cache prefetch optimizations.
Software cache prefetching is counterproductive on next mips cores.
New method is coded in C, and also works okay on non-Mips architectures.

Change-Id: Id7153a8fe11538fe25287e101375661b0e99e2a2
2015-04-16 18:26:22 -07:00
Greg Hackmann
0e2d6015bc Merge "Revert "cutils: add OS-independent endian.h"" 2015-04-16 21:29:44 +00:00
Greg Hackmann
bf7f28a415 Revert "cutils: add OS-independent endian.h"
This reverts commit c3bac8b671.
2015-04-16 14:28:58 -07:00
Greg Hackmann
88e03449de Merge "cutils: add OS-independent endian.h" 2015-04-16 20:06:40 +00:00
Yabin Cui
51e32b52a3 Merge "Move trace.h to stdatomic." 2015-04-16 18:35:43 +00:00
Greg Hackmann
c3bac8b671 cutils: add OS-independent endian.h
cutils/endian.h provides the helpers defined in endian(3), either by
pulling in the OS's built-in endian.h (where available) or recreating
them using GCC builtins.

Change-Id: Ic8965f67e1efdc03f884dbe6b7fe0276f840e4fc
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2015-04-16 11:12:02 -07:00
Yabin Cui
a8ac32c781 Move trace.h to stdatomic.
Bug: 20262261
Change-Id: Idaf984786804eb76c285f38b11abbbc0d3706509
2015-04-16 10:41:16 -07:00
Mark Salyzyn
4232b378e7 libcutils: fs_config must use O_BINARY
Bug: 19908228
Change-Id: I3273cf99b320941f9530a015c9e582af72469acb
2015-04-16 08:44:33 -07:00
Mark Salyzyn
fd5b425b6e libcutils: fs_config: winsdk_tools build fix
Bug: 19908228
Change-Id: Ia725d20ca4f8a87deec63b6c661f6a09c8671231
2015-04-16 08:32:25 -07:00
Mark Salyzyn
7977cc63b1 libcutils: drop use of mmap
- Causes a build break for MAC and Windows

Bug: 19908228
Change-Id: I9d69967aa988c9ca202805593fa846cb670101cf
2015-04-15 19:28:36 -07:00
Mark Salyzyn
5d9e5efbcd libcutils: add fs_config_generate
Bug: 19908228
Change-Id: Icb0e189a86758bb779b9bdf7c0d92216d297869f
2015-04-15 16:43:07 -07:00
Mark Salyzyn
68651148dd libcutils: fs_config read from file
Intention is to read from ${OUT}/system/etc/fs_config_dirs and
${OUT}/system/etc/fs_config_files on host. And
/system/etc/fs_config_dirs and /system/etc/config_files
on target systems.

Bug: 19908228
Change-Id: Ieaedd99e88c7f7f717878d9344c387ddf335ccbb
2015-04-15 16:43:01 -07:00
Mark Salyzyn
7e82633106 Revert "libcutils: fs_config read from file"
There is no endian.h on windows

This reverts commit 4e5f71ae72.

Change-Id: I6aedf35ed319c7f8febc7ab98e104a625fb27f69
2015-04-15 22:30:30 +00:00
Mark Salyzyn
4e5f71ae72 libcutils: fs_config read from file
Intention is to read from ${OUT}/system/etc/fs_config_dirs and
${OUT}/system/etc/fs_config_files on host. And
/system/etc/fs_config_dirs and /system/etc/config_files
on target systems.

Bug: 19908228
Change-Id: I0966a94f79a3fae4f7325056c701ea355370f9df
2015-04-15 11:22:52 -07:00
Mark Salyzyn
a21c29ee81 android_filesystem_config: move fs_config to libcutils
Bug: 19908228
Change-Id: Id51c0c50eb2677824d052882f4263193a08e1402
2015-04-06 10:04:16 -07:00
Mark Salyzyn
8b2c7dee59 libcutils: add fs_config
Bug: 19908228
Change-Id: I78e6a8d780e578a287ffdee7b7120ecc74797e80
2015-04-06 10:04:15 -07:00
Elliott Hughes
8193d41ea6 Fix Windows strlcpy.c build.
Change-Id: I572c553227a5a2cd57ec304de7e898d7c801fe93
2015-04-02 17:21:47 -07:00
Elliott Hughes
2040031f7b Be more intention-revealing with libcutils' strlcpy.
Several people have been independently confused about when this gets
built and why over the past couple of days.

Change-Id: I2d4a02f66e24c0734327585b7d27e50a344b1e94
2015-04-02 15:39:33 -07:00
Elliott Hughes
af98efbd15 Move all libcutils tests into the gtests.
This also fixes the bug where we were always testing against the fake
strlcpy we provide for glibc/Windows rather than the Android one.

This also removes some unnecessary library dependencies.

This also builds all the cutils tests for the host (static and dynamic).

Change-Id: Icd129d5b025c0ca801be5acf31a54ecd88608df9
2015-04-02 14:25:55 -07:00
Elliott Hughes
a492f3797a Move mips/mips64 android_memset16/android_memset32 into libcutils.
Change-Id: Ia826dd872f64cc80635f50525a0c393f43ae5204
2015-04-02 11:59:22 -07:00
Brian Carlstrom
60a347fc87 Fix shared version of libcutils on the host to include strlcpy
Change-Id: Ic727508d9cfadea0050d1ccc491ee61aac1ef55a
2015-04-02 00:43:45 -07:00
Dan Albert
43db1c347b Revert "Disable the static libcutils tests."
Also move them to libc++ since stlport is dead.

Bug: 18389856

This reverts commit bb28776db0.

Change-Id: Icdf9be3bc5cc40433727ff71a121b145002dda72
2015-04-01 16:45:28 -07:00
Richard Uhler
0c266ef2d7 Merge "Define atrace_* functions for both target and host." 2015-04-01 17:29:34 +00:00
Elliott Hughes
c02f81cccb Always unlink /dev/__kmsg__.
Whether the open succeeds or fails, we should unlink.

Change-Id: Ic2f1e10dc7b6d6e459c56049da00d165bd63ba8f
2015-03-28 09:51:54 -07:00
Elliott Hughes
da40c00137 Log more timing information from init.
Also make important events in init's life NOTICE rather than INFO,
and ensure that NOTICE events actually make it to the kernel log.

Also fix the logging so that if you have a printf format string
error, the compiler now catches it.

Also give messages from init, ueventd, and watchdogd distinct tags.
(Previously they'd all call themselves "init", and dmesg doesn't
include pids, so you couldn't untangle them.)

Also include the tag in SELinux messages.

Bug: 19544788
Change-Id: Ica6daea065bfdb80155c52c0b06f346a7df208fe
2015-03-28 00:25:22 -07:00
Richard Uhler
7d451ab96d Define atrace_* functions for both target and host.
This change defines atrace_* functions for the host that act as
no-ops, which makes it easier to add tracing in ART.

Change-Id: I89397e83986686a2b6a6f245c25017eb379081b1
2015-03-27 14:58:30 -07:00
Richard Uhler
a0115bf78d Merge "Add make target for shared libcutils on host." 2015-03-25 15:48:42 +00:00
Richard Uhler
acb31ba905 Add make target for shared libcutils on host.
Needed by host dex2oat.

Change-Id: Ia5b53136de3d531c820f03c3f251e58418204be1
2015-03-24 14:46:01 -07:00
Christopher Ferris
fc3576f675 Fix mac sdk build.
Add include files for types and functions that were not included properly.

Change-Id: I4849f5bdf535c6eec9254228cf980c30d11a5a1b
2015-03-23 21:40:30 -07:00
Dan Albert
483060208c More Mac fix.
Change-Id: I7a1f726819c68eea1afb7e45f92954325f8933e1
2015-03-23 16:38:46 -07:00
Dan Albert
e308104390 Undo mac fix to fix windows, fix mac differently.
Change-Id: I7d1ee439d25e17c31c0be448e67a90a0f626ff42
2015-03-23 16:07:42 -07:00
Dan Albert
728b13f08d (Probably) fix the mac build.
Change-Id: I4209f2d66d8701df2f32dcfb79abea9ea6d3dc69
2015-03-23 14:48:05 -07:00
Dan Albert
7dfb61dcdc Move gettid() into libcutils.
Change-Id: Ic8a15036833e6d129b7998d954b804be391de399
2015-03-23 13:01:21 -07:00
Nick Kralevich
5e14f416af am 6864e673: Merge "More SOCK_CLOEXEC"
* commit '6864e6739027adf725ced33777d3e21f80a95479':
  More SOCK_CLOEXEC
2015-02-27 23:19:11 +00:00
Nick Kralevich
6d3cddb2e2 More SOCK_CLOEXEC
Change-Id: I3e18f34d08a6443aaf55d7c91c27867840ac1773
2015-02-26 13:32:52 -08:00
Narayan Kamath
d9ee5ff49f am f1ac6917: Merge "Remove loghack.h."
* commit 'f1ac6917da172dd3e6829bac41fcbf23e96da079':
  Remove loghack.h.
2015-02-21 10:15:55 +00:00
Narayan Kamath
453a332812 Remove loghack.h.
This was supposedly used to enable logging when !HAVE_ANDROID_OS
but it's only used in a file that's target specific.

Change-Id: Id83f2597e48a66b4821fc3b1237e212872b909fb
2015-02-21 09:46:31 +00:00
Andreas Gampe
dc941b5f37 am 623eebe6: Merge "Libcutils: Remove unused variable"
* commit '623eebe68f3c6c9e54cf5b186696052d2948410c':
  Libcutils: Remove unused variable
2015-02-20 01:02:45 +00:00
Andreas Gampe
7f71a45a17 Libcutils: Remove unused variable
Change-Id: I95eed017e78468c4946b2a5b62b6fe92e256673e
2015-02-19 16:54:32 -08:00
Elliott Hughes
7faec394d1 am 3bc8ae63: Merge "Use mkstemp for host ashmem."
* commit '3bc8ae63ce3bbcc0ab61def99a4e9b4822ba3f51':
  Use mkstemp for host ashmem.
2015-02-10 16:52:44 +00:00
Elliott Hughes
2004a863dc Use mkstemp for host ashmem.
Bug: 19310167
Change-Id: Ic4e32b3924a9aa0b0d095d445108cbcf2231cd91
2015-02-09 12:49:53 -08:00
Elliott Hughes
8a2634c2ab am 55732f49: Merge "android_reboot should take a const char*."
* commit '55732f49287a75f9baabe9f150443aec9234c90d':
  android_reboot should take a const char*.
2015-02-04 01:20:40 +00:00
Elliott Hughes
0068da6a93 android_reboot should take a const char*.
The kernel argument is actually a void*, but it's only read from.

Change-Id: I305c50249bf12b7fbdea4721257aed52a0372f8d
2015-02-03 15:44:16 -08:00
Yabin Cui
631965a32e am e862350b: Merge "Kill HAVE_PTHREADS."
* commit 'e862350bb2eb3d3eda526da7f3b6d5c2dd40a445':
  Kill HAVE_PTHREADS.
2015-01-27 22:45:14 +00:00
Yabin Cui
4a6e5a3b64 Kill HAVE_PTHREADS.
Bug: 19083585
Change-Id: Ic09eb3dd250bc5c5b63cac7998f99f5fa007f407
2015-01-27 14:23:22 -08:00
Christopher Ferris
bd3bbff674 am d426a4e7: Merge "Move 32 bit/64 bit check into debuggerd."
* commit 'd426a4e7b62c18124827868ddbf8987aa433451b':
  Move 32 bit/64 bit check into debuggerd.
2015-01-22 00:13:01 +00:00
Christopher Ferris
9774df6134 Move 32 bit/64 bit check into debuggerd.
On 64 bit systems, calls to dump_backtrace_to_file or dump_tombstone
try and directly contact the correct debuggerd (32 bit vs 64 bit)
by reading the elf information for the executable.
Unfortunately, system_server makes a call to dump_backtrace_to_file
and it doesn't have permissions to read the executable data, so it
defaults to always contacting the 64 bit debuggerd.
This CL changes the code so that all dump requests go to the 64 bit
debuggerd, which reads the elf information and redirects requests for
32 bit processes to the 32 bit debuggerd.

Testing:

- Forced the watchdog code in system_server to dump stacks and
  verified that all native stacks are dumped correctly.
- Verified that dumpstate and bugreport still properly dump the native
  processes on a 64 bit and 32 bit system.
- Intentionally forced the 64 bit to 32 bit redirect to write only a
  byte at a time and verified there are no errors, and no dropped data.
- Used debuggerd and debuggerd64 to dump 32 bit and 64 bit processes
  seemlessly.
- Used debuggerd on a 32 bit system to dump native stacks.

Bug: https://code.google.com/p/android/issues/detail?id=97024
Change-Id: Ie01945153bdc1c4ded696c7334b61d58575314d1
2015-01-20 17:22:07 -08:00
Elliott Hughes
bb604524fb am 45c4c06f: Merge "Remove unused cruft from libcutils."
* commit '45c4c06ffe6f38e0f77f37f488e07f2537eddd45':
  Remove unused cruft from libcutils.
2015-01-16 16:02:24 +00:00
Jeff Sharkey
7c42c7f84f am 9f72ef89: Merge "Extend to receive NFLOG packets."
* commit '9f72ef8944a93bd333c6c7f87c7f7d79207ae663':
  Extend to receive NFLOG packets.
2015-01-16 06:07:29 +00:00
Elliott Hughes
f21717cd87 Remove unused cruft from libcutils.
Change-Id: I316d39e8e0a9aa385d8e1f37678b8bf2c03441eb
2015-01-15 21:16:03 -08:00
Jeff Sharkey
9f72ef8944 Merge "Extend to receive NFLOG packets." 2015-01-16 01:11:02 +00:00
Christopher Ferris
fa41e0f5c8 Add timed versions of stack dumping functions.
Under some unknown circumstances, debuggerd could become unresponsive.
If you try and take a bugreport during this time, it will hang forever.
Adding functions that have a timeout will allow dumpstate to stop if
dumping is taking too long.

Bug: 18766581

(cherry picked from commit 5f2ff6a910)

Change-Id: I39e8e9c60209e3ef9efac795fedb8e1edce2bd3e
2015-01-15 15:34:21 -08:00
Jeff Sharkey
9a20e67fa6 Extend to receive NFLOG packets.
Packets captured and logged by the NFLOG target are unicast, so
extend to catch and decode them.  To avoid escaping issues, the raw
contents are passed around as hex strings.

Bug: 18335678
Change-Id: Ib7299500baa00080a1f000f9da843eb527363353
2015-01-15 12:50:59 -08:00
Christopher Ferris
844c7ccc0a am 5f2ff6a9: Add timed versions of stack dumping functions.
* commit '5f2ff6a9106083e2a79b8600a0bf6a5341c6ca38':
  Add timed versions of stack dumping functions.
2015-01-15 01:48:27 +00:00
Christopher Ferris
5f2ff6a910 Add timed versions of stack dumping functions.
Under some unknown circumstances, debuggerd could become unresponsive.
If you try and take a bugreport during this time, it will hang forever.
Adding functions that have a timeout will allow dumpstate to stop if
dumping is taking too long.

Bug: 18766581
Change-Id: I85053b8dcfe6224e2b64b4d8f7f2ef448b3cda34
2015-01-14 15:24:33 -08:00
Elliott Hughes
4d9ddb14c0 am ec556521: Merge "Remove HAVE_LIBC_SYSTEM_PROPERTIES and HAVE_SYSTEM_PROPERTY_SERVER."
* commit 'ec556521e23f66ea52e41a7d9540b2dec31766c5':
  Remove HAVE_LIBC_SYSTEM_PROPERTIES and HAVE_SYSTEM_PROPERTY_SERVER.
2015-01-12 22:28:11 +00:00
Elliott Hughes
ae52165490 Remove HAVE_LIBC_SYSTEM_PROPERTIES and HAVE_SYSTEM_PROPERTY_SERVER.
Change-Id: I3d92dbecebd2bb449a8c4332de684919a58847ad
2015-01-12 13:56:34 -08:00
Yabin Cui
28175b0221 am fdb3da59: Merge "Use getmntent when accessing /proc/mounts."
* commit 'fdb3da5953b70dc87a05d28c31cb0dc06b8181aa':
  Use getmntent when accessing /proc/mounts.
2015-01-06 18:17:41 +00:00
Yabin Cui
d6bd9bf459 Use getmntent when accessing /proc/mounts.
Bug: 18887435
Change-Id: I6d7f95bbdb976428d4722bd640745e73c9839160
2015-01-05 20:28:36 -08:00
Elliott Hughes
f8328e7744 am 0e74cfb6: Merge "Fix references to HAVE_PRCTL."
* commit '0e74cfb677319c0f006dcc81f74fb21956807d2a':
  Fix references to HAVE_PRCTL.
2014-12-15 23:19:51 +00:00
Elliott Hughes
292ccd3c18 Fix references to HAVE_PRCTL.
Change-Id: I8343b398f2ce0d743487fdd086e67763c7dd67f1
2014-12-15 12:52:53 -08:00
Elliott Hughes
27484f2e74 am fae953eb: Merge "HAVE_ANDROID_OS implies that you have <pthread.h> and <sched.h>."
* commit 'fae953ebccfabfa500b3ebca93202063c8e3501d':
  HAVE_ANDROID_OS implies that you have <pthread.h> and <sched.h>.
2014-12-15 02:00:31 +00:00
Elliott Hughes
6acf3d7703 HAVE_ANDROID_OS implies that you have <pthread.h> and <sched.h>.
Change-Id: Ica7940c00d1d5da9d50711fd138dd459deec9b6d
2014-12-14 16:51:36 -08:00
Andreas Gampe
422ced07e5 am 374de72b: Merge "Libcutils: Remove unused variable"
* commit '374de72bbc218198e6a5f09ae4da853d02199b5c':
  Libcutils: Remove unused variable
2014-11-25 18:51:52 +00:00
Andreas Gampe
50c15f980d Libcutils: Remove unused variable
For build-system CFLAGS clean-up, remove unused variable.

Change-Id: Iaf6dd7b84ee4ef4734a48b37a4d0ca8287ca5fb5
2014-11-24 10:04:56 -08:00
Elliott Hughes
88cc0aded6 am eda16b98: Merge "Kill LOCAL_SOCKET_NAMESPACE."
* commit 'eda16b98dce3ef4c75b7b46c6acdab2b6970f54a':
  Kill LOCAL_SOCKET_NAMESPACE.
2014-11-22 07:56:37 +00:00
Elliott Hughes
9768d24fa0 Kill LOCAL_SOCKET_NAMESPACE.
Change-Id: I18928f89f66c37be310c45ff4c05a6d47ab84f66
2014-11-21 22:50:20 -08:00
Elliott Hughes
ba96de5f65 am 3ef0460e: Merge "Remove the error-prone TARGET_CPU_SMP from system/core."
* commit '3ef0460e86f2a7c5442bcf424b8e83fdfb8e3669':
  Remove the error-prone TARGET_CPU_SMP from system/core.
2014-11-17 19:40:16 +00:00
Elliott Hughes
e9ca709a73 Remove the error-prone TARGET_CPU_SMP from system/core.
This means that code that uses libcutils no longer has to ensure that
it's set ANDROID_SMP in the calling code's Android.mk for this to
function correctly.

Change-Id: I80c7ff170cd621106f34d6b74689d6b4f03e4eb7
2014-11-17 11:16:59 -08:00
Dan Albert
a57aacbaef am 29a34a5e: Merge "Disable the static libcutils tests."
* commit '29a34a5e7c249046a995a140ba30fa10960c7d42':
  Disable the static libcutils tests.
2014-11-14 21:47:40 +00:00
Dan Albert
bb28776db0 Disable the static libcutils tests.
The static libcutils tests cannot be built when using libc++ because
there are multiple symbol definition errors between libc++ and libgcc.

Bug: 18389856
Change-Id: I6f41c561f97b3a37477f844e9abf6551524a0fa3
2014-11-14 10:56:34 -08:00
Hans Boehm
0b7f368442 am 64d7117e: Merge "Second attempt to "Rewrite atomic.h to use stdatomic.h.""
* commit '64d7117efc7f7b8b477cd216a119b07041d8f406':
  Second attempt to "Rewrite atomic.h to use stdatomic.h."
2014-11-14 00:26:51 +00:00
Hans Boehm
c56648948c Second attempt to "Rewrite atomic.h to use stdatomic.h."
This should not be committed until win_sdk and aarch64 builds are
fixed in the presence of this CL.

This reverts commit 2789faabfa.

We additionally remove uniprocessor support from the earlier CL,
thus avoiding a potential compiler code reordering issue.

Change-Id: I7207a5ca2efa907a6f757f172d7090a62b2311fe
2014-11-13 15:59:10 -08:00
Dan Albert
21d8d89c7c am 06279285: Merge "Revert "Move some tests to libc++.""
* commit '06279285ae38b58988a9431c89b8689d8e16904e':
  Revert "Move some tests to libc++."
2014-11-12 05:50:56 +00:00
Dan Albert
1d3b492bde Revert "Move some tests to libc++."
The build system is still linking both libgcc and libcompiler-rt,
which is causing duplicate symbol errors on some architectures. This
requires a fix in the build system, so reverting for now.

This reverts commit e3cccbfd47.
2014-11-11 21:42:27 -08:00
Dan Albert
498c8135b4 am 7d196df6: Merge "Move some tests to libc++."
* commit '7d196df6f9990b5c93e0661fb0867971da7e6c34':
  Move some tests to libc++.
2014-11-12 02:52:59 +00:00
Dan Albert
e3cccbfd47 Move some tests to libc++.
Bug: 15193147
Change-Id: I93244e4a5d0c751056910ec8005a92401d305716
2014-11-11 23:59:02 +00:00
Elliott Hughes
aeac9cd1b3 am 85507404: Merge "Remove dead code."
* commit '855074043144e74156972e7a3416808dc6696452':
  Remove dead code.
2014-11-08 20:11:53 +00:00
Elliott Hughes
9a092dd373 Remove dead code.
__APPLE__ => HAVE_FUNOPEN.

Change-Id: I191cccd9b75020ffbb3281283ce1f1b7abc15d22
2014-11-08 11:32:07 -08:00
Michael Lentine
98a51de1cc Merge "Fix native_handle_create to check if malloc fails" into lmp-mr1-dev
automerge: b542285

* commit 'b5422854361be038b812f1c0272c66cdb4618a4b':
  Fix native_handle_create to check if malloc fails
2014-11-04 00:04:42 +00:00
Michael Lentine
2b8852dece Fix native_handle_create to check if malloc fails
Bug: 18076253
Change-Id: I8dbe3af88f52f18f74a3ab857fea53ae7585e2f7
2014-11-03 13:48:15 -08:00
Chih-Hung Hsieh
6ea35520fd am 07f1300c: am 7979f1ce: Merge "Do not inline rarely used trace function bodies."
* commit '07f1300c4c4f7d3c0df540bf8df3443c3f4539cd':
  Do not inline rarely used trace function bodies.
2014-10-15 17:57:07 +00:00
Chih-Hung Hsieh
c37387a4cd am 07f1300c: am 7979f1ce: Merge "Do not inline rarely used trace function bodies."
* commit '07f1300c4c4f7d3c0df540bf8df3443c3f4539cd':
  Do not inline rarely used trace function bodies.
2014-10-15 17:57:07 +00:00
Chih-Hung Hsieh
2d3150e736 Do not inline rarely used trace function bodies.
When atrace_* functions are inlined,
the rarely used 1024-byte buffers are allocated on stack.

BUG: 17444504
Change-Id: I773512aeb70e8b79f3803c6d59cba064d2aa65b6
2014-10-14 15:37:20 -07:00
Riley Andrews
d1380d645d am 33b33549: Merge "Make the default cgroup, the foreground cgroup." into lmp-mr1-dev
* commit '33b335495c7b8eea4b9af13a7157cf83cd085129':
  Make the default cgroup, the foreground cgroup.
2014-10-08 20:51:48 +00:00
Riley Andrews
522d72b702 Make the default cgroup, the foreground cgroup.
All kernel services will now be in the same cgroup as
foreground applications. This will now make kernel threads
not implicitly higher priority than android foreground
services.

Bug 17681097

Change-Id: I28e81c7aade50428d5395df86f00ce01c1e7af02
2014-10-07 19:24:54 +00:00
Chih-Hung Hsieh
ddb3fe8c17 am ad0ff1d9: am 4fceda2b: Merge "Add -no-integrated-as at local level."
* commit 'ad0ff1d99cd00ce53f667b27e53f44e802315a36':
  Add -no-integrated-as at local level.
2014-10-06 22:37:48 +00:00
Chih-Hung Hsieh
2aaccfe590 am ad0ff1d9: am 4fceda2b: Merge "Add -no-integrated-as at local level."
* commit 'ad0ff1d99cd00ce53f667b27e53f44e802315a36':
  Add -no-integrated-as at local level.
2014-10-06 22:37:06 +00:00
Chih-Hung Hsieh
60c57dad4e Add -no-integrated-as at local level.
Later we will enable integrated-as as default at the global level.

BUG: 17820427
Change-Id: I1beed3e75d074d970fa9112ec1c0f0df3d43947a
2014-10-06 13:33:25 -07:00
Hans Boehm
f381920b58 am 072877af: am 41198eea: Merge "Revert "Rewrite atomic.h to use stdatomic.h.""
* commit '072877af485d49f11e227c0d22a7bb4a341533d6':
  Revert "Rewrite atomic.h to use stdatomic.h."
2014-10-04 02:17:43 +00:00
Hans Boehm
054627df6b am 072877af: am 41198eea: Merge "Revert "Rewrite atomic.h to use stdatomic.h.""
* commit '072877af485d49f11e227c0d22a7bb4a341533d6':
  Revert "Rewrite atomic.h to use stdatomic.h."
2014-10-04 02:09:19 +00:00
Hans Boehm
2789faabfa Revert "Rewrite atomic.h to use stdatomic.h."
This reverts commit cb344d4640.

Change-Id: Ib17cd8d00695062177ce863cedc4ec7148012317
2014-10-04 00:49:06 +00:00
Hans Boehm
954fc61b6b am f5204549: am 028928fe: Merge "Rewrite atomic.h to use stdatomic.h."
* commit 'f5204549faf7310cc808bcb3676fb36268178e26':
  Rewrite atomic.h to use stdatomic.h.
2014-10-04 00:06:45 +00:00
Hans Boehm
2ac8207e50 am f5204549: am 028928fe: Merge "Rewrite atomic.h to use stdatomic.h."
* commit 'f5204549faf7310cc808bcb3676fb36268178e26':
  Rewrite atomic.h to use stdatomic.h.
2014-10-04 00:06:30 +00:00
Hans Boehm
cb344d4640 Rewrite atomic.h to use stdatomic.h.
Replace atomic-inl.h with a file that just includes atomic.h.
Remove platform specific implementations.

Change-Id: If16d74fbe0af7836ed8c1296c17e13a2d0d20f64
2014-10-01 17:37:20 -07:00
Dan Albert
c4affb2b4e am be0d295d: am 19d686ee: Merge "Don\'t manually link stlport."
* commit 'be0d295da912076239a1e112c4b7b94be10cf7af':
  Don't manually link stlport.
2014-09-26 19:53:04 +00:00
Dan Albert
31171b6e31 am be0d295d: am 19d686ee: Merge "Don\'t manually link stlport."
* commit 'be0d295da912076239a1e112c4b7b94be10cf7af':
  Don't manually link stlport.
2014-09-26 19:53:04 +00:00
Dan Albert
b50af2bc60 Don't manually link stlport.
Change-Id: I60d2bc868fb9052f120103e9675046ef54f510d0
2014-09-26 10:37:30 -07:00
Elliott Hughes
f9cdbb1a30 am 6c03b85f: am 32e2f1be: Merge "Clean up memset[16,32] routines: unify files names, remove redundant wrapper for 32-bit, remove Atom caches sizes for 64-bit, fix license."
* commit '6c03b85f1dcfd0efd2ec741cbfb6c5ecc404fbd8':
  Clean up memset[16,32] routines: unify files names, remove redundant wrapper for 32-bit, remove Atom caches sizes for 64-bit, fix license.
2014-09-18 03:23:47 +00:00
Elliott Hughes
bdac720255 am 6c03b85f: am 32e2f1be: Merge "Clean up memset[16,32] routines: unify files names, remove redundant wrapper for 32-bit, remove Atom caches sizes for 64-bit, fix license."
* commit '6c03b85f1dcfd0efd2ec741cbfb6c5ecc404fbd8':
  Clean up memset[16,32] routines: unify files names, remove redundant wrapper for 32-bit, remove Atom caches sizes for 64-bit, fix license.
2014-09-18 03:23:08 +00:00
Varvara Rainchik
458d1253f5 Clean up memset[16,32] routines: unify files names, remove redundant wrapper
for 32-bit, remove Atom caches sizes for 64-bit, fix license.

Change-Id: Ieda6367d7b21cf25b2beda6dd8d77cf668d3f2af
Signed-off-by: Varvara Rainchik <varvara.rainchik@intel.com>
2014-09-17 18:11:18 +04:00
Christopher Ferris
6bcc4acc6f Use the correct debuggerd given the tid.
On 64 bit systems, calling dump_backtrace_to_file will automatically
call debuggerd64. If the process to dump is actually 32 bit, this
creates an unrecognizable dump backtrace. Modify the code to check the
type of the process and connect to the appropriate debuggerd process.

This change refactors both the tombstone and backtrace functionality to
allow both to work properly on 64 bit systems when dealing with mixed
processes.

Bug: 17487122

(cherry picked from commit a9fa7b87f1)

Change-Id: I3c9e0212c8720877a6af092071a3695df2a36df8
2014-09-13 16:22:17 -07:00
Christopher Ferris
07bb3f1e0b am 07dda6b5: Merge "Use the correct debuggerd given the tid." into lmp-dev
* commit '07dda6b57c6a476177b68ad42966f24cbbdb04c1':
  Use the correct debuggerd given the tid.
2014-09-13 22:54:00 +00:00
Christopher Ferris
a9fa7b87f1 Use the correct debuggerd given the tid.
On 64 bit systems, calling dump_backtrace_to_file will automatically
call debuggerd64. If the process to dump is actually 32 bit, this
creates an unrecognizable dump backtrace. Modify the code to check the
type of the process and connect to the appropriate debuggerd process.

This change refactors both the tombstone and backtrace functionality to
allow both to work properly on 64 bit systems when dealing with mixed
processes.

Bug: 17487122
Change-Id: Icf123a6f4508b1aeec073663aa1a0ceae5380aa1
2014-09-12 20:12:11 -07:00
Dan Albert
fb1b6daca8 am 522c1d34: am e18ed89e: Merge "Remove makefile cruft."
* commit '522c1d340b6c1742d3e47aad27b974e43fad4bc2':
  Remove makefile cruft.
2014-09-12 20:08:49 +00:00
Dan Albert
fbb8db2e2a Remove makefile cruft.
Don't manually include stlport, and don't use private bionic headers.

Change-Id: I0fc4e8b34ab449e9ef07c26f71e472fca5640590
2014-09-12 10:36:26 -07:00
Dan Albert
dccbb07dfb am a66532e7: am 91baad56: Merge "Fix some clang compilation issues."
* commit 'a66532e73a9c8205002482477f1bf53366d15f38':
  Fix some clang compilation issues.
2014-09-11 17:48:39 +00:00
Dan Albert
949aa23898 Fix some clang compilation issues.
Use expected inline behavior with clang.

GCC defaults to -std=gnu90, giving C89 inline semantics with GNU
extensions. Clang defaults to C99. Explicitly use gnu90.

Mark an unused parameter as __unused.

Fix some incorrect casts.

Change-Id: I05b95585d5e3688eda71769b63b6b8a9237bcaf4
2014-09-11 17:17:32 +00:00
Elliott Hughes
176fe9005d am 4592d73e: am a59b6ac6: Merge "Only the Mac doesn\'t have open_memstream."
* commit '4592d73e18684b8ba2addb97433eed4cf389e386':
  Only the Mac doesn't have open_memstream.
2014-08-21 03:16:26 +00:00
Elliott Hughes
3ff8888f66 Only the Mac doesn't have open_memstream.
We should probably move this into art, since they're the only people using it.

Bug: 17164505
Change-Id: I67b8f0cbad4c6368d4424e6979d6b044dd36aa37
2014-08-20 16:16:24 -07:00
Elliott Hughes
10cce72c4b am 3859029a: am 7fb0ee0c: Merge "Remove androidGetTid."
* commit '3859029a48aa78150fa61eb4988214f8632b33ce':
  Remove androidGetTid.
2014-08-18 19:34:23 +00:00
Elliott Hughes
b7659613b2 Remove androidGetTid.
Bug: 17048545
Change-Id: I93cbb2d7bd18d506b5f5f7f262dd9ac0fca053b4
2014-08-18 10:47:37 -07:00
Elliott Hughes
a613844e13 am e07a6e63: am 6d9a5ac3: Merge "[MIPSR6] Skip pixelflinger, memset assembler code on mips32r6"
* commit 'e07a6e6337a959c45ab71acf6ff1fad8a8ac5dfd':
  [MIPSR6] Skip pixelflinger, memset assembler code on mips32r6
2014-08-05 21:43:16 +00:00
Duane Sand
734f50c2fe [MIPSR6] Skip pixelflinger, memset assembler code on mips32r6
Temporarily use generic C-coded libpixelflinger & memset on mips32r6.

Change-Id: I629b11ba955eaba323cba1df96c39f75f4d24d62
2014-07-31 16:21:16 -07:00
Stephen Hines
eb49dd791e Remove invalid 64-bit host objects.
Bug: 16408818

These targets are no longer in use, since we have a proper way to create both
32-bit and 64-bit host libraries in a single build now.

Cherry-pick from AOSP: 03cc1f747c

Change-Id: Icd09f795acd220de5b5e956a8d8e1b4ab4864fa9
2014-07-25 10:39:38 -07:00
Stephen Hines
da6d2cb925 am 31dc191b: am 73290cd1: Merge "Remove invalid 64-bit host objects."
* commit '31dc191b2b39d4cbd68feba29c7692c91de57a53':
  Remove invalid 64-bit host objects.
2014-07-22 20:53:45 +00:00
Stephen Hines
03cc1f747c Remove invalid 64-bit host objects.
Bug: 16408818

These targets are no longer in use, since we have a proper way to create both
32-bit and 64-bit host libraries in a single build now.

Change-Id: Icd09f795acd220de5b5e956a8d8e1b4ab4864fa9
2014-07-22 13:36:16 -07:00
Elliott Hughes
400c381835 Move sched_policy.c off bionic's PR_SET_TIMERSLACK_PID.
Change-Id: I3a27803d46b5b88a10aa8043a114d780ed685e56
2014-07-17 17:15:14 -07:00
Elliott Hughes
e07d77e422 Use <sys/prctl.h> instead of <linux/prctl.h>.
Change-Id: I708da00e36a9da8be9184c451453774be6b78c06
2014-07-11 20:58:55 -07:00
Christopher Ferris
1472dd465c am f77cf6c6: am 5450a441: am 676f3755: Merge "Add android_memset16/android_memset32 for aarch64."
* commit 'f77cf6c6986057aceece5d7e09d1c23a9efaf20c':
  Add android_memset16/android_memset32 for aarch64.
2014-06-24 19:38:51 +00:00
Christopher Ferris
d660d895c1 Add android_memset16/android_memset32 for aarch64.
Included new unit tests for these functions.

Bug: 15456369

Change-Id: I3fac02f61c62d15d54d0df51957680d7155e98ae
2014-06-23 19:28:33 -07:00
Igor Murashkin
1f7f70a629 libcutils: Fix warnings in properties.c when verbose logging is enabled
Change-Id: I07c5eb59b9395734ad3fc25eba753564c0f096a0
2014-06-20 15:57:09 -07:00
Igor Murashkin
d8f2a8d34a cutils: Add property_get_bool, _get_int32, _get_int64
* Read out system properties with same syntax as SystemProperties.java
* Also adds unit test suite to validate correctness of properties
* Also fixes buffer overrun in property_get

(cherry picked from commit d4507e9246)

Change-Id: Ifd42911f93e17da09e6ff1298e8875e02f3b6608
2014-06-20 20:01:49 +00:00
Nick Kralevich
30a86ebc7a fs_mkdirs: use O_NOFOLLOW and O_CLOEXEC
Don't follow symlinks. Suggestion from Jann Horn.

Also, add O_CLOEXEC. This prevents file descriptor leakage should
this code ever run in a multithreaded environment.

I'm not sure if either of these changes actually address any
security concerns, but it's harmless, so go ahead and add it.

Bug: 15675141
Change-Id: I7ba4e9d10439b7150f59759b54e3ad8ccba411e3
2014-06-16 15:40:40 -07:00
Dan Albert
232c711795 am 46ed1c8c: am ed1a0dbd: am b44e626c: Merge "Fix windows sdk build."
* commit '46ed1c8c99fce33c78e239d4155ece84feca069d':
  Fix windows sdk build.
2014-06-13 10:24:51 +00:00
Dan Albert
9ea2ad5796 am 6dfe9495: am 9b2d964d: am 08430b1e: Merge "Use syscall(2) instead of ioprio_get/ioprio_set."
* commit '6dfe949568fa9413db72cdccb26baca2c4592a2a':
  Use syscall(2) instead of ioprio_get/ioprio_set.
2014-06-13 03:04:23 +00:00
Dan Albert
5e541bf47d Fix windows sdk build.
Change-Id: I53c9f43a5f9ae2f40de686316185d162d0e0503a
2014-06-13 04:09:37 +00:00
Dan Albert
167c0ed6da Use syscall(2) instead of ioprio_get/ioprio_set.
Change-Id: Ibfd0bdd3dd0bad9804ec9fd9292f4b68a510afdb
2014-06-12 19:48:10 -07:00
Christopher Ferris
45e2756409 am f6d8dedd: am 8af98621: am 5db5b8aa: Merge "Port libcutils memset16/32 to x86_64."
* commit 'f6d8dedd87eb8bbccbbdeb17a6d226f089449d92':
  Port libcutils memset16/32 to x86_64.
2014-06-06 17:26:01 +00:00
Henrik Smiding
86a1600fb6 Port libcutils memset16/32 to x86_64.
Port libcutils memset16/32 assembly SSE2 optimizations to x86_64
architecture. Ensures the same performance on 64-bit arch.

Change-Id: I874a71a884c0d28a152933ddff9cb886c9a6e99e
Signed-off-by: Henrik Smiding <henrik.smiding@intel.com>
2014-06-05 18:51:44 -07:00
Ian Rogers
1165cf4f44 am 928821bd: am 72d77449: am 4ca26ce8: Merge "Host multilib build of both 32-bit and 64-bit libraries."
* commit '928821bd123aa38094289b9c62debb4d92b84069':
  Host multilib build of both 32-bit and 64-bit libraries.
2014-06-05 23:00:09 +00:00
Ian Rogers
59ec765382 Host multilib build of both 32-bit and 64-bit libraries.
Change-Id: I54f91f385b109fc664a1a1f9320affb2a846fef1
2014-06-05 15:26:22 -07:00
Elliott Hughes
a0c01818a2 am e7110ac0: am b122da64: Merge "Fix libcutils/dlmalloc_stubs.c build breakage."
* commit 'e7110ac09bdc77c4a8f7823aa666c9929a33984c':
  Fix libcutils/dlmalloc_stubs.c build breakage.
2014-06-04 04:09:52 +00:00
Elliott Hughes
b122da648d Merge "Fix libcutils/dlmalloc_stubs.c build breakage." 2014-06-04 03:50:33 +00:00
Elliott Hughes
7f0ef73e70 Fix libcutils/dlmalloc_stubs.c build breakage.
Change-Id: I344c410c100ce13c7a88063bf5354ad61c50094b
2014-06-03 20:48:44 -07:00
Mathieu Chartier
39526f7740 am 04511126: am d586e356: Merge "Fix build."
* commit '04511126a6e127705abce84735a3fe4eb48d882c':
  Fix build.
2014-06-04 01:42:00 +00:00
Mathieu Chartier
e942d1f9ea Fix build.
Change-Id: I7b0cf6a248c74f1a06e0b5d51a5be13124ced6a0
2014-06-03 18:12:29 -07:00
Mathieu Chartier
53363f4fa0 am 5a8335c3: am ed30b7ea: Merge "Fix build."
* commit '5a8335c3185ec329bf43b1edc733aef38ce76c36':
  Fix build.
2014-06-04 00:11:52 +00:00
Mathieu Chartier
0b9674f241 Fix build.
Change-Id: I6bafe6221e1ce7e4b04269df90996ab08b050e93
2014-06-03 15:32:10 -07:00
Mathieu Chartier
520a893b1a am b85c2494: am 03b87b49: Merge "Make host ashmem_create_region seed only once."
* commit 'b85c2494df1e1003b3101e36b29faace3a51dc3f':
  Make host ashmem_create_region seed only once.
2014-06-03 20:54:51 +00:00
Mathieu Chartier
03b87b49fa Merge "Make host ashmem_create_region seed only once." 2014-06-03 19:02:35 +00:00
Mathieu Chartier
1104ae8cfc Make host ashmem_create_region seed only once.
Not seeding this each call should help reduce collisions when multiple
threads are calling ashmem_create_region. Also cleaned up code by
deleting gotos, and making formatting consistent.

Bug: 15394258
Change-Id: Iafdaea57b2317e0eb7c40d7b5595c523814fd88c
2014-06-03 11:47:58 -07:00
JP Abgrall
9e18975bac am c99dd0c5: am 676f7d50: am fc85a7a8: Merge "libcutils: fix rw FS remount check issue"
* commit 'c99dd0c58d2a7572740599f81b5a20ddb18dbf9e':
  libcutils: fix rw FS remount check issue
2014-06-03 01:12:15 +00:00
Hong-Mei Li
88f7683d9c libcutils: fix rw FS remount check issue
In some condition, some of FS would set disable_roll_forward option.
In this case, when we do power off or reboot, the power down progress
would stuck at android_reboot for 360 sec.
The reason is, remount_ro_done function check key word "rw" to determine
whether all the read-write FS has been remounted as read-only FS.
Unfortunately, it takes disable_roll_forward as a rw flag too by
mistake, so the check would always fail, until reach 360 sec threshold.

The patch would match "rw," from mount options, this can avoid the issue
successfully.

Change-Id: I409f9dc88c9ee5cf049615ea9dcccaf195b6bc5a
Signed-off-by: Hong-Mei Li <a21834@motorola.com>
2014-06-02 22:45:37 -07:00
Elliott Hughes
b65208d1a9 am f7a7e3c3: am 6dfb039b: am 4a343436: Merge "Fix win32 undefined reference to `_socket_network_client_timeout\'."
* commit 'f7a7e3c301fdf7d98d8bcabf6fefb0fcf5bbf90d':
  Fix win32 undefined reference to `_socket_network_client_timeout'.
2014-05-20 20:18:01 +00:00
Elliott Hughes
0bff5bd952 Fix win32 undefined reference to `_socket_network_client_timeout'.
Change-Id: I063213957b8452f4690da0f64872075f7c27b4cd
2014-05-20 12:13:29 -07:00
Elliott Hughes
5756d8873b am 87d0f45b: am 2dea56e0: am 9e0a6248: Merge "Fix Windows socket_network_client.c build failures."
* commit '87d0f45b3c30dff02bd92f542e5e9e64816f5315':
  Fix Windows socket_network_client.c build failures.
2014-05-20 00:23:11 +00:00
Elliott Hughes
3edc25271f am b42f1413: am 0e71e3ab: am 9cae50b3: Merge "Bound the ADB connect time with a non-blocking connect"
* commit 'b42f141315ae0929325335645d397db04a500c88':
  Bound the ADB connect time with a non-blocking connect
2014-05-20 00:23:08 +00:00
Elliott Hughes
36739556db Fix Windows socket_network_client.c build failures.
Change-Id: Ie67a2305ade02e078bf0edf54104c295b091b1b7
2014-05-19 16:47:12 -07:00
Ken Lierman
aecc6a6657 Bound the ADB connect time with a non-blocking connect
After a disconnect, the initial blocking connect takes
a long time to return, while subsequent calls return
quicks.  Switch to a non-blocking connect to make the
re-connect time more consistent and faster overall.

Change-Id: I21d02b22a8eb9a457c2f1fa95eb17894d5612ccd
Signed-off-by: Ken Lierman <ken.lierman@windriver.com>
Reviewed-by: Gumbel, Matthew K <matthew.k.gumbel@intel.com>
Reviewed-by: Jovanovic, Radivoje <radivoje.jovanovic@intel.com>
Reviewed-by: Boie, Andrew P <andrew.p.boie@intel.com>
2014-05-19 16:16:42 -07:00
Ying Wang
da6a0aa0df am b18da571: am 1e6cd741: am 803fb62b: Merge "Remove unused LOCAL_LDLIBS."
* commit 'b18da571f90eebedd99fe5607a6b0d7ae4e91893':
  Remove unused LOCAL_LDLIBS.
2014-05-08 18:23:57 +00:00
Ying Wang
9f437d7181 Remove unused LOCAL_LDLIBS.
Change-Id: I42aeb7668183e7a06207ee063f6eee4d37d66c6e
2014-05-07 15:36:05 -07:00
Elliott Hughes
7cc73694fa am b389440c: am 54c90a14: am 752115dd: Merge "Add Silvermont architecture cache sizes"
* commit 'b389440c8bdc06fc6d3fdaad6acb8f9c124e40a7':
  Add Silvermont architecture cache sizes
2014-05-05 22:07:02 +00:00
Elliott Hughes
752115dda7 Merge "Add Silvermont architecture cache sizes" 2014-05-05 21:59:53 +00:00
Mark Salyzyn
e6fff56f2e am 027e4e77: am 74088995: am f2c0f328: Merge "libcutils: win_sdk build issues"
* commit '027e4e77c26652948f43ac07ca8a738c469d39f0':
  libcutils: win_sdk build issues
2014-05-05 19:38:45 +00:00
Mark Salyzyn
02a7c3a7c3 libcutils: win_sdk build issues
Change-Id: Ic431166f686aebfd0ee00ad3224b95237ff7a0de
2014-05-05 10:29:56 -07:00
Mark Salyzyn
c413e151de am b3eefcaa: am ce98dc70: am 1e10b661: Merge "libcutils: Mac build pulls in __unused from sys/cdefs.h"
* commit 'b3eefcaa934986f72a3daddf6ad86e276d14d476':
  libcutils: Mac build pulls in __unused from sys/cdefs.h
2014-05-02 22:17:57 +00:00
Mark Salyzyn
edc70938be libcutils: Mac build pulls in __unused from sys/cdefs.h
Change-Id: I2da8a52e07cef0b749f7e60709536e98bd96660e
2014-05-02 19:50:20 +00:00
Mark Salyzyn
b8f86480a2 am a0a461d3: am 82e1b89f: am a32e01d2: Merge "libcutils: turn on -Werror"
* commit 'a0a461d3b7d85484c10db64f078427a5be3da189':
  libcutils: turn on -Werror
2014-05-02 17:12:27 +00:00
Mark Salyzyn
12717169a5 libcutils: turn on -Werror
- Deal with some -Wunused / -Wunused-variable issues

Change-Id: I28c23fb213382a392ec30935749fb359e072d664
2014-05-01 17:58:17 -07:00
Elliott Hughes
84a445b4f5 am 29941ec8: am f8db4afb: am ab3d49b0: Merge "Use the si_code value bionic passes us."
* commit '29941ec81705bdcad2b43f0059e1288304c523e8':
  Use the si_code value bionic passes us.
2014-04-26 03:33:27 +00:00
Elliott Hughes
855fcc3114 Use the si_code value bionic passes us.
Bionic needs to re-raise various signals, which means the si_code
debuggerd sees has been clobbered. If bionic sends us the original
si_code value, we can use that instead of the one we see when the
ptrace the crashed process' siginfo.

Change-Id: If116a6bc667d55a6fb39b74f96673292af4e4c8c
2014-04-25 20:20:39 -07:00
Ruchi Kandoi
f4362ccdd5 Fix build problems caused by commit:
422852ef5c for non-linux hosts.

Change-Id: I00b9c99b9d9d072f19549b3a9970a27e75cd49b7
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
2014-04-24 00:35:46 +00:00
Ruchi Kandoi
422852ef5c Set timer slack value according to thread foreground/background state.
Change-Id: Ia998f349129acf4602b767d1ff94839607fdbdbd
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
2014-04-23 21:56:40 +00:00
Henrik Smiding
c27a444e54 Add Silvermont architecture cache sizes
Adds Silvermont specific cache sizes for memset16/32 SSE optimization.

Change-Id: Ib5ea086d57544e74ac384ee1ef516b8511392f70
Signed-off-by: Henrik Smiding <henrik.smiding@intel.com>
2014-04-18 11:31:54 +08:00
Igor Murashkin
8efea957be libcutils: Fix warnings in properties.c when verbose logging is enabled
Change-Id: I07c5eb59b9395734ad3fc25eba753564c0f096a0
2014-04-15 18:06:39 -07:00
Igor Murashkin
d4507e9246 cutils: Add property_get_bool, _get_int32, _get_int64
* Read out system properties with same syntax as SystemProperties.java
* Also adds unit test suite to validate correctness of properties
* Also fixes buffer overrun in property_get

Change-Id: Ifd42911f93e17da09e6ff1298e8875e02f3b6608
2014-04-11 17:49:01 -07:00
Elliott Hughes
0693c5848d am 4fe18615: am 56d57e88: am 5f130216: Merge "Handle errno properly to avoid corrupt str_parms"
* commit '4fe186159386a75ce17ca0b7ba6ace4294187cb2':
  Handle errno properly to avoid corrupt str_parms
2014-04-04 01:53:51 +00:00
Jens Gulin
d3c8d5b8d4 Handle errno properly to avoid corrupt str_parms
A normal sequence of calls is as follows:
str_parms_create_str, str_parms_add_str, str_parms_destroy.
In some cases the destroy caused double free.

str_parms_add_str will clone the input and send it to hashmapPut
for storage. If hashmapPut did not store the strings it will raise
errno = ENOMEM and leave caller with ownership of the strings.
In any of these cases it will be safe to destroy the str_parms.

But what if it wasn't hashmapPut that said NOMEM? What if there
was a stale NOMEM already before a successful hashmapPut?
In that case the strings will be successfully added to the list
(if new), but when str_parms_add_str sees the NOMEM it will free
them anyway, leaving dangling pointers in the str_parms!!

It is the responsibility of the caller to clear errno before any
interesting call. This patch makes sure that str_parms_add_str
reacts only on errno emmitted from hashmapPut.

Change-Id: If87e4bcc482f09e1c66133d33517b152ebdac65f
2014-04-03 11:19:54 -07:00
Paul McLean
55c6407041 Adding a handy predicate function (str_parms_has_key()
Change-Id: I1af5c260a1a820b65f0850ea9adb38b01fcb183c
2014-03-25 19:08:13 +00:00
Mark Salyzyn
0c3d19ff3d Merge "libcutils: 64-bit compile issues" 2014-03-07 23:33:31 +00:00
Mark Salyzyn
0425b64e0b libcutils: 64-bit compile issues
- Use inttypes.h to print uint64_t values.

Change-Id: Ia10a3b67cadcce282563467a464ec07066cc2051
2014-03-07 15:28:43 -08:00
Alex Ray
157e1b645a libcutils: add method to get klog level
Change-Id: I55e8311bae97703be26e57b415a8ab0a6d9b4361
2014-03-07 13:58:02 -08:00
Paul Kocialkowski
a7e2e7634c libcutils: Socket type might contain bitwise OR flags
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Change-Id: Ia5c8f136793a989fc1d71c61292afe4e5cf169fa
2014-02-26 11:33:45 -08:00
Elliott Hughes
acc0a23a20 Merge "Remove dead code." 2014-02-20 20:06:38 +00:00
Elliott Hughes
b784f37341 Remove dead code.
We have benchmarking for memset in bionic itself, and a benchmarking
framework for other native benchmarking.

Change-Id: I241a288a96d3b2d37f3d51b04a519ac23f18a989
2014-02-20 11:12:41 -08:00
Stephen Smalley
eb3f421e02 Enable building init with -Wall -Werror.
Eliminates various warnings from SELinux-related code.

Bug: 12587913
Change-Id: I28921f0ebd934324436609540d95ccef58552b64
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2014-02-19 09:15:09 -05:00
Mark Salyzyn
3bca606117 libcutils: resolve warning in iosched_policy.c
(cherry picked from commit 407038cd93)

Change-Id: I35b0d1eeba21cc1ed9645a5acfa180ed20797c56
2014-01-27 15:20:23 -08:00
Mark Salyzyn
b957baccd2 libcutils: bug str_parms.c:str_parms_get_float().
str_parms_get_float did not return the output into
*val. Only output if returning with no error. Audit
shows no internal users of this library function

(cherry picked from commit 8e71ddeac0)

Change-Id: I14a3f08a098072a159dd93f85ead36b3f445816f
2014-01-27 15:07:58 -08:00
Mark Salyzyn
2b94cc264f libcutils: UNUSED argument warnings
(cherry picked from commit ba02cd1e9b)

Change-Id: Ie427d481298af8d911bb2b157ebba30954335354
2014-01-27 15:07:15 -08:00
Mark Salyzyn
a6aad4cdb3 libcutils: Move list.c to inlines on list.h
(cherry picked from commit 0ea3624b3e)

Change-Id: I0572555a194d2560e74dfbf07abcec05e9a276a2
2014-01-27 15:04:56 -08:00
Colin Cross
65dd88becc system/core: remove $(KERNEL_HEADERS) from includes
The kernel headers are already in the include path, and manually
adding them again will break on a multiarch build, where the
kernel headers may be different for each arch.

Change-Id: Ib13d96543f2c97b1b487a46e1748ceb2c5724169
2014-01-22 19:06:04 -08:00
Christopher Ferris
1da83c3ecc Init the abort_msg_address value.
When initiating a manual dump, the abort_msg_address parameter is random
garbage. Initialize this value to 0.

Change-Id: I9ba817ee6104f47cfcb2b746bfa6f02a259c86d7
2014-01-10 14:46:03 -08:00
The Android Open Source Project
66ed50af68 Merge commit '536dea9d61a032e64bbe584a97463c6638ead009' into HEAD
Change-Id: I5c469a4b738629d99d721cad7ded02d6c35f56d5
2013-11-22 13:44:43 -08:00
Pavel Chupin
dccdb94284 Replace __reboot call with syscall
__reboot is hidden for 64-bits and should be hidden on others

Change-Id: Ib6435269aac7fa726e49cc02f8f76d2be2875bc6
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
2013-11-21 12:35:12 -08:00
Elliott Hughes
14e28d39f7 Fix a bunch of small system/core bugs.
Missing frees in:
  adb/file_sync_client.c
  fastboot/fastboot.c
  libsparse/output_file.c

Missing closedirs in:
  adb/file_sync_service.c
  cpio/mkbootfs.c
  libcutils/dir_hash.c

Potential buffer overrun in:
  gpttool/gpttool.c

Incorrect NULL check in:
  libsparse/backed_block.c

Bug: https://code.google.com/p/android/issues/detail?id=61564
Change-Id: If97838a9e73a77aef7f416c31c237ce1fca4ce21
2013-10-29 14:12:46 -07:00
Pavel Chupin
9ff8767bc6 Eliminate text relocations in x86 optimized memset versions
Change-Id: Ieb72af8cf7f93210a68a87b1e2538deb5642f4d5
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
2013-10-24 21:42:30 +04:00
Elliott Hughes
9640b30dd7 Use %zd for size_t.
Change-Id: I0139243c309e85236eb00bb471736bdd99eeec84
2013-10-18 17:11:00 -07:00
Elliott Hughes
6891df7a65 am 45ddf184: am 9b8a929d: Merge "libcutils doesn\'t need to be looking at bionic\'s privates."
* commit '45ddf184960225862c6e178588034cce676683e3':
  libcutils doesn't need to be looking at bionic's privates.
2013-10-10 10:40:11 -07:00
Elliott Hughes
7f7b12b8eb am 5baecee3: am be18538d: Merge "Cleanup x86 flags and memset versions"
* commit '5baecee3c6bf348b77b8785bcd8e35362a3507fb':
  Cleanup x86 flags and memset versions
2013-10-10 10:40:10 -07:00
Elliott Hughes
478c566a90 libcutils doesn't need to be looking at bionic's privates.
Change-Id: Ib11a0c1bdc4b85c58274b21a07aa92f958d23713
2013-10-10 09:50:56 -07:00
Pavel Chupin
4aa51cd468 Cleanup x86 flags and memset versions
ARCH_X86_HAVE_SSE2 is always true

Change-Id: I680493d14280aafad5448aec727e8d9a84a6db00
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
2013-10-10 20:20:16 +04:00
Ying Wang
f47c01da18 am 1690a5a6: am aa62be65: Merge "Use SSE2 enhanced memset for capable x86 processors"
* commit '1690a5a6943d4e4b65d5e4dcd077702c2c8f40a0':
  Use SSE2 enhanced memset for capable x86 processors
2013-09-26 10:56:52 -07:00
Daniel Leung
51546ee32c Use SSE2 enhanced memset for capable x86 processors
Originally, if TARGET_ARCH_VARIANT is x86-atom, the SSE2 enhanced
memset is used. This patch extends this to all x86 processors which
support SSE2 (i.e. ARCH_X86_HAVE_SSE2 is true).

Indentation added to the ifeq cases to make this easier to read.

Change-Id: I05f49e237a95359d3f2e3216b037e3fc1a0fbcb0
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2013-09-24 12:53:18 -07:00
Jeff Sharkey
500f3ffad4 am 0ee7d8c6: Fix Mac builds, for realz.
* commit '0ee7d8c68b57c02d02f707d6f71c731234d56eec':
  Fix Mac builds, for realz.
2013-09-20 18:04:53 -07:00
Jeff Sharkey
0ee7d8c68b Fix Mac builds, for realz.
Change-Id: I63e21b90e5b8a8f016dd04ceca4354793faa5e37
2013-09-20 18:00:15 -07:00
Jeff Sharkey
68955fc82e am 4481c325: Fix Mac builds.
* commit '4481c325b16d4a42fd0ebf4c8a2bb5bcc09daf5e':
  Fix Mac builds.
2013-09-20 17:39:27 -07:00
Jeff Sharkey
4481c325b1 Fix Mac builds.
Change-Id: I0eb029395a3afd2f93a7632d7d3d20d28c2ab189
2013-09-20 17:35:15 -07:00
Jeff Sharkey
9729b41574 am 44d6342c: Remove mkdir() side effect, add .nomedia, utils.
* commit '44d6342caa0db1f613809e9ba1ea8d9af0183b74':
  Remove mkdir() side effect, add .nomedia, utils.
2013-09-20 15:57:58 -07:00
Jeff Sharkey
44d6342caa Remove mkdir() side effect, add .nomedia, utils.
Before this change, FUSE lookup() would have the side effect of
creating the directory on behalf of apps.  This resulted in most
directories being created just by Settings trying to measure disk
space.  Instead, we're switching to have vold do directory creation
when an app doesn't have enough permissions.

Create fs_mkdirs() utility to create all parent directories in a
path as needed.  Allow traversal (+x) into /storage directories.

Fix FUSE derived permissions to be case insensitive.  Mark well-known
directories as .nomedia when created.

Bug: 10577808, 10330221
Change-Id: I53114f2e63ffbe6de4ba6a72d94a232523231cad
2013-09-20 14:21:09 -07:00
Colin Cross
8da6e9c717 am c9ff3714: am 596e9c63: Merge "fix valgrind ioctl warning."
* commit 'c9ff37144a7943ee1bc247cef3620c8cce22049d':
  fix valgrind ioctl warning.
2013-09-05 12:57:15 -07:00
Jin Wei
b815701247 fix valgrind ioctl warning.
Initialize local variable to avoid syscall ioctl warning.

Change-Id: Ibad5b86cd799f147c71f182d654e61318e2ac15e
Origin-Change-Id: Iedf5b128ae1743f633d2821ac3e402942ad6642b
Signed-off-by: Jin Wei <wei.a.jin@intel.com>
Signed-off-by: Jian Luo <jian.luo@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 62797
2013-08-31 18:57:46 -04:00
Colin Cross
9227bd3855 Move liblog headers to system/core/include/log
Move the liblog headers to log/ instead of cutils/ to complete
the separation of libcutils and liblog.  cutils/log.h still
exists and includes log/log.h in order to support the many existing
modules that use cutils/log.h.

Change-Id: I2758c9f4aedcb809ca7ba8383d0f55041dd44345
2013-07-24 12:32:39 -07:00
Colin Cross
a44c31cc91 am e755dfd4: Merge changes I1db3137b,I0f66144e
* commit 'e755dfd43812ebd9a0d0d6a2106316f343ffb5a2':
  toolbox: reimplement watchprops using __system_property_foreach()
  libcutils: reimplement property_list() using __system_property_foreach()
2013-06-19 10:33:42 -07:00
Greg Hackmann
6967935eb3 libcutils: reimplement property_list() using __system_property_foreach()
Signed-off-by: Greg Hackmann <ghackmann@google.com>

(cherry picked from commit e7bb159d16)

Change-Id: I0f66144eb8a4a48e04e4fcd125ad37f19ad94b8e
2013-06-18 19:26:27 -07:00
Greg Hackmann
e7bb159d16 libcutils: reimplement property_list() using __system_property_foreach()
Change-Id: I273fbf7151908ee57b9b951e7d8c5f4925bbc109
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2013-06-18 16:37:54 -07:00
Dima Zavin
abb7d58010 HACK: cutils: restore record_stream temporarily
Restore the record_stream code in cutils that was removed
in e00a12bf8a as part of cutils
cleanup.

Unfortunately, there are some prebuilt vendor libs that rely on
this functionality that we cannot currently rebuild.

Remove at the earliest possible convenience once the vendor libs
have been fixed.

Bug: 9189218
Change-Id: I5d44126756f1e3ed194d1b5873d64d9154183199
Signed-off-by: Dima Zavin <dima@android.com>
2013-06-04 17:40:28 +00:00
Nick Kralevich
b39e3a8a4f libcutils: Don't build host property support
Only build property support for the device, not for the
host. Host side property support is being removed, as it
was only really used for the simulator.

process_name.c: When building this for the host, don't
reference properties.

Change-Id: Idcea5ad52a85e47eef17a381cb0601657efbdf13
2013-05-23 11:04:54 -07:00
Dima Zavin
e00a12bf8a cutils: first pass at cleaning up legacy/obsolete code in cutils
Removed unused code and moved libraries with single clients
near their respective users.

Change-Id: I65f90f8659f27bd0f44ca5ddf33da2bce14674c1
Signed-off-by: Dima Zavin <dima@android.com>
2013-05-07 00:19:44 -07:00
Nick Kralevich
072ee01430 Merge "Make init handle reboots" 2013-04-24 15:43:10 +00:00
Nick Kralevich
ca8e66a8b0 Make init handle reboots
Move the responsibility for rebooting the system from the
reboot command to init. Init is in a better position to take
actions to bring the system down cleanly, including making sure
filesystems are mounted read-only.

The only UIDs which can perform an init triggered reboot are
root, system, and shell.

Modify the reboot command so that it calls into init to perform
the reboot. The reboot command no longer requires CAP_SYS_BOOT.

Remove the -n reboot option and code which supports it.  Anyone needing
to do an unclean shutdown can just do a 'echo c > /proc/sysrq-trigger'.

Modify adb so that it calls into init to perform a shutdown.

Bug: 8646621
Change-Id: I84c0513acb549720cb0e8c9fcbda0050f5c396f5
2013-04-23 13:21:40 -07:00
Todd Poynor
451a6ba829 klog: error handling fixups
Change-Id: I9014e62010c589ec30d5e99eef420353e35418b5
2013-04-22 11:07:14 -07:00
Jamie Gennis
b7b2c71bf8 am 25538257: Merge "cutils: add a way to disable tracing for a process" into jb-mr2-dev
* commit '2553825797c40b14981b1b24e44475e07b02267f':
  cutils: add a way to disable tracing for a process
2013-04-16 15:18:29 -07:00
Jamie Gennis
2553825797 Merge "cutils: add a way to disable tracing for a process" into jb-mr2-dev 2013-04-16 22:12:47 +00:00
Jamie Gennis
b13ea45a04 cutils: add a way to disable tracing for a process
This change adds the atrace_set_tracing_enabled call to libcutils.  The call
can be used to disable all tracing (of the atrace variety) for the current
process.  This is to be used to disable tracing in the Zygote process, as there
is no way for Zygote to be notified of changes to the enabled trace tags.

Change-Id: I0b691cc0dcfc65b16e3d17e1db2866a4deb253a7
2013-04-15 18:50:22 -07:00
Ken Sumrall
3b0511788c am 774814d1: Merge "klog: Have klog_write() call klog_init() if needed" into jb-mr2-dev
* commit '774814d1940a87175fc7dc692fef5c626d893968':
  klog: Have klog_write() call klog_init() if needed
2013-04-15 10:35:31 -07:00
Ken Sumrall
7425fd1b23 klog: Have klog_write() call klog_init() if needed
Also change klog_init() to do nothing if already initialized.

Change-Id: Ia2dfe914c9d9fd119fb8939508d57b15c9884663
2013-04-11 20:03:47 -07:00
Ying Wang
821620f593 am c796ed97: We need libcutils to include liblog
* commit 'c796ed97466510dd5239008554decbe72825e19c':
  We need libcutils to include liblog
2013-04-11 15:57:35 -07:00
Ying Wang
c796ed9746 We need libcutils to include liblog
For some prebuilts were built against libcutils with liblog in it.
Unfortunately that means in the future if someone checks in prebuilts
that are built against libcutils and they don't explicitly link against
liblog, they will again prevent us from removing liblog from libcutils.

Bug: 8587800
Bug: 8580410
Change-Id: I2a5ed6233df7e7d542d1e4167bec405750c0e671
2013-04-10 17:33:48 -07:00
Keun-young Park
9c37960cd9 am 9b32f87a: Merge "Add Mips memset speedup"
* commit '9b32f87a8c489a15baea535800b7c309014bd0ee':
  Add Mips memset speedup
2013-03-29 16:09:10 -07:00
Keun-young Park
9b32f87a8c Merge "Add Mips memset speedup" 2013-03-29 21:05:23 +00:00
Jamie Gennis
774f929991 libcutils: add support for app tracing
This change adds support for tracing using the ATRACE_TAG_APP tag.  This tag is
enabled only for processes in which the /proc/<pid>/cmdline value appears in
the comma-separated list of such values in the debug.atrace.app_cmdlines system
property.  It is also only enabled if either the ro.debuggable system property
is set to 1 or the application has declared itself debuggable in its manifest,
which gets reported to libcutils by the framework.

Change-Id: Ic94ba55f4e70a9cf994056acbf151e523428b65d
2013-03-28 20:59:31 +00:00
Jeffrey Brown
c5c410fe3d am 4b9bdd33: am 90dd1402: am 241194ca: Merge "[MIPS] Benchmark test for MIPS memset16/memset32"
# By Duane Sand
# Via Android Git Automerger (2) and others
* commit '4b9bdd333362c1f58260c37306f1902fb215f7bf':
  [MIPS] Benchmark test for MIPS memset16/memset32
2013-02-06 20:59:56 -08:00
Jeffrey Brown
241194cad4 Merge "[MIPS] Benchmark test for MIPS memset16/memset32" 2013-02-07 04:40:05 +00:00
Nick Kralevich
b94fd1abcb cutils: remove dead code.
The last caller of this code was removed in
dalvik commit eb1703442f3fc0577b3395b7eb4d55300b4125db
(https://android-review.googlesource.com/50689)

Change-Id: I3f4865c02092752a13369a3b2c3289fc9a4f6a62
2013-01-29 13:19:20 -08:00