1c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet# 2c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet# Copyright (C) 2015 The Android Open Source Project 3c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet# 4c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet# Licensed under the Apache License, Version 2.0 (the "License"); 5c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet# you may not use this file except in compliance with the License. 6c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet# You may obtain a copy of the License at 7c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet# 8c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet# http://www.apache.org/licenses/LICENSE-2.0 9c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet# 10c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet# Unless required by applicable law or agreed to in writing, software 11c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet# distributed under the License is distributed on an "AS IS" BASIS, 12c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet# See the License for the specific language governing permissions and 14c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet# limitations under the License. 15c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet# 16c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet 17c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletheader: 1820b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletsummary: Atomic Update Functions 19c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletdescription: 20c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet To update values shared between multiple threads, use the functions below. 21c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet They ensure that the values are atomically updated, i.e. that the memory 2220b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet reads, the updates, and the memory writes are done in the right order. 23c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet 2420b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet These functions are slower than their non-atomic equivalents, so use 25c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet them only when synchronization is needed. 26c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet 27c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet Note that in RenderScript, your code is likely to be running in separate 28c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet threads even though you did not explicitely create them. The RenderScript 29c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet runtime will very often split the execution of one kernel across multiple 30c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet threads. Updating globals should be done with atomic functions. If possible, 31c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet modify your algorithm to avoid them altogether. 32c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletend: 33c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet 34c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletfunction: rsAtomicAdd 35c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletversion: 14 3620b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletret: int32_t, "Value of *addr prior to the operation." 3720b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletarg: volatile int32_t* addr, "Address of the value to modify." 3820b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletarg: int32_t value, "Amount to add." 39c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletsummary: Thread-safe addition 40c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletdescription: 41c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet Atomicly adds a value to the value at addr, i.e. <code>*addr += value</code>. 42c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillettest: none 43c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletend: 44c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet 45c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletfunction: rsAtomicAdd 46c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletversion: 20 47c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletret: int32_t 48c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletarg: volatile uint32_t* addr 49c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletarg: uint32_t value 50c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillettest: none 51c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletend: 52c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet 53c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletfunction: rsAtomicAnd 54c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletversion: 14 5520b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletret: int32_t, "Value of *addr prior to the operation." 5620b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletarg: volatile int32_t* addr, "Address of the value to modify." 5720b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletarg: int32_t value, "Value to and with." 58c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletsummary: Thread-safe bitwise and 59c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletdescription: 60c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet Atomicly performs a bitwise and of two values, storing the result back at addr, 616386ceb3bf25e442513224aaa45691dfe49562d9Jean-Luc Brouillet i.e. <code>*addr &= value</code>. 62c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillettest: none 63c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletend: 64c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet 65c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletfunction: rsAtomicAnd 66c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletversion: 20 67c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletret: int32_t 68c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletarg: volatile uint32_t* addr 69c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletarg: uint32_t value 70c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillettest: none 71c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletend: 72c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet 73c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletfunction: rsAtomicCas 74c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletversion: 14 7520b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletret: int32_t, "Value of *addr prior to the operation." 766386ceb3bf25e442513224aaa45691dfe49562d9Jean-Luc Brouilletarg: volatile int32_t* addr, "Address of the value to compare and replace if the test passes." 776386ceb3bf25e442513224aaa45691dfe49562d9Jean-Luc Brouilletarg: int32_t compareValue, "Value to test *addr against." 786386ceb3bf25e442513224aaa45691dfe49562d9Jean-Luc Brouilletarg: int32_t newValue, "Value to write if the test passes." 79c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletsummary: Thread-safe compare and set 80c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletdescription: 81c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet If the value at addr matches compareValue then the newValue is written at addr, 8220b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet i.e. <code>if (*addr == compareValue) { *addr = newValue; }</code>. 83c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet 84c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet You can check that the value was written by checking that the value returned 8520b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet by rsAtomicCas() is compareValue. 86c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillettest: none 87c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletend: 88c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet 89c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletfunction: rsAtomicCas 90c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletversion: 14 91c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletret: uint32_t 92c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletarg: volatile uint32_t* addr 93c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletarg: uint32_t compareValue 94c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletarg: uint32_t newValue 95c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillettest: none 96c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletend: 97c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet 98c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletfunction: rsAtomicDec 99c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletversion: 14 10020b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletret: int32_t, "Value of *addr prior to the operation." 10120b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletarg: volatile int32_t* addr, "Address of the value to decrement." 102c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletsummary: Thread-safe decrement 103c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletdescription: 10420b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet Atomicly subtracts one from the value at addr. This is equivalent to <code>@rsAtomicSub(addr, 1)</code>. 105c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillettest: none 106c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletend: 107c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet 108c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletfunction: rsAtomicDec 109c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletversion: 20 110c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletret: int32_t 111c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletarg: volatile uint32_t* addr 112c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillettest: none 113c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletend: 114c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet 115c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletfunction: rsAtomicInc 116c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletversion: 14 11720b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletret: int32_t, "Value of *addr prior to the operation." 11820b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletarg: volatile int32_t* addr, "Address of the value to increment." 119c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletsummary: Thread-safe increment 120c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletdescription: 12120b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet Atomicly adds one to the value at addr. This is equivalent to <code>@rsAtomicAdd(addr, 1)</code>. 122c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillettest: none 123c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletend: 124c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet 125c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletfunction: rsAtomicInc 126c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletversion: 20 127c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletret: int32_t 128c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletarg: volatile uint32_t* addr 129c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillettest: none 130c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletend: 131c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet 132c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletfunction: rsAtomicMax 133c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletversion: 14 13420b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletret: uint32_t, "Value of *addr prior to the operation." 13520b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletarg: volatile uint32_t* addr, "Address of the value to modify." 13620b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletarg: uint32_t value, "Comparison value." 137c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletsummary: Thread-safe maximum 138c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletdescription: 13920b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet Atomicly sets the value at addr to the maximum of *addr and value, i.e. 14020b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet <code>*addr = max(*addr, value)</code>. 141c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillettest: none 142c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletend: 143c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet 144c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletfunction: rsAtomicMax 145c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletversion: 14 146c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletret: int32_t 147c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletarg: volatile int32_t* addr 148c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletarg: int32_t value 149c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillettest: none 150c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletend: 151c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet 152c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletfunction: rsAtomicMin 153c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletversion: 14 15420b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletret: uint32_t, "Value of *addr prior to the operation." 15520b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletarg: volatile uint32_t* addr, "Address of the value to modify." 15620b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletarg: uint32_t value, "Comparison value." 157c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletsummary: Thread-safe minimum 158c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletdescription: 15920b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet Atomicly sets the value at addr to the minimum of *addr and value, i.e. 16020b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet <code>*addr = min(*addr, value)</code>. 161c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillettest: none 162c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletend: 163c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet 164c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletfunction: rsAtomicMin 165c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletversion: 14 166c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletret: int32_t 167c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletarg: volatile int32_t* addr 168c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletarg: int32_t value 169c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillettest: none 170c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletend: 171c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet 172c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletfunction: rsAtomicOr 173c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletversion: 14 17420b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletret: int32_t, "Value of *addr prior to the operation." 17520b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletarg: volatile int32_t* addr, "Address of the value to modify." 17620b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletarg: int32_t value, "Value to or with." 177c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletsummary: Thread-safe bitwise or 178c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletdescription: 179c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet Atomicly perform a bitwise or two values, storing the result at addr, 18020b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet i.e. <code>*addr |= value</code>. 181c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillettest: none 182c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletend: 183c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet 184c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletfunction: rsAtomicOr 185c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletversion: 20 186c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletret: int32_t 187c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletarg: volatile uint32_t* addr 188c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletarg: uint32_t value 189c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillettest: none 190c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletend: 191c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet 192c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletfunction: rsAtomicSub 193c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletversion: 14 19420b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletret: int32_t, "Value of *addr prior to the operation." 19520b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletarg: volatile int32_t* addr, "Address of the value to modify." 19620b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletarg: int32_t value, "Amount to subtract." 197c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletsummary: Thread-safe subtraction 198c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletdescription: 19920b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet Atomicly subtracts a value from the value at addr, i.e. <code>*addr -= value</code>. 200c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillettest: none 201c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletend: 202c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet 203c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletfunction: rsAtomicSub 204c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletversion: 20 205c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletret: int32_t 206c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletarg: volatile uint32_t* addr 207c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletarg: uint32_t value 208c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillettest: none 209c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletend: 210c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet 211c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletfunction: rsAtomicXor 212c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletversion: 14 21320b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletret: int32_t, "Value of *addr prior to the operation." 21420b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletarg: volatile int32_t* addr, "Address of the value to modify." 21520b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouilletarg: int32_t value, "Value to xor with." 216c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletsummary: Thread-safe bitwise exclusive or 217c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletdescription: 218c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet Atomicly performs a bitwise xor of two values, storing the result at addr, 21920b27d602a4778ed50a83df2147416a35b7c92beJean-Luc Brouillet i.e. <code>*addr ^= value</code>. 220c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillettest: none 221c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletend: 222c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillet 223c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletfunction: rsAtomicXor 224c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletversion: 20 225c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletret: int32_t 226c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletarg: volatile uint32_t* addr 227c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletarg: uint32_t value 228c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouillettest: none 229c5184e202ced435258adb2cfe2013570e7190954Jean-Luc Brouilletend: 230