coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
atomic.h File Reference

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...
 
#define atomic_inc(v)   (((v)->counter)++)
 atomic_inc - increment atomic variable More...
 
#define atomic_dec(v)   (((v)->counter)--)
 atomic_dec - decrement atomic variable More...
 

Macro Definition Documentation

◆ atomic_dec

#define atomic_dec (   v)    (((v)->counter)--)

atomic_dec - decrement atomic variable

Parameters
vpointer 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 50 of file atomic.h.

◆ atomic_inc

#define atomic_inc (   v)    (((v)->counter)++)

atomic_inc - increment atomic variable

Parameters
vpointer 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 41 of file atomic.h.

◆ ATOMIC_INIT

#define ATOMIC_INIT (   i)    { (i) }

Definition at line 9 of file atomic.h.

◆ atomic_read

#define atomic_read (   v)    ((v)->counter)

atomic_read - read atomic variable

Parameters
vpointer of type atomic_t

Atomically reads the value of v. Note that the guaranteed useful range of an atomic_t is only 24 bits.

Definition at line 22 of file atomic.h.

◆ atomic_set

#define atomic_set (   v,
 
)    (((v)->counter) = (i))

atomic_set - set atomic variable

Parameters
vpointer of type atomic_t
irequired value

Atomically sets the value of v to i. Note that the guaranteed useful range of an atomic_t is only 24 bits.

Definition at line 32 of file atomic.h.