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
Merge commit 'df2f5a07aecac7be4ac2d1100668a0396fd256e7'
* commit 'df2f5a07aecac7be4ac2d1100668a0396fd256e7':
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
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