Merge commit 'df2f5a07aecac7be4ac2d1100668a0396fd256e7'
* commit 'df2f5a07aecac7be4ac2d1100668a0396fd256e7':
Qualify the source argument of atomic loads as a const pointer.
Merge commit 'd55f0adfb5ec4202ad5bd5d188e66c0f6a27b0aa' into gingerbread-plus-aosp
* commit 'd55f0adfb5ec4202ad5bd5d188e66c0f6a27b0aa':
Qualify the source argument of atomic loads as a const pointer.
I usually call this a "store/store barrier" for maximum clarity, but
the common way of describing it is "store barrier" or "store fence".
This doesn't use "dmb st" yet since we're waiting on the toolchain
update, but it gets the various macros and inline functions in place
so we can use them in the VM.
Bug 3003477
git cherry-pick 2ba5eec3972b4ce46feb677116534fcd3d136e0a
Change-Id: Ifd2d3588be96aa529d490789436cf48c962021ba
Merge commit 'f2af88e81af5efb2d585963507f798d5a8b93d67' into gingerbread-plus-aosp
* commit 'f2af88e81af5efb2d585963507f798d5a8b93d67':
Tracking merge of dalvik-dev to gingerbread
Invoking LOG_ASSERT, LOG_ALWAYS_FATAL or LOG_ALWAYS_FATAL_IF variadic macros
without the printf format string arg caused compilation errors because the
variable arg list (__VA_ARGS__) was eventually passed to
__android_log_assert() func in place of a required parameter. This error
only occured in debug builds because LOG_ASSERT() is a no-op in release
builds. This change allows debug builds to succeed.
Change-Id: I7e7b7de3e501133468ce083e0e0d6e699dd59667
Signed-off-by: Chris Pearson <christopherx.c.pearson@intel.com>
Include <stddef.h> to get definition of size_t. Remove inclusion
of <stdint.h>, which doesn't seem to be needed.
Change-Id: Ib7ff231b5ec4b8c672084801fbb294a50cb7c3d7
Merge commit '2c4676de62cf8ca7e3759f7f709e29c623495f55'
* commit '2c4676de62cf8ca7e3759f7f709e29c623495f55':
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
Missing a #define to map android_atomic_swap to its new name. Worked
fine in the other branches, because nobody was using android_atomic_swap
in the other branches.
Change-Id: I0e730e9823ac5cd2fee5a3f856ce05d36df5d87e
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
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: I42ae05f5db2cc9a5b64ad87f15481e2838371f1d
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
value of sbrk(0) in UNIX. In terms of dlmalloc and our proprietary
contiguous mspace class, this is the highest address returned by its
morecore method.
source of the aforementioned build breakage was then errant include of
this header when stddef.h was intended. Nothing in this file uses any
of the symbols exported from stdint.h, only symbols from stddef.h.
This routine allows creating a contiguous mspace from raw mapped memory.
In turn, this will enable preallocation of the 3 heap spaces, which will help
remembered sets and zygote/app checks given pointer values.
This routine allows creating a contiguous mspace from raw mapped memory.
In turn, this will enable preallocation of the 3 heap spaces, which will help
remembered sets and zygote/app checks given pointer values.
POSIX seems to have chosen open_memstream() over the BSD variant. We
want something for Dalvik that will work on both GNU/Linux and Android,
so this is open_memstream() implemented in terms of BSD funopen().
For Windows there's just a stub that calls abort().
I'm putting this in libcutils since it seems inappropriate for bionic
(which provides the BSD alternatives) but isn't Dalvik-specific.
Merge commit '38b2ddc4a7cf1c47397af118a6d466d45f59da04'
* commit '38b2ddc4a7cf1c47397af118a6d466d45f59da04':
cutils: Add support for reading a processes scheduler policy
This is needed by the MemoryFile changes in
https://android-git.corp.google.com/g/2714
where it is used to find out whether a file descriptor
refers to an ashmem region.
Merge commit 'ebefc48e61a7d5cf2a3228e6c8729feeeb42d1b4'
* commit 'ebefc48e61a7d5cf2a3228e6c8729feeeb42d1b4':
Expose the stable/frozen log-related definitions of <cutils/logd.h> into a new header: <android/log.h>
Merge commit 'fee77ec093f78c1bb0ce85aa16d7ee8e8fa06f8a'
* commit 'fee77ec093f78c1bb0ce85aa16d7ee8e8fa06f8a':
don't use cdefs.h as it breaks the windows build.
asocket_connect()
asocket_accept()
asocket_read()
asocket_write()
These calls are similar to the regular syscalls, but can be aborted with:
asocket_abort()
Calling close() on a regular POSIX socket does not abort blocked syscalls on
that socket in other threads.
After calling asocket_abort() the socket cannot be reused.
Call asocket_destory() *after* all threads have finished with the socket to
finish closing the socket and free the asocket structure.
The helper is implemented by setting the socket non-blocking to initiate
syscalls connect(), accept(), read(), write(), then using a blocking poll()
on both the primary socket and a local pipe. This makes the poll() abortable
by writing a byte to the local pipe in asocket_abort().
asocket_create() sets the fd to non-blocking mode. It must not be changed to
blocking mode.
Using asocket will triple the number of file descriptors required per
socket, due to the local pipe. It may be possible to use a global pipe per
process rather than per socket, but we have not been able to come up with a
race-free implementation yet.
All functions except asocket_init() and asocket_destroy() are thread safe.
Merge commit '414ff7d98ac8d7610a26206335954ad15f43f3ac'
* commit '414ff7d98ac8d7610a26206335954ad15f43f3ac':
Move fdevent from libcutils into adb directory. ADB is the only client of this API, and I intend to modify it extensively to clean its codebase soon.
Merge commit '722a5c0462f38827f4097065bfc3826b9e0e9fb4'
* commit '722a5c0462f38827f4097065bfc3826b9e0e9fb4':
Add support for "standalone months" to tztime's strftime().
The idea here is that some languages need a different form of the month
name in constructions like "January 2" than in "January 2009", since the
one in the "January 2" case really means "of January." So with this change,
a format string of "%-B" will use the standalone month, while "%B" will
continue to use the format month.