coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
Atomic operations that C can't guarantee us. More...
Go to the source code of this file.
Data Structures | |
struct | atomic_t |
Macros | |
#define | ATOMIC_INIT(i) { (i) } |
#define | atomic_read(v) ((v)->counter) |
atomic_read - read atomic variable More... | |
#define | atomic_set(v, i) (((v)->counter) = (i)) |
atomic_set - set atomic variable More... | |
Functions | |
static __always_inline void | atomic_inc (atomic_t *v) |
atomic_inc - increment atomic variable More... | |
static __always_inline void | atomic_dec (atomic_t *v) |
atomic_dec - decrement atomic variable More... | |
Atomic operations that C can't guarantee us.
Useful for resource counting etc..
Definition in file atomic.h.
#define atomic_read | ( | v | ) | ((v)->counter) |
#define atomic_set | ( | v, | |
i | |||
) | (((v)->counter) = (i)) |
|
static |
atomic_dec - decrement atomic variable
v | pointer of type atomic_t |
Atomically decrements v by 1. Note that the guaranteed useful range of an atomic_t is only 24 bits.
Definition at line 62 of file atomic.h.
References atomic_t::counter.
|
static |
atomic_inc - increment atomic variable
v | pointer of type atomic_t |
Atomically increments v by 1. Note that the guaranteed useful range of an atomic_t is only 24 bits.
Definition at line 47 of file atomic.h.
References atomic_t::counter.