OSAddAtomic

Syntax

#include <cafe/os.h>

s32 OSAddAtomic(volatile OSAtomicVar* ptr, s32 val);

Parameters

ptr Pointer to data to add or subtract atomically.
val Signed value to add atomically to the value in memory.

Return Values

Previous value.

Description

OSAddAtomic performs an atomic addition with a value in memory. This is useful if the value needs to be atomically manipulated by multiple processors.

It does not act as a memory barrier.

Do Not Call From

None.

See Also

OSAndAtomic
OSCompareAndSwapAtomic
OSCompareAndSwapAtomicEx
OSDecAtomic
OSIncAtomic
OSOrAtomic
OSSwapAtomic
OSTestAndClearAtomic
OSTestAndSetAtomic
OSXorAtomic

Revision History

2013-05-08 Automated cleanup pass.
2012-07-25 Cleanup Pass
2012-05-04 Match actual prototype.
2010-08-30 Initial version.


CONFIDENTIAL