Loading [MathJax]/extensions/tex2jax.js
CS350 COS
COS
All Data Structures Files Functions Variables Typedefs Macros
atomic.h File Reference

Go to the source code of this file.

Functions

static INLINE uint64_t atomic_swap_uint32 (volatile uint32_t *dst, uint32_t newval)
 
static INLINE uint64_t atomic_swap_uint64 (volatile uint64_t *dst, uint64_t newval)
 
static void atomic_set_uint64 (volatile uint64_t *dst, uint64_t newval)
 

Function Documentation

◆ atomic_set_uint64()

static void atomic_set_uint64 ( volatile uint64_t dst,
uint64_t  newval 
)
inlinestatic

Definition at line 24 of file atomic.h.

25{
26 *dst = newval;
27}
Here is the caller graph for this function:

◆ atomic_swap_uint32()

static INLINE uint64_t atomic_swap_uint32 ( volatile uint32_t dst,
uint32_t  newval 
)
static

Definition at line 6 of file atomic.h.

7{
8 asm volatile("lock; xchgl %0, %1;"
9 : "+m" (*dst), "+r" (newval));
10
11 return newval;
12}

◆ atomic_swap_uint64()

static INLINE uint64_t atomic_swap_uint64 ( volatile uint64_t dst,
uint64_t  newval 
)
static

Definition at line 15 of file atomic.h.

16{
17 asm volatile("lock; xchgq %0, %1;"
18 : "+m" (*dst), "+r" (newval));
19
20 return newval;
21}
Here is the caller graph for this function: