ATOMIC_LOAD_INT(9) Kernel Developer's Manual ATOMIC_LOAD_INT(9)

atomic_load_int, atomic_load_long, atomic_store_long, atomic_store_intatomic read and write memory operations

#include <sys/atomic.h>

unsigned int
atomic_load_int(volatile unsigned int *p);

unsigned long
atomic_load_long(volatile unsigned long *p);

void
atomic_store_int(volatile unsigned int *p, unsigned int v);

void
atomic_store_long(volatile unsigned long *p, unsigned long v);

The atomic_load and atomic_store set of functions provide an interface for atomically performing read or write memory operations with respect to interrupts and multiple processors in the system.

The atomic_store functions change the value referenced by the pointer p to the value v.

atomic_load_int(), atomic_load_long(), atomic_store_int(), and atomic_store_long() can all be called during autoconf, from process context, or from interrupt context.

atomic_load_int and atomic_load_long return the value at p.

atomic_add_int(9), atomic_add_long(9), atomic_sub_int(9), atomic_sub_long(9)

The atomic_load and atomic_store functions first appeared in OpenBSD 7.1.

March 10, 2022 OpenBSD 7.5