Atomic op cleanup.

Replaced VM-local macros for barrier and CAS calls with the actual
versions provided by cutils.

 ATOMIC_CMP_SWAP(addr,old,new) --> android_atomic_release_cas(old,new,addr)

 MEM_BARRIER --> ANDROID_MEMBAR_FULL

Renamed android_quasiatomic* to dvmQuasiAtomic*.

Didn't change how anything works, just the names.

Change-Id: I8c68f28e1f7c9cb832183e0918d097dfe6a2cac8
diff --git a/vm/oo/Array.c b/vm/oo/Array.c
index 94911b5..6e706ef 100644
--- a/vm/oo/Array.c
+++ b/vm/oo/Array.c
@@ -598,8 +598,8 @@
         ClassObject* primClass = createPrimitiveClass(idx);
         dvmReleaseTrackedAlloc((Object*) primClass, NULL);
 
-        if (!ATOMIC_CMP_SWAP((int*) &gDvm.primitiveClass[idx],
-            0, (int) primClass))
+        if (android_atomic_release_cas(0, (int) primClass,
+                (int*) &gDvm.primitiveClass[idx]) != 0)
         {
             /*
              * Looks like somebody beat us to it.  Free up the one we
diff --git a/vm/oo/Class.c b/vm/oo/Class.c
index db0ce7b..16cba12 100644
--- a/vm/oo/Class.c
+++ b/vm/oo/Class.c
@@ -1129,7 +1129,8 @@
     do {
         oldValue = gDvm.classSerialNumber;
         newValue = oldValue + 1;
-    } while (!ATOMIC_CMP_SWAP(&gDvm.classSerialNumber, oldValue, newValue));
+    } while (android_atomic_release_cas(oldValue, newValue,
+            &gDvm.classSerialNumber) != 0);
 
     clazz->serialNumber = (u4) oldValue;
 }
diff --git a/vm/oo/Object.h b/vm/oo/Object.h
index 4afc82c..92ec1d6 100644
--- a/vm/oo/Object.h
+++ b/vm/oo/Object.h
@@ -716,7 +716,7 @@
 }
 INLINE s8 dvmGetFieldLongVolatile(const Object* obj, int offset) {
     const s8* addr = BYTE_OFFSET(obj, offset);
-    return android_quasiatomic_read_64((s8*)addr);
+    return dvmQuasiAtomicRead64((s8*)addr);
 }
 
 INLINE void dvmSetFieldBoolean(Object* obj, int offset, bool val) {
@@ -748,7 +748,7 @@
 }
 INLINE void dvmSetFieldLongVolatile(Object* obj, int offset, s8 val) {
     s8* addr = BYTE_OFFSET(obj, offset);
-    android_quasiatomic_swap_64(val, addr);
+    dvmQuasiAtomicSwap64(val, addr);
 }
 
 /*
@@ -787,7 +787,7 @@
 }
 INLINE s8 dvmGetStaticFieldLongVolatile(const StaticField* sfield) {
     const s8* addr = &sfield->value.j;
-    return android_quasiatomic_read_64((s8*)addr);
+    return dvmQuasiAtomicRead64((s8*)addr);
 }
 
 INLINE void dvmSetStaticFieldBoolean(StaticField* sfield, bool val) {
@@ -819,7 +819,7 @@
 }
 INLINE void dvmSetStaticFieldLongVolatile(StaticField* sfield, s8 val) {
     s8* addr = &sfield->value.j;
-    android_quasiatomic_swap_64(val, addr);
+    dvmQuasiAtomicSwap64(val, addr);
 }
 
 /*