]> git.xonotic.org Git - xonotic/gmqcc.git/blob - thread.c
util_atomic_xadd32 - hmpf
[xonotic/gmqcc.git] / thread.c
1 #include "gmqcc.h"
2
3 GMQCC_INLINE uint32_t util_atomic_xadd32(volatile uint32_t *x, uint32_t v)
4 {
5     asm volatile (
6         "lock xaddl %1, %0"
7         : "+m"(*x), "=r"(v)
8         : "1"(v)
9         : "cc"
10     );
11     return v;
12 }