Commit graph

60 commits

Author SHA1 Message Date
Andy McFadden
2bf937e6bb Use DMB ST for store fence.
Change-Id: Ic713f30fcec0f2d2eb486c549917575ff0afa82f
2010-10-01 11:29:48 -07:00
Carl Shapiro
a417657880 am df2f5a07: am d55f0adf: Qualify the source argument of atomic loads as a const pointer.
Merge commit 'df2f5a07aecac7be4ac2d1100668a0396fd256e7'

* commit 'df2f5a07aecac7be4ac2d1100668a0396fd256e7':
  Qualify the source argument of atomic loads as a const pointer.
2010-09-28 17:38:03 -07:00
Carl Shapiro
df2f5a07ae am d55f0adf: 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.
2010-09-28 14:20:54 -07: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
Brian Carlstrom
464431e65f Add definitions for store barrier.
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
2010-09-24 10:56:43 -07:00
Brian Carlstrom
3c659a8d64 am f2af88e8: Tracking merge of dalvik-dev to gingerbread
Merge commit 'f2af88e81af5efb2d585963507f798d5a8b93d67' into gingerbread-plus-aosp

* commit 'f2af88e81af5efb2d585963507f798d5a8b93d67':
  Tracking merge of dalvik-dev to gingerbread
2010-08-05 10:39:18 -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
The Android Open Source Project
4e246965bb am 64ba76c1: merge from open-source master
Merge commit '64ba76c1431afe17c1f4553f1dbc595db064316e'

* commit '64ba76c1431afe17c1f4553f1dbc595db064316e':
  Fixed LOG_ASSERT() compilation errors in native debug builds.
2010-07-16 13:34:53 -07:00
The Android Open Source Project
64ba76c143 merge from open-source master
Change-Id: I612711a84996e22e826e4920be29c204cf5d7d44
2010-07-16 13:32:03 -07:00
Chris Pearson
1929990434 Fixed LOG_ASSERT() compilation errors in native debug builds.
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>
2010-07-16 07:56:03 -07:00
Andy McFadden
9f6d28dc45 Fix sim-eng build.
Include <stddef.h> to get definition of size_t.  Remove inclusion
of <stdint.h>, which doesn't seem to be needed.

Change-Id: Ib7ff231b5ec4b8c672084801fbb294a50cb7c3d7
2010-06-30 22:20:49 -07:00
Carl Shapiro
a3405403a0 Remove an obsolete compatibility macro.
Change-Id: Ibeae0986b6c68f40e414917405a31cc0ad810fc4
2010-06-30 16:49:08 -07:00
Carl Shapiro
3de5dba559 am 2c4676de: am 93b0cb40: Define inline atomic operations for x86 and ARM.
Merge commit '2c4676de62cf8ca7e3759f7f709e29c623495f55'

* commit '2c4676de62cf8ca7e3759f7f709e29c623495f55':
  Define inline atomic operations for x86 and ARM.
2010-06-23 14:30:38 -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
f4dd883389 Fix build.
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
2010-06-01 09:55:18 -07:00
Andy McFadden
8264358f5b am 8dfa47da: Atomic/SMP update, part 2. 2010-05-30 21:20:45 -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
62af8f2583 Atomic/SMP update. [manual merge to dalvik-dev]
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
2010-05-21 12:53:51 -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
Brian Carlstrom
a68049a8cc Merge remote branch 'goog/froyo' into mm 2010-04-06 15:31:23 -07:00
Joe Onorato
e2bf2ea4d2 Make logcat print both the main and system buffers by default. Make SLOGx macros work. 2010-03-01 13:03:19 -08:00
San Mehat
10d469bff9 system: Add support for getting/setting i/o priorities and include a userspace tool
Signed-off-by: San Mehat <san@google.com>
2010-02-25 14:02:55 -08:00
Carl Shapiro
b99a099cad Add a new method to export the extent of the break, akin to return
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.
2010-02-16 14:37:43 -08:00
Carl Shapiro
63b396d89c Eliminate the stdint.h include. In retrospect, it seems that the
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.
2010-02-12 15:53:31 -08:00
Carl Shapiro
143b370748 Include stddef.h to make the size_t visible. Resolves a simulator
build break caused by a use of ashmem.h in an environment without
size_t.
2010-02-12 12:45:28 -08:00
Barry Hayes
17128f6e43 Break out create_contiguous_mspace_with_base
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.
2010-02-09 10:23:25 -08:00
Barry Hayes
2dcf1fb9ff Merge "Break out create_contiguous_mspace_with_base 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." 2010-02-08 20:46:41 -08:00
Barry Hayes
b17772dcc8 Break out create_contiguous_mspace_with_base
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.
2010-01-26 13:35:20 -08:00
Andy McFadden
cf63d5d00f Implementation of open_memstream().
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.
2010-01-25 15:06:03 -08:00
San Mehat
5f64815d8a am 38b2ddc4: am 17bfbd3c: am c0dfca7a: cutils: Add support for reading a processes scheduler policy
Merge commit '38b2ddc4a7cf1c47397af118a6d466d45f59da04'

* commit '38b2ddc4a7cf1c47397af118a6d466d45f59da04':
  cutils: Add support for reading a processes scheduler policy
2009-10-28 23:50:51 -07:00
San Mehat
c0dfca7ae1 cutils: Add support for reading a processes scheduler policy
Signed-off-by: San Mehat <san@google.com>
2009-10-27 12:27:42 -07:00
Elliott Hughes
67a2ea3dea Now all the callers are gone, remove adb_networking.*.
(This is the final patch removing adb networking.)

Bug: 1122968
2009-10-02 13:29:47 -07:00
San Mehat
493dad9663 libcutils: Add abstracted support for setting scheduler policies
Also changes the background policy to use SCHED_BATCH. IDLEPRIO
can cause 100% starvation.

Signed-off-by: San Mehat <san@google.com>
2009-09-12 10:48:03 -07:00
Mathias Agopian
af20325a45 Merge commit 'goog/master' into merge_master 2009-06-05 15:45:43 -07:00
Android (Google) Code Review
baf83e0250 am 3f627205: Merge change 2875 into donut
Merge commit '3f6272056275a00c30c07394d63bbe81cc9c5eba'

* commit '3f6272056275a00c30c07394d63bbe81cc9c5eba':
  Added ashmem_get_size_region() function.
2009-06-02 05:30:08 -07:00
Bjorn Bringert
7be52b1a0e Added ashmem_get_size_region() function.
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.
2009-06-02 00:55:30 +01:00
Mathias Agopian
e26cbeacaf Merge commit 'goog/master' into merge_master 2009-05-31 01:14:49 -07:00
David 'Digit' Turner
730c8d7c03 am ebefc48e: Expose the stable/frozen log-related definitions of <cutils/logd.h> into a new header: <android/log.h>
Merge commit 'ebefc48e61a7d5cf2a3228e6c8729feeeb42d1b4'

* commit 'ebefc48e61a7d5cf2a3228e6c8729feeeb42d1b4':
  Expose the stable/frozen log-related definitions of <cutils/logd.h> into a new header: <android/log.h>
2009-05-29 06:03:27 -07:00
David 'Digit' Turner
ebefc48e61 Expose the stable/frozen log-related definitions of <cutils/logd.h> into a new header: <android/log.h>
This is in order to expose the correponding functions in the 1.5 Native Development Kit, to allow
applicative native code to send messages to the log.
2009-05-29 14:45:04 +02:00
Mathias Agopian
67667115c5 merge master to master_gl 2009-05-22 01:08:01 -07:00
Mathias Agopian
d2362c2b20 am fee77ec0: don\'t use cdefs.h as it breaks the windows build.
Merge commit 'fee77ec093f78c1bb0ce85aa16d7ee8e8fa06f8a'

* commit 'fee77ec093f78c1bb0ce85aa16d7ee8e8fa06f8a':
  don't use cdefs.h as it breaks the windows build.
2009-05-21 13:11:11 -07:00
Mathias Agopian
fee77ec093 don't use cdefs.h as it breaks the windows build. 2009-05-21 13:08:39 -07:00
Mathias Agopian
3fc51ba17d move native_handle stuff from master_gl 2009-05-20 17:22:13 -07:00
Nick Pelly
92a7541bce Helper to perform abortable blocking operations on a socket:
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.
2009-05-20 15:20:30 -07:00
Mathias Agopian
8f13782e7b move native_handle stuff from master_gl 2009-05-20 14:51:48 -07:00
David 'Digit' Turner
34c22c5ba9 am 414ff7d9: 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 '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.
2009-05-18 08:37:02 -07:00
David 'Digit' Turner
414ff7d98a 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. 2009-05-18 17:07:46 +02:00
Eric Fischer
035b427c70 am 722a5c04: Add support for "standalone months" to tztime\'s strftime().
Merge commit '722a5c0462f38827f4097065bfc3826b9e0e9fb4'

* commit '722a5c0462f38827f4097065bfc3826b9e0e9fb4':
  Add support for "standalone months" to tztime's strftime().
2009-05-15 10:15:18 -07:00
Eric Fischer
722a5c0462 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.
2009-05-14 17:22:20 -07:00
Mathias Agopian
8cd81ab3f2 get rid of native_handle_{dup|copy} since they were not used any longer 2009-05-02 00:06:41 -07:00