diff options
| author | Jason Sams <jsams@google.com> | 2014-03-03 18:15:47 -0800 |
|---|---|---|
| committer | Jason Sams <jsams@google.com> | 2014-03-04 16:14:34 -0800 |
| commit | 8e1f8dce2a9c36a0b9bb0dca278beabc3716e088 (patch) | |
| tree | e9fcf5c347540a33ac5276dec6da71076ace7819 /scriptc/rs_atomic.rsh | |
| parent | 69010219a51cd02eeab1229a4f09f61477df2dc2 (diff) | |
| download | android_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.rsh | 80 |
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 |
