summaryrefslogtreecommitdiffstats
path: root/scriptc/rs_atomic.rsh
diff options
context:
space:
mode:
authorJason Sams <jsams@google.com>2014-03-03 18:15:47 -0800
committerJason Sams <jsams@google.com>2014-03-04 16:14:34 -0800
commit8e1f8dce2a9c36a0b9bb0dca278beabc3716e088 (patch)
treee9fcf5c347540a33ac5276dec6da71076ace7819 /scriptc/rs_atomic.rsh
parent69010219a51cd02eeab1229a4f09f61477df2dc2 (diff)
downloadandroid_frameworks_rs-8e1f8dce2a9c36a0b9bb0dca278beabc3716e088.tar.gz
android_frameworks_rs-8e1f8dce2a9c36a0b9bb0dca278beabc3716e088.tar.bz2
android_frameworks_rs-8e1f8dce2a9c36a0b9bb0dca278beabc3716e088.zip
Add unsigned atomics
bug 11523997 Change-Id: If0527c3c6aa193f40b5f9c94c517781c56c66252
Diffstat (limited to 'scriptc/rs_atomic.rsh')
-rw-r--r--scriptc/rs_atomic.rsh80
1 files changed, 80 insertions, 0 deletions
diff --git a/scriptc/rs_atomic.rsh b/scriptc/rs_atomic.rsh
index 99a7353c..fef05bbf 100644
--- a/scriptc/rs_atomic.rsh
+++ b/scriptc/rs_atomic.rsh
@@ -177,5 +177,85 @@ extern uint32_t __attribute__((overloadable))
#endif //defined(RS_VERSION) && (RS_VERSION >= 14)
+#if (defined(RS_VERSION) && (RS_VERSION >= 21))
+
+/**
+ * Atomic add one to the value at addr.
+ * Equal to rsAtomicAdd(addr, 1)
+ *
+ * @param addr Address of value to increment
+ *
+ * @return old value
+ */
+extern int32_t __attribute__((overloadable))
+ rsAtomicInc(volatile uint32_t* addr);
+
+/**
+ * Atomic subtract one from the value at addr. Equal to rsAtomicSub(addr, 1)
+ *
+ * @param addr Address of value to decrement
+ *
+ * @return old value
+ */
+extern int32_t __attribute__((overloadable))
+ rsAtomicDec(volatile uint32_t* addr);
+
+/**
+ * Atomic add a value to the value at addr. addr[0] += value
+ *
+ * @param addr Address of value to modify
+ * @param value Amount to add to the value at addr
+ *
+ * @return old value
+ */
+extern int32_t __attribute__((overloadable))
+ rsAtomicAdd(volatile uint32_t* addr, uint32_t value);
+
+/**
+ * Atomic Subtract a value from the value at addr. addr[0] -= value
+ *
+ * @param addr Address of value to modify
+ * @param value Amount to subtract from the value at addr
+ *
+ * @return old value
+ */
+extern int32_t __attribute__((overloadable))
+ rsAtomicSub(volatile uint32_t* addr, uint32_t value);
+
+/**
+ * Atomic Bitwise and a value from the value at addr. addr[0] &= value
+ *
+ * @param addr Address of value to modify
+ * @param value Amount to and with the value at addr
+ *
+ * @return old value
+ */
+extern int32_t __attribute__((overloadable))
+ rsAtomicAnd(volatile uint32_t* addr, uint32_t value);
+
+/**
+ * Atomic Bitwise or a value from the value at addr. addr[0] |= value
+ *
+ * @param addr Address of value to modify
+ * @param value Amount to or with the value at addr
+ *
+ * @return old value
+ */
+extern int32_t __attribute__((overloadable))
+ rsAtomicOr(volatile uint32_t* addr, uint32_t value);
+
+/**
+ * Atomic Bitwise xor a value from the value at addr. addr[0] ^= value
+ *
+ * @param addr Address of value to modify
+ * @param value Amount to xor with the value at addr
+ *
+ * @return old value
+ */
+extern int32_t __attribute__((overloadable))
+ rsAtomicXor(volatile uint32_t* addr, uint32_t value);
+
+#endif //defined(RS_VERSION) && (RS_VERSION >= 21)
+
#endif