RetroArch
Functions
atomic.h File Reference
#include <wiiu/types.h>
Include dependency graph for atomic.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

uint8_t SwapAtomic8 (uint8_t *ptr, uint8_t value)
 
uint16_t SwapAtomic16 (uint16_t *ptr, uint16_t value)
 
uint32_t SwapAtomic32 (uint32_t *ptr, uint32_t value)
 

Function Documentation

◆ SwapAtomic16()

uint16_t SwapAtomic16 ( uint16_t ptr,
uint16_t  value 
)

◆ SwapAtomic32()

uint32_t SwapAtomic32 ( uint32_t ptr,
uint32_t  value 
)
Here is the caller graph for this function:

◆ SwapAtomic8()

uint8_t SwapAtomic8 ( uint8_t ptr,
uint8_t  value 
)

Performs an atomic swap of a single piece of data. In each function, value is written to ptr, and the previous value is returned.

From GCC docs:

"This builtin is not a full barrier, but rather a release barrier. This means that references after the builtin cannot move to (or be speculated to) before the builtin, but previous memory stores may not be globally visible yet, and previous memory loads may not yet be satisfied."

https://gcc.gnu.org/onlinedocs/gcc-4.5.0/gcc/Atomic-Builtins.html

This builtin seems to be implemented in the Wii U GCC toolchain. But since this is GCC-specific, I'm not going to put it into a more general-use location.