Commit graph

225 commits

Author SHA1 Message Date
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
Elliott Hughes
def8d6a706 The localtime_tz and mktime_tz extensions are now in bionic.
(cherry-pick of d03072ffde. This change
was originally committed to AOSP, is in internal master, but was somehow
lost from AOSP.)

Bug: 7012465

Conflicts:

	libcutils/Android.mk

Change-Id: I08ee8eb9b8ce5d3f9d8f2e67437d653e08697bc1
2013-01-15 11:34:08 -08:00
Duane Sand
d4a80984fc [MIPS] Benchmark test for MIPS memset16/memset32
Author: Chris Dearman <chris@mips.com>
AuthorDate: 2011-07-26 19:24:40
Change-Id: I0a7b3360aaf45de8ee47744f7031b84f15f37611
2012-12-27 12:38:51 -08:00
Ben Cheng
26f447f5da am 7f692fe6: am 523e21d3: Merge "Fail-proof the inline directives for SMP atomic operations."
* commit '7f692fe6448049dca2795d7d648615a2dc7a500c':
  Fail-proof the inline directives for SMP atomic operations.
2012-12-07 14:37:04 -08:00
Ben Cheng
5206d59712 Fail-proof the inline directives for SMP atomic operations.
The various atomic operations are declared as inline in the header files
to cut the function call overhead. However, the plain inline keyword is
just a suggestion to the compiler which makes its own decision on whether
to inline them or not. Worst, if they are not inlined, the
-fvisibility-inlines-hidden compiler flag will render them as hidden
symbols in the object file. If they are picked up by the linker over the
ones supplied in libcutils.so the following warning will be reported:

warning: hidden symbol 'android_atomic_inc' in foo.o is referenced by
DSO bar.so

One way is to add __attribute__((visibility("default"))) to those inline
functions to suppress the linker warnings. A better way is to force
inlining as with this patch.

Change-Id: Ie4fcfdfaaf06f42d351619a0d89671a9df15ca2f
2012-12-07 11:07:10 -08:00
Alex Ray
e7bb7bca4f cutils: trace: add atrace_update_tags()
Adds a function to read the current trace system property value, and
sets the trace tags to it, do be used as a sysprop change callback.

Change-Id: Ia6336652173aa5b07188898736c2c795a69fe79a
2012-11-28 13:56:49 -08:00
Alex Ray
0a34643160 cutils: Add tracing support
Basic tracing functionality to cutils, which can be turned on at start,
or dynamically controlled by the frameworks.  The goal is for hardware
modules to add tracing that will be controlled by their respective
services.

Change-Id: I84eeb7d6be0038f734e719074fa4a2fae4ffe9c0
2012-11-28 13:56:15 -08:00
Elliott Hughes
663005248d The localtime_tz and mktime_tz extensions are now in bionic.
Bug: 7012465

(cherry-pick of d03072ffde3279fbb60591a0d07c820d8e792762.)

Conflicts:

	libcutils/Android.mk

Change-Id: I5e34edd4c8f59cc0a4d5dcc4740707ae063608a0
2012-10-18 11:38:23 -07:00
Nick Kralevich
69ce489fc3 fs.c: Fix implicit declaration of function 'mkstemp'
system/core/libcutils/fs.c: In function 'fs_write_atomic_int':
system/core/libcutils/fs.c:109:5: warning: implicit declaration of function 'mkstemp' [-Wimplicit-function-declaration]

Change-Id: I337ecb818f85e20b058f782df45987acf2e9d6c1
2012-10-15 15:51:33 -07:00
Jeff Sharkey
489609bb44 Allow mkdir() race to succeed.
When two zygotes are starting, they both may try creating a mount
point after checking lstat().  The second mkdir() will result in
EEXIST, which is okay to ignore.

Bug: 7165469
Change-Id: If4411e2621f773c74cd05247899982fa5ebdd020
2012-09-25 13:13:08 -07:00
Jeff Sharkey
6de7026790 Wrap more system calls in TEMP_FAILURE_RETRY.
Bug: 7151474
Change-Id: I9fe19746104cf392f88ea5cf8061e2e21e334671
2012-09-13 15:11:42 -07:00
Jeff Sharkey
ddb1733944 Wrap system calls in TEMP_FAILURE_RETRY.
fs_prepare_dir() is used heavily during Zygote init, and can easily
run into EINTR.

Bug: 7151474
Change-Id: I7aac43a43483d55db47ca20456fff68ce51bbc46
2012-09-13 15:02:53 -07:00
Jeff Sharkey
9685194fc9 File-system utilities for installd and zygote.
Bug: 7008879
Change-Id: Ia54b8d4ad434e8973f235e2a4728651814bef8a9
2012-08-30 10:29:41 -07:00
Duane Sand
1ca120588a Add Mips memset speedup
Change-Id: I157aa8b500e271c213bf615dd4ceb25b3aedd7c2
2012-08-29 12:33:50 -07:00
Ian Rogers
fd7f1b6a50 Revert "Revert "Upgrade to dlmalloc 2.8.5.""
This reverts commit 42b83c6df7.
2012-08-28 15:52:20 -07:00
Brian Carlstrom
42b83c6df7 Revert "Upgrade to dlmalloc 2.8.5."
This reverts commit 2d13791ce7.
2012-08-22 12:10:19 -07:00
Brian Carlstrom
1768707951 am e05ac541: am 9d779bf1: Merge "Upgrade to dlmalloc 2.8.5."
* commit 'e05ac5415e861dee6a3f175c8066ff577736ba1f':
  Upgrade to dlmalloc 2.8.5.
2012-08-20 17:04:24 -07:00
Ian Rogers
2d13791ce7 Upgrade to dlmalloc 2.8.5.
Remove mspace functionality from cutils.
Directly declare mspace from dlmalloc in code flinger's code cache, and
manage without using morecore.

Depends upon: https://android-review.googlesource.com/41717

Change-Id: If927254febd4414212c690f16509ef2ee1b44b44
2012-08-20 15:30:35 -07:00
Jeff Sharkey
de980f27a7 Omit multiuser.c from Windows builds.
Change-Id: I0cee35373e33084e4fc65a1d5c0b611c6fa82346
2012-08-16 17:16:43 -07:00
Jeff Sharkey
2be5338a84 Merge "Multi-user external storage support." into jb-mr1-dev 2012-08-16 14:33:00 -07:00
Jeff Sharkey
885342a0f2 Multi-user external storage support.
Remount rootfs as recursively shared, so that mount changes are
propagated into child namespaces.  Mount external storage for access
from adb.

Clean multi-user dependencies for use in Dalvik.  Also define
external storage paths.

Bug: 6925012
Change-Id: I375de581a63f4f36667894c56a34a9dd45361e8f
2012-08-15 21:10:07 -07:00
Jean-Baptiste Queru
93be76f5c0 am e8e73b01: am 311a4758: Merge "Remove system/core\'s remnants of SH support."
* commit 'e8e73b01399e8d3c3fc6b94d26ef9cc49b33dda8':
  Remove system/core's remnants of SH support.
2012-08-13 16:03:30 -07:00
Elliott Hughes
6521a41dcf Remove system/core's remnants of SH support.
SH support is long dead.

Change-Id: I6be2763ca9f1ad8b3f9b09a8ad2f1d67f1e7f802
2012-08-11 10:04:00 -07:00
Jeff Sharkey
46ac0ef00b Include to define uid_t.
Change-Id: I02d36346fc3c6236bd64309798b434405f8dfef7
2012-08-08 13:59:34 -07:00
Jeff Sharkey
9509d27252 Native utils for working with user and app IDs.
Bug: 6925012
Change-Id: I56f18826fd324f60b6e446cebd30719258e40990
2012-08-07 17:56:48 -07:00
Jeff Brown
053b865412 Enhance native stack dumps.
Provides a new mechanism for dumpstate (while running as root)
to request that debuggerd dump the stacks of native processes that
we care about in bug reports.  In this mode, the backtrace
is formatted to look similar to a Dalvik backtrace.

Moved the tombstone generating code into a separate file to
make it easier to maintain.

Fixed a bug where sometimes the stack traces would be incomplete
because we were not waiting for each thread to stop after issuing
PTRACE_ATTACH, only the main thread.  So sometimes we were missing
traces for some threads.

Refactored the logging code to prevent accidentally writing data
to logcat when explicitly dumping a tombstone or backtrace from the
console.

Only root or system server can request to dump backtraces but
only root can dump tombstones.

Bug: 6615693
Change-Id: Ib3edcc16f9f3a687e414e3f2d250d9500566123b
2012-06-08 13:29:23 -07:00
Dima Zavin
29319a6753 cutils: sched_policy: remove audio app/sys groups, merge into fg
Bug: 6528015
Change-Id: I6c2658b62442d811b53c6d18476fbd6cd45f9e3f
Signed-off-by: Dima Zavin <dima@android.com>
2012-06-04 13:20:17 -07:00
Dima Zavin
13ed76bfbc cutils: sched_policy: make bg group be nested under fg
Adds an apps cgroup which will contain fg tasks. Move the bg group
nested underneath it.

Bug: 6538553
Change-Id: I55279415da625e15a5bb061c2b45fbe7f7a4c047
Signed-off-by: Dima Zavin <dima@android.com>
2012-06-04 10:42:40 -07:00
Jeff Brown
5b878d24c1 Revert "Revert "Use O_CLOEXEC when opening cgroup fds.""
This reverts commit 4df54bc4a8.
2012-05-08 15:07:58 -07:00
Jeff Brown
bff8f3fa98 Add stubs for host builds.
Bug: 4466013
Change-Id: I5633c841e71a48357bb04cd7ccc02550c17bde22
2012-05-08 15:07:32 -07:00
Jeff Brown
4df54bc4a8 Revert "Use O_CLOEXEC when opening cgroup fds."
This reverts commit e1440d81ae
2012-05-08 14:58:30 -07:00
Jeff Brown
e1440d81ae Use O_CLOEXEC when opening cgroup fds.
Bug: 4466013
Change-Id: I0d2e915fc550a0ecaccad5e452dd4c87fc878b8b
2012-05-08 13:41:10 -07:00
Jeff Sharkey
e34b91719c Support full 32 bits for socket tags.
Bug: 5321184
Change-Id: Iabd668674e60626caafc9b66b29fdbddc3724f58
2012-05-02 16:01:31 -07:00
Glenn Kasten
10ec3c7645 Add more SP_ constants
Change-Id: I52c8ea33b9b915fc08546f2ca0b191391f58506b
2012-04-23 17:34:06 -07:00
Glenn Kasten
69bfb1f099 Scheduling group cleanup - add comment, SP_DEFAULT
Also tid == 0 maps to gettid() on platforms that support it.
This is needed by mediaserver code that was formerly using
the old C++ API.

Change-Id: I8baaa3e42315c9b924cec26b6da01e7cb69e0078
2012-04-20 10:31:50 -07:00
Geremy Condra
15621e0970 cutils: return the remote uid on netlink recv failure
This change adds a layer of indirection to uevent's
uevent_kernel_multicast_recv, allowing dependent code to
get the remote endpoint if desired.

Change-Id: If2f00708a1dd6196c415b1ebc2a7eeb72399a90e
2012-03-29 17:07:24 -07:00
Jeff Brown
4a6b384f60 Provide portable wrapper for qsort_r.
qsort_r() is declared differently on BSD and GNU libc and
may be absent on other platforms.

Provide qsort_r_compat() which should work everywhere.

Change-Id: I17a9026573b1ed971ff7d79895e7eb41ba108807
2012-03-19 14:07:26 -07:00
Jeff Brown
14d0c6c7c0 Add missing includes.
Caused warnings about implicitly defined malloc() and sprintf().

Change-Id: Ia56309adc11caf5801ffd88e374c512b785cfd93
2012-03-19 14:06:50 -07:00
Dima Zavin
c4edb9ec90 Merge "cutils: str_parms: when deleting entry, need to also remove key" 2012-03-19 09:56:14 -07:00
Glenn Kasten
0ad682cdde Merge "Add get_sched_policy_name() and use in ps and top" 2012-03-15 15:45:19 -07:00
Glenn Kasten
86c7cc8189 Add get_sched_policy_name() and use in ps and top
This will make it easier to add additional policies (cgroups) if needed.
Also added comments to the sched_policy APIs.

Change-Id: I33ce1cc4deae10983241f7391294b7a512d2c47c
2012-03-15 15:10:45 -07:00
Dima Zavin
efd7501d53 cutils: str_parms: when deleting entry, need to also remove key
When removing one entry, we can't just remove it from the map since
key will not be freed. So, instead, search through the map for the key
and free it once it is found.

Change-Id: Id745c166a4acc5ea25f6d6cdbfe4f8fbc21cbbb3
Reported-by: Xin Qian <xqian@marvell.com>
Signed-off-by: Dima Zavin <dima@android.com>
2012-03-14 23:17:11 -07:00
Dima Zavin
86bfbe3cae cutils: str_parms: free the key if the value was replaced during create/add
Change-Id: I9f31da62f10f78ed11693a7c04e2be29b0790c93
Reported-by: Xin Qian <xqian@marvell.com>
Signed-off-by: Dima Zavin <dima@android.com>
2012-03-14 23:17:11 -07:00
Andrew Hsieh
9d4dbf4835 Merge "Added rules to build 64-bit libraries: lib64cutils.a and lib64log.a" 2012-03-13 16:28:08 -07:00
Dima Zavin
eccfb08f38 Revert "cutils: str_parms: make test executable build for host instead"
This reverts commit 7d31e6e533.
2012-03-12 15:06:05 -07:00
Dima Zavin
7d31e6e533 cutils: str_parms: make test executable build for host instead
Change-Id: I711e03aaf859107c697c6dcb82e0ab83e94570ba
Signed-off-by: Dima Zavin <dima@android.com>
2012-03-12 11:03:38 -07:00
Dima Zavin
a603e40f9e cutils: str_parms: test str_parms_add_str too
Change-Id: I93f0e577aff6b8ff23a44e29f9942a26545b6dc8
Signed-off-by: Dima Zavin <dima@android.com>
2012-03-12 11:03:38 -07:00
Dima Zavin
70b93034f3 cutils: str_parms: need to also dup the key when adding to hash
Change-Id: Iabdd2061cbc36c6f4d4eb6e46bd757b5b52e0027
Signed-off-by: Dima Zavin <dima@android.com>
2012-03-12 11:03:38 -07:00
Andrew Hsieh
99e7f7af84 Added rules to build 64-bit libraries: lib64cutils.a and lib64log.a
Both libraries are needed to build four shared libraries in 64-bit
for 64-bit emulator with "-gpu on"
  lib64OpenglRender.so
  lib64EGL_translator.so
  lib64GLES_CM_translator.so
  lib64GLES_V2_translator.so

Change-Id: If57f72d4661a74f1d5e537568881f39132e0b43d
2012-03-01 23:58:50 -08:00
David 'Digit' Turner
7913bc05be libcutils: Use proper private header to access C library's <time.h> extension
The strftime_tz() function is not a standard C library function and should not
appear in <time.h>. Instead, it is being moved to <bionic_time.h>, a private
header only available to platform libraries.

Change-Id: I4dc18939b9380725dfaa20c9e417296363bc52f4
2012-01-13 13:38:40 +01:00
Steve Block
01dda204cd Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGE
Bug: 5449033
Change-Id: Ibcffdcf620ebae1c389446ce8e9d908f11ac039c
2012-01-08 11:03:26 +00:00
Steve Block
ae8b56c0d1 Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGE
Bug: 5449033
Change-Id: I1e070511b6a538e9f1c94657356437a457d58882
2012-01-05 22:25:38 +00:00
Steve Block
fe71a61e5b Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF) DO NOT MERGE
Bug: 5449033
Change-Id: I4951baa981f09a84ce483e3d1bd0f9ebe009035f
2012-01-04 19:23:34 +00:00
Steve Block
8d66c49258 Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGE
Bug: 5449033
Change-Id: I9244d927f14c750cd359ebffb1fc1c355a755d5a
2012-01-03 22:32:30 +00:00
Steve Block
69f4cd7f5a Rename (IF_)LOGV(_IF) to (IF_)ALOGV(_IF) DO NOT MERGE
Bug: 5449033
Change-Id: Ib453f869977a6e909095a578bbf0420851f887d2
2011-10-26 09:59:23 +01:00
JP Abgrall
29656d34a2 qtaguid: shhhh. LOGI -> LOGV
Less verbose output.

Bug: 5360129
Change-Id: Id32a7c61d51b6a16f50a5c8bcc75a2feaa0e34b1
2011-09-22 14:39:47 -07:00
JP Abgrall
243123fb41 libcutils: qtaguid: Support new functions, add tag resource tracking.
* Add support for
  deleteTagData(tag, uid)
  setCounterSet(counterSetNum, uid)
  setPacifier(on)

* Add resource tracking
(If only kernel process termination had a hook)
Because the xt_qtaguid netfilter module needs to keep track of
tagged sockets, it needs a way to know when the process owning
the socket has died.
Normally the app will untag the sockets. But not on crash.
So the process opens the qtaguid misc dev, which is closed on crash,
at which point the xt_qtaguid can force-untag the processes sockets,
and thus allowing their refcount to go down and release them.

* Add pacifier support
 Add function to enable/disable pacification of the xt_qtaguid
 kernel module. (mostly for debugging)

Change-Id: I7f2228e65208046dd37ec1c7407ee307d5ba9b99
2011-09-14 15:00:40 -07:00
Dima Zavin
7e14e0c974 cutils: only build klog for target
Change-Id: Id524753ca5e7271a498fdf03179bba3fdaed5729
Signed-off-by: Dima Zavin <dima@android.com>
2011-09-04 17:16:13 -07:00
Dima Zavin
da04c52ab1 init/cutils: move list utility code to cutils from init
Change-Id: I357ceee813700297d8343159f22a07659e768d41
Signed-off-by: Dima Zavin <dima@android.com>
2011-09-02 12:11:18 -07:00
Dima Zavin
8f91282ebe init/cutils: move kernel logging interface to libcutils from init
Change-Id: Ia0f91b1fcd6cae69d76bf3dd841340958db938a8
Signed-off-by: Dima Zavin <dima@android.com>
2011-09-02 12:11:17 -07:00
Dima Zavin
2d55e02d0f libcutils/init: move uevent socket opening code to libcutils
Change-Id: I90adf78c0eb6185505f2bf7b62e96e25ab918345
Signed-off-by: Dima Zavin <dima@android.com>
2011-09-02 12:11:17 -07:00
Ashish Sharma
9b5c774369 libcutils: qtaguid: support socket untagging, return errors.
- Enable and rename qtaguid_tagSocket()
  - Add qtaguid_untagSocket()
  - Return kernel errors to caller

Change-Id: I8e33c8832b7f6b24ed9081f36ce1ea9ae6b099c0
Signed-off-by: Ashish Sharma <ashishsharma@google.com>
2011-08-07 23:22:59 -07:00
Jeff Brown
29e1e7393d Remove the simulator target from all makefiles.
Bug: 5010576

Change-Id: I2fcf31af681d92880e5d31a46d5f6777f7ca1977
2011-07-11 22:12:32 -07:00
Ashish Sharma
1ac6ddeba6 Move qtaguid.c from common sources in Android.mk to fix windows build.
Change-Id: I0a2d1615108b6c10064b3635d05699748a1341a4
2011-07-10 15:25:28 -07:00
Ashish Sharma
8626cce5f3 Add communication support for xt_qtaguid(network traffic accounting) kernel module.
Change-Id: Ie0fb5b593987c53ee6f906fe6e0caab5a581d5a1
2011-07-08 19:17:03 -07:00
Eric Laurent
3142a203b3 Merge "Config utils improvement" 2011-05-27 10:20:00 -07:00
jeffhao
2b8f76cdbb Tracking merge of dalvik-dev to master
Reordered bootclasspath to allow verification of all framework methods.
  git cherry-pick --no-commit  ec164a0170955fe63106c2576a65bc4ffb1df425

Address CVE-2011-1090.
  git cherry-pick --no-commit  3365288d3c00072689cd9d733e055561cadc87b5

Change-Id: I6a89bc600ced06a0cb84ae1670cb7a6ea39de9c8
2011-05-27 00:50:44 -07:00
Ken Sumrall
e555f54965 Merge "Crypto changes for devices that don't write ext4 fs on wipe" 2011-05-26 20:01:19 -07:00
Ken Sumrall
b05b0b5d3b Crypto changes for devices that don't write ext4 fs on wipe
This adds a new function to libcutils, partition_wiped().
This is used to determine if a partition is wiped.

Change-Id: Ibb388976c6b5bd3923b62d8f79b2b97748abf6c1
2011-05-26 19:42:32 -07:00
Eric Laurent
c3cf1a8278 Config utils improvement
Added a function to free resources allocated by config node tree.

Change-Id: I2ee8ae642899ec4501fa6e490c5be7efaa2d738e
2011-05-26 13:57:03 -07:00
Nick Kralevich
57de8b8f27 rename uevent_checked_recv to uevent_kernel_multicast_recv
Change-Id: I1839627490080efcbb7269699709064856312f8b
2011-05-11 14:58:24 -07:00
Dima Zavin
14fc0c2765 libcutils: build str_parms test for target instead of host
Change-Id: Ic1cd1c26b86b051c25db2521bd90b58731e29135
Signed-off-by: Dima Zavin <dima@android.com>
2011-04-27 22:26:23 -07:00
Dima Zavin
0e02fcab11 Merge "libcutils: add a simple string parameter parsing ("a=b;c=d;") helper utils" 2011-04-27 17:07:12 -07:00
Dima Zavin
c5ae7dbf4c Merge "libcutils: hashmap: save next pointer in forEach before calling callback" 2011-04-27 17:06:53 -07:00
Nick Kralevich
b0d0e260bd resolved conflicts for merge of 2baeb898 to honeycomb-plus-aosp
Change-Id: Ib3169b3a36aa13ef413da624355b1737e9b76fd9
2011-04-27 13:09:24 -07:00
Vernon Tang
3f582e92f0 Fold uevent message origin checking from init into libcutils.
Change-Id: I7cbc0cb840d1b4962e6c360fdad9a9c0ce20e87b
2011-04-28 05:16:21 +10:00
Nick Kralevich
de35f2741c am 03752be0: am 0c297f5e: Merge "Revert "Fold uevent message origin checking from init into libcutils.""
* commit '03752be0a437d12e19ac73ebe23385fe6f756e2c':
  Revert "Fold uevent message origin checking from init into libcutils."
2011-04-27 10:35:06 -07:00
Nick Kralevich
de9e65dd65 Revert "Fold uevent message origin checking from init into libcutils."
This reverts commit 8405ec0e75.

The original change does not compile.
2011-04-27 10:21:24 -07:00
Nick Kralevich
e3ab424570 am a7cf7ed9: am 282c2ab4: Merge "Fold uevent message origin checking from init into libcutils."
* commit 'a7cf7ed93486240ca48a407e67c7c3683a3b93aa':
  Fold uevent message origin checking from init into libcutils.
2011-04-27 09:59:14 -07:00
Vernon Tang
8405ec0e75 Fold uevent message origin checking from init into libcutils.
Change-Id: I1a38e611a7ad990f74306ce453740a1eeed2416d
2011-04-27 14:17:15 +10:00
Dima Zavin
0fad7d023f libcutils: add a simple string parameter parsing ("a=b;c=d;") helper utils
Change-Id: Ifabeb75550fa6e351434e6e6d036b19331daf6c1
Signed-off-by: Dima Zavin <dima@android.com>
2011-04-20 19:04:40 -07:00
Dima Zavin
4fab9ac04e libcutils: hashmap: save next pointer in forEach before calling callback
If the callback passed to forEach tries to remove the element it was passed,
there's a use-after-free of the entry pointer in forEach.

Change-Id: Ia364b4775c9c55780b23f683b30cbff511b7f944
Signed-off-by: Dima Zavin <dima@android.com>
2011-04-19 15:16:18 -07:00
satok
f0a670eb12 do not merge. Fix a race in system properties.
Backport Iee1ca9b7defd6

This now passes:

$ adb shell am instrument -w -e class android.os.SystemPropertiesTest \
  com.android.frameworks.coretests.systemproperties/android.test.InstrumentationTestRunner

  (which tests setting and re-reading back system properties in a loop)

  This patch depends on I110b653a which moves property setting
  from libcutils into bionic.

  Bug: 3511230

Change-Id: I145e642bd13079677017bb64e361e176fc73b810
2011-03-15 23:15:02 -07:00
Brad Fitzpatrick
7cf20f925d Merge "Fix a race in system properties." 2011-03-14 17:09:36 -07:00
Ken Sumrall
e3aeeb4de3 Try to unmount writable filesystems when rebooting
Ext4 filesystems like to be unmounted before rebooting.  The Android system
doesn't have a traditional Linux init setup, and shutting down the system
was not much more than calling sync(2) and reboot(2).  This adds a new
function to libcutils called android_reboot().  By default, it calls sync()
and then remounts all writable filesystems as read-only and marks them clean.
There is a flag parameter in which the caller can ask for sync() not to be
called, or to not remount the filesystems as read-only.  Then it will call
reboot(2) as directed by the other parameters.  This change also updates
adb, init and toolbox to call the new android_reboot() function.
Fixes bugs 3350709 and 3495575.

Change-Id: I16d71ffce3134310d7a260f61ec6f4dd204124a7
2011-03-10 18:11:46 -08:00
Brad Fitzpatrick
eb1f0c6fd1 Fix a race in system properties.
This now passes:

$ adb shell am instrument -w -e class android.os.SystemPropertiesTest \
  com.android.frameworks.coretests.systemproperties/android.test.InstrumentationTestRunner

(which tests setting and re-reading back system properties in a loop)

This patch depends on I110b653a which moves property setting
from libcutils into bionic.

Bug: 3511230
Change-Id: Iee1ca9b7defd6060510a01f40fbe63ba4c96eb8d
2011-03-10 16:00:48 -08:00
Carl Shapiro
0a16d83969 Remove unconditional swap from the android atomic operations suite.
Bug: 3381237
Change-Id: I7bdc7c8eb4c1cc6303d96e40ca2f196a007c4dd2
2011-01-23 14:09:17 -08:00
Lu, Hongjiu
bb12ac9b85 Assembly coded android_memset16 and android_memset32
Change-Id: Ife2dd406e1dcb962e5e97788c515ac96f5c52e44
2011-01-07 11:26:34 -08:00
Bruce Beare
d7a295221a Assembly coded android_memset16 and android_memset32
Change-Id: Ifa05006df7ce7364d18eb10d64a818d619664475
Author: Lu, Hongjiu <hongjiu.lu@intel.com>
Signed-off-by: Mark Gross <mark.gross@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
2011-01-02 17:00:09 -08:00
Carl Shapiro
d55f0adfb5 Qualify the source argument of atomic loads as a const pointer.
Also normalizes the opening brace placment in a few locations.

Change-Id: I8f518e933094337d5d3371321326ffc03b3a5f5a
2010-09-28 14:06:00 -07:00
Jesse Wilson
7ab237f1ef Including dl heap stubs for the dalvikvm host build
Change-Id: I9d0ce98d433f71db25c58bf464ec9317552cfae6
2010-08-18 21:23:13 -07:00
Brian Carlstrom
f2af88e81a Tracking merge of dalvik-dev to gingerbread
git cherry-pick --no-commit b99a099c
git cherry-pick --no-commit 9811671e02
git cherry-pick --no-commit d0645bf0cc

Change-Id: Ie70fecaeaba97a25f114cd2717e381b5107533b1
2010-08-04 15:45:52 -07:00
Carl Shapiro
93b0cb40c1 Define inline atomic operations for x86 and ARM.
This change moves the ARM definitions into GCC extended inline
assembler.  In addition, the same set of x86 definitions are now
shared among all x86 targets.

Change-Id: I6e5aa3a413d0af2acbe5d32994983d35a01fdcb3
2010-06-23 12:51:26 -07:00
Andy McFadden
8dfa47da8c Atomic/SMP update, part 2.
Added new atomic functions, renamed some old ones.  Some #defines have
been added for backward compatibility.

Merged the pre- and post-ARMv6 implementations into a single file.

Renamed the semi-private __android_membar_full_smp to USE_SCREAMING_CAPS
since that's more appropriate for a macro.

Added lots of comments.

Note Mac OS X primitives have not been tested.

Change-Id: If827260750aeb61ad5c2b760e30658e29dbb26f2
2010-05-27 15:29:38 -07:00
Andy McFadden
ac322da69e Atomic/SMP update.
Added atomic-inline.h.  Added a platform-specific memory barrier call
there.

Added android_atomic_acquire_cmpxchg() and android_atomic_release_store().
Not tested on Mac OS X or SH.

Added memory barrier calls to linux-x86 atomics.  Mac OS X has barrier
functions already.  sh isn't really SMP-ready.  linux-arm needs work
(to be done in a separate change).

Updated the makefile to make the SMP state visible to the code here.
Note that host binaries are NOT built with SMP enabled; while our hosts
are very likely SMP, it's not worth figuring out e.g. whether it's okay
to use the SSE2 mfence instruction or have to use something else.  We
haven't had barriers enabled in host tools before, so there's probably
no need to stat now.

Removed quasiatomic 64-bit calls (now part of Dalvik).

Change-Id: I49e5e6c8abe70f304cdedb9d7b8e6e65f8925815
2010-05-20 21:40:33 -07:00