My Project
Loading...
Searching...
No Matches
atomic.h File Reference
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include <stdatomic.h>
#include "../includes/annotations.h"

Go to the source code of this file.

Macros

#define ATOMIC_ORDER   __ATOMIC_SEQ_CST

Functions

FORCEINLINE int8_t InterlockedExchange8 (volatile int8_t *target, int8_t value)
FORCEINLINE int16_t InterlockedExchange16 (volatile int16_t *target, int16_t value)
FORCEINLINE int32_t InterlockedExchange32 (volatile int32_t *target, int32_t value)
FORCEINLINE int64_t InterlockedExchange64 (volatile int64_t *target, int64_t value)
FORCEINLINE uint8_t InterlockedExchangeU8 (volatile uint8_t *target, uint8_t value)
FORCEINLINE uint16_t InterlockedExchangeU16 (volatile uint16_t *target, uint16_t value)
FORCEINLINE uint32_t InterlockedExchangeU32 (volatile uint32_t *target, uint32_t value)
FORCEINLINE uint64_t InterlockedExchangeU64 (volatile uint64_t *target, uint64_t value)
FORCEINLINE void * InterlockedExchangePtr (volatile void *volatile *target, void *value)
FORCEINLINE int8_t InterlockedCompareExchange8 (volatile int8_t *target, int8_t value, int8_t comparand)
FORCEINLINE int16_t InterlockedCompareExchange16 (volatile int16_t *target, int16_t value, int16_t comparand)
FORCEINLINE int32_t InterlockedCompareExchange32 (volatile int32_t *target, int32_t value, int32_t comparand)
FORCEINLINE int64_t InterlockedCompareExchange64 (volatile int64_t *target, int64_t value, int64_t comparand)
FORCEINLINE uint8_t InterlockedCompareExchangeU8 (volatile uint8_t *target, uint8_t value, uint8_t comparand)
FORCEINLINE uint16_t InterlockedCompareExchangeU16 (volatile uint16_t *target, uint16_t value, uint16_t comparand)
FORCEINLINE uint32_t InterlockedCompareExchangeU32 (volatile uint32_t *target, uint32_t value, uint32_t comparand)
FORCEINLINE uint64_t InterlockedCompareExchangeU64 (volatile uint64_t *target, uint64_t value, uint64_t comparand)
FORCEINLINE void * InterlockedCompareExchangePtr (volatile void *volatile *target, void *value, void *comparand)
FORCEINLINE int8_t InterlockedAdd8 (volatile int8_t *target, int8_t value)
FORCEINLINE int16_t InterlockedAdd16 (volatile int16_t *target, int16_t value)
FORCEINLINE int32_t InterlockedAdd32 (volatile int32_t *target, int32_t value)
FORCEINLINE int64_t InterlockedAdd64 (volatile int64_t *target, int64_t value)
FORCEINLINE uint8_t InterlockedAddU8 (volatile uint8_t *target, uint8_t value)
FORCEINLINE uint16_t InterlockedAddU16 (volatile uint16_t *target, uint16_t value)
FORCEINLINE uint32_t InterlockedAddU32 (volatile uint32_t *target, uint32_t value)
FORCEINLINE uint64_t InterlockedAddU64 (volatile uint64_t *target, uint64_t value)
FORCEINLINE int32_t InterlockedIncrement32 (volatile int32_t *target)
FORCEINLINE int32_t InterlockedDecrement32 (volatile int32_t *target)
FORCEINLINE uint32_t InterlockedIncrementU32 (volatile uint32_t *target)
FORCEINLINE uint32_t InterlockedDecrementU32 (volatile uint32_t *target)
FORCEINLINE int64_t InterlockedIncrement64 (volatile int64_t *target)
FORCEINLINE uint64_t InterlockedIncrementU64 (volatile uint64_t *target)
FORCEINLINE int64_t InterlockedDecrement64 (volatile int64_t *target)
FORCEINLINE uint64_t InterlockedDecrementU64 (volatile uint64_t *target)
FORCEINLINE int8_t InterlockedAnd8 (volatile int8_t *target, int8_t value)
FORCEINLINE int16_t InterlockedAnd16 (volatile int16_t *target, int16_t value)
FORCEINLINE int32_t InterlockedAnd32 (volatile int32_t *target, int32_t value)
FORCEINLINE int64_t InterlockedAnd64 (volatile int64_t *target, int64_t value)
FORCEINLINE uint8_t InterlockedAndU8 (volatile uint8_t *target, uint8_t value)
FORCEINLINE uint16_t InterlockedAndU16 (volatile uint16_t *target, uint16_t value)
FORCEINLINE uint32_t InterlockedAndU32 (volatile uint32_t *target, uint32_t value)
FORCEINLINE uint64_t InterlockedAndU64 (volatile uint64_t *target, uint64_t value)
FORCEINLINE int8_t InterlockedOr8 (volatile int8_t *target, int8_t value)
FORCEINLINE int16_t InterlockedOr16 (volatile int16_t *target, int16_t value)
FORCEINLINE int32_t InterlockedOr32 (volatile int32_t *target, int32_t value)
FORCEINLINE int64_t InterlockedOr64 (volatile int64_t *target, int64_t value)
FORCEINLINE uint8_t InterlockedOrU8 (volatile uint8_t *target, uint8_t value)
FORCEINLINE uint16_t InterlockedOrU16 (volatile uint16_t *target, uint16_t value)
FORCEINLINE uint32_t InterlockedOrU32 (volatile uint32_t *target, uint32_t value)
FORCEINLINE uint64_t InterlockedOrU64 (volatile uint64_t *target, uint64_t value)
FORCEINLINE uintptr_t InterlockedExchangeUintptr (volatile uintptr_t *target, uintptr_t value)
FORCEINLINE uintptr_t InterlockedCompareExchangeUintptr (volatile uintptr_t *target, uintptr_t value, uintptr_t comparand)
FORCEINLINE uintptr_t InterlockedFetchAndUintptr (volatile uintptr_t *target, uintptr_t value)
FORCEINLINE uintptr_t InterlockedFetchOrUintptr (volatile uintptr_t *target, uintptr_t value)
FORCEINLINE bool InterlockedExchangeBool (volatile bool *target, bool value)
FORCEINLINE void * InterlockedExchangePointer (volatile void *volatile *target, void *value)
FORCEINLINE void * InterlockedCompareExchangePointer (volatile void *volatile *target, void *value, void *comparand)
FORCEINLINE void * InterlockedFetchPointer (volatile void *volatile *target)
FORCEINLINE uint32_t InterlockedSetMaskU32 (volatile uint32_t *target, uint32_t mask)
FORCEINLINE uint32_t InterlockedClearMaskU32 (volatile uint32_t *target, uint32_t mask)
FORCEINLINE int32_t AtomicLoad32 (volatile int32_t *target)
FORCEINLINE void AtomicStore32 (volatile int32_t *target, int32_t v)
FORCEINLINE uint32_t AtomicLoadU32 (volatile uint32_t *target)
FORCEINLINE void AtomicStoreU32 (volatile uint32_t *target, uint32_t v)
FORCEINLINE int8_t InterlockedFetch8 (volatile int8_t *target)
FORCEINLINE int16_t InterlockedFetch16 (volatile int16_t *target)
FORCEINLINE int32_t InterlockedFetch32 (volatile int32_t *target)
FORCEINLINE int64_t InterlockedFetch64 (volatile int64_t *target)
FORCEINLINE uint8_t InterlockedFetchU8 (volatile uint8_t *target)
FORCEINLINE uint16_t InterlockedFetchU16 (volatile uint16_t *target)
FORCEINLINE uint32_t InterlockedFetchU32 (volatile uint32_t *target)
FORCEINLINE uint64_t InterlockedFetchU64 (volatile uint64_t *target)

Macro Definition Documentation

◆ ATOMIC_ORDER

#define ATOMIC_ORDER   __ATOMIC_SEQ_CST

Definition at line 31 of file atomic.h.

Function Documentation

◆ AtomicLoad32()

FORCEINLINE int32_t AtomicLoad32 ( volatile int32_t * target)

Definition at line 191 of file atomic.h.

◆ AtomicLoadU32()

FORCEINLINE uint32_t AtomicLoadU32 ( volatile uint32_t * target)

Definition at line 197 of file atomic.h.

◆ AtomicStore32()

FORCEINLINE void AtomicStore32 ( volatile int32_t * target,
int32_t v )

Definition at line 194 of file atomic.h.

◆ AtomicStoreU32()

FORCEINLINE void AtomicStoreU32 ( volatile uint32_t * target,
uint32_t v )

Definition at line 200 of file atomic.h.

◆ InterlockedAdd16()

FORCEINLINE int16_t InterlockedAdd16 ( volatile int16_t * target,
int16_t value )

Definition at line 103 of file atomic.h.

◆ InterlockedAdd32()

FORCEINLINE int32_t InterlockedAdd32 ( volatile int32_t * target,
int32_t value )

Definition at line 104 of file atomic.h.

◆ InterlockedAdd64()

FORCEINLINE int64_t InterlockedAdd64 ( volatile int64_t * target,
int64_t value )

Definition at line 105 of file atomic.h.

◆ InterlockedAdd8()

FORCEINLINE int8_t InterlockedAdd8 ( volatile int8_t * target,
int8_t value )

Definition at line 102 of file atomic.h.

◆ InterlockedAddU16()

FORCEINLINE uint16_t InterlockedAddU16 ( volatile uint16_t * target,
uint16_t value )

Definition at line 108 of file atomic.h.

◆ InterlockedAddU32()

FORCEINLINE uint32_t InterlockedAddU32 ( volatile uint32_t * target,
uint32_t value )

Definition at line 109 of file atomic.h.

◆ InterlockedAddU64()

FORCEINLINE uint64_t InterlockedAddU64 ( volatile uint64_t * target,
uint64_t value )

Definition at line 110 of file atomic.h.

◆ InterlockedAddU8()

FORCEINLINE uint8_t InterlockedAddU8 ( volatile uint8_t * target,
uint8_t value )

Definition at line 107 of file atomic.h.

◆ InterlockedAnd16()

FORCEINLINE int16_t InterlockedAnd16 ( volatile int16_t * target,
int16_t value )

Definition at line 127 of file atomic.h.

◆ InterlockedAnd32()

FORCEINLINE int32_t InterlockedAnd32 ( volatile int32_t * target,
int32_t value )

Definition at line 128 of file atomic.h.

◆ InterlockedAnd64()

FORCEINLINE int64_t InterlockedAnd64 ( volatile int64_t * target,
int64_t value )

Definition at line 129 of file atomic.h.

◆ InterlockedAnd8()

FORCEINLINE int8_t InterlockedAnd8 ( volatile int8_t * target,
int8_t value )

Definition at line 126 of file atomic.h.

◆ InterlockedAndU16()

FORCEINLINE uint16_t InterlockedAndU16 ( volatile uint16_t * target,
uint16_t value )

Definition at line 132 of file atomic.h.

◆ InterlockedAndU32()

FORCEINLINE uint32_t InterlockedAndU32 ( volatile uint32_t * target,
uint32_t value )

Definition at line 133 of file atomic.h.

◆ InterlockedAndU64()

FORCEINLINE uint64_t InterlockedAndU64 ( volatile uint64_t * target,
uint64_t value )

Definition at line 134 of file atomic.h.

◆ InterlockedAndU8()

FORCEINLINE uint8_t InterlockedAndU8 ( volatile uint8_t * target,
uint8_t value )

Definition at line 131 of file atomic.h.

◆ InterlockedClearMaskU32()

FORCEINLINE uint32_t InterlockedClearMaskU32 ( volatile uint32_t * target,
uint32_t mask )

Definition at line 184 of file atomic.h.

◆ InterlockedCompareExchange16()

FORCEINLINE int16_t InterlockedCompareExchange16 ( volatile int16_t * target,
int16_t value,
int16_t comparand )

Definition at line 55 of file atomic.h.

◆ InterlockedCompareExchange32()

FORCEINLINE int32_t InterlockedCompareExchange32 ( volatile int32_t * target,
int32_t value,
int32_t comparand )

Definition at line 60 of file atomic.h.

◆ InterlockedCompareExchange64()

FORCEINLINE int64_t InterlockedCompareExchange64 ( volatile int64_t * target,
int64_t value,
int64_t comparand )

Definition at line 65 of file atomic.h.

◆ InterlockedCompareExchange8()

FORCEINLINE int8_t InterlockedCompareExchange8 ( volatile int8_t * target,
int8_t value,
int8_t comparand )

Definition at line 50 of file atomic.h.

◆ InterlockedCompareExchangePointer()

FORCEINLINE void * InterlockedCompareExchangePointer ( volatile void *volatile * target,
void * value,
void * comparand )

Definition at line 171 of file atomic.h.

◆ InterlockedCompareExchangePtr()

FORCEINLINE void * InterlockedCompareExchangePtr ( volatile void *volatile * target,
void * value,
void * comparand )

Definition at line 93 of file atomic.h.

◆ InterlockedCompareExchangeU16()

FORCEINLINE uint16_t InterlockedCompareExchangeU16 ( volatile uint16_t * target,
uint16_t value,
uint16_t comparand )

Definition at line 76 of file atomic.h.

◆ InterlockedCompareExchangeU32()

FORCEINLINE uint32_t InterlockedCompareExchangeU32 ( volatile uint32_t * target,
uint32_t value,
uint32_t comparand )

Definition at line 81 of file atomic.h.

◆ InterlockedCompareExchangeU64()

FORCEINLINE uint64_t InterlockedCompareExchangeU64 ( volatile uint64_t * target,
uint64_t value,
uint64_t comparand )

Definition at line 86 of file atomic.h.

◆ InterlockedCompareExchangeU8()

FORCEINLINE uint8_t InterlockedCompareExchangeU8 ( volatile uint8_t * target,
uint8_t value,
uint8_t comparand )

Definition at line 71 of file atomic.h.

◆ InterlockedCompareExchangeUintptr()

FORCEINLINE uintptr_t InterlockedCompareExchangeUintptr ( volatile uintptr_t * target,
uintptr_t value,
uintptr_t comparand )

Definition at line 152 of file atomic.h.

◆ InterlockedDecrement32()

FORCEINLINE int32_t InterlockedDecrement32 ( volatile int32_t * target)

Definition at line 114 of file atomic.h.

◆ InterlockedDecrement64()

FORCEINLINE int64_t InterlockedDecrement64 ( volatile int64_t * target)

Definition at line 121 of file atomic.h.

◆ InterlockedDecrementU32()

FORCEINLINE uint32_t InterlockedDecrementU32 ( volatile uint32_t * target)

Definition at line 116 of file atomic.h.

◆ InterlockedDecrementU64()

FORCEINLINE uint64_t InterlockedDecrementU64 ( volatile uint64_t * target)

Definition at line 122 of file atomic.h.

◆ InterlockedExchange16()

FORCEINLINE int16_t InterlockedExchange16 ( volatile int16_t * target,
int16_t value )

Definition at line 35 of file atomic.h.

◆ InterlockedExchange32()

FORCEINLINE int32_t InterlockedExchange32 ( volatile int32_t * target,
int32_t value )

Definition at line 36 of file atomic.h.

◆ InterlockedExchange64()

FORCEINLINE int64_t InterlockedExchange64 ( volatile int64_t * target,
int64_t value )

Definition at line 37 of file atomic.h.

◆ InterlockedExchange8()

FORCEINLINE int8_t InterlockedExchange8 ( volatile int8_t * target,
int8_t value )

Definition at line 34 of file atomic.h.

◆ InterlockedExchangeBool()

FORCEINLINE bool InterlockedExchangeBool ( volatile bool * target,
bool value )

Definition at line 165 of file atomic.h.

◆ InterlockedExchangePointer()

FORCEINLINE void * InterlockedExchangePointer ( volatile void *volatile * target,
void * value )

Definition at line 170 of file atomic.h.

◆ InterlockedExchangePtr()

FORCEINLINE void * InterlockedExchangePtr ( volatile void *volatile * target,
void * value )

Definition at line 45 of file atomic.h.

◆ InterlockedExchangeU16()

FORCEINLINE uint16_t InterlockedExchangeU16 ( volatile uint16_t * target,
uint16_t value )

Definition at line 40 of file atomic.h.

◆ InterlockedExchangeU32()

FORCEINLINE uint32_t InterlockedExchangeU32 ( volatile uint32_t * target,
uint32_t value )

Definition at line 41 of file atomic.h.

◆ InterlockedExchangeU64()

FORCEINLINE uint64_t InterlockedExchangeU64 ( volatile uint64_t * target,
uint64_t value )

Definition at line 42 of file atomic.h.

◆ InterlockedExchangeU8()

FORCEINLINE uint8_t InterlockedExchangeU8 ( volatile uint8_t * target,
uint8_t value )

Definition at line 39 of file atomic.h.

◆ InterlockedExchangeUintptr()

FORCEINLINE uintptr_t InterlockedExchangeUintptr ( volatile uintptr_t * target,
uintptr_t value )

Definition at line 149 of file atomic.h.

◆ InterlockedFetch16()

FORCEINLINE int16_t InterlockedFetch16 ( volatile int16_t * target)

Definition at line 206 of file atomic.h.

◆ InterlockedFetch32()

FORCEINLINE int32_t InterlockedFetch32 ( volatile int32_t * target)

Definition at line 207 of file atomic.h.

◆ InterlockedFetch64()

FORCEINLINE int64_t InterlockedFetch64 ( volatile int64_t * target)

Definition at line 208 of file atomic.h.

◆ InterlockedFetch8()

FORCEINLINE int8_t InterlockedFetch8 ( volatile int8_t * target)

Definition at line 205 of file atomic.h.

◆ InterlockedFetchAndUintptr()

FORCEINLINE uintptr_t InterlockedFetchAndUintptr ( volatile uintptr_t * target,
uintptr_t value )

Definition at line 157 of file atomic.h.

◆ InterlockedFetchOrUintptr()

FORCEINLINE uintptr_t InterlockedFetchOrUintptr ( volatile uintptr_t * target,
uintptr_t value )

Definition at line 160 of file atomic.h.

◆ InterlockedFetchPointer()

FORCEINLINE void * InterlockedFetchPointer ( volatile void *volatile * target)

Definition at line 172 of file atomic.h.

◆ InterlockedFetchU16()

FORCEINLINE uint16_t InterlockedFetchU16 ( volatile uint16_t * target)

Definition at line 211 of file atomic.h.

◆ InterlockedFetchU32()

FORCEINLINE uint32_t InterlockedFetchU32 ( volatile uint32_t * target)

Definition at line 212 of file atomic.h.

◆ InterlockedFetchU64()

FORCEINLINE uint64_t InterlockedFetchU64 ( volatile uint64_t * target)

Definition at line 213 of file atomic.h.

◆ InterlockedFetchU8()

FORCEINLINE uint8_t InterlockedFetchU8 ( volatile uint8_t * target)

Definition at line 210 of file atomic.h.

◆ InterlockedIncrement32()

FORCEINLINE int32_t InterlockedIncrement32 ( volatile int32_t * target)

Definition at line 113 of file atomic.h.

◆ InterlockedIncrement64()

FORCEINLINE int64_t InterlockedIncrement64 ( volatile int64_t * target)

Definition at line 118 of file atomic.h.

◆ InterlockedIncrementU32()

FORCEINLINE uint32_t InterlockedIncrementU32 ( volatile uint32_t * target)

Definition at line 115 of file atomic.h.

◆ InterlockedIncrementU64()

FORCEINLINE uint64_t InterlockedIncrementU64 ( volatile uint64_t * target)

Definition at line 119 of file atomic.h.

◆ InterlockedOr16()

FORCEINLINE int16_t InterlockedOr16 ( volatile int16_t * target,
int16_t value )

Definition at line 137 of file atomic.h.

◆ InterlockedOr32()

FORCEINLINE int32_t InterlockedOr32 ( volatile int32_t * target,
int32_t value )

Definition at line 138 of file atomic.h.

◆ InterlockedOr64()

FORCEINLINE int64_t InterlockedOr64 ( volatile int64_t * target,
int64_t value )

Definition at line 139 of file atomic.h.

◆ InterlockedOr8()

FORCEINLINE int8_t InterlockedOr8 ( volatile int8_t * target,
int8_t value )

Definition at line 136 of file atomic.h.

◆ InterlockedOrU16()

FORCEINLINE uint16_t InterlockedOrU16 ( volatile uint16_t * target,
uint16_t value )

Definition at line 142 of file atomic.h.

◆ InterlockedOrU32()

FORCEINLINE uint32_t InterlockedOrU32 ( volatile uint32_t * target,
uint32_t value )

Definition at line 143 of file atomic.h.

◆ InterlockedOrU64()

FORCEINLINE uint64_t InterlockedOrU64 ( volatile uint64_t * target,
uint64_t value )

Definition at line 144 of file atomic.h.

◆ InterlockedOrU8()

FORCEINLINE uint8_t InterlockedOrU8 ( volatile uint8_t * target,
uint8_t value )

Definition at line 141 of file atomic.h.

◆ InterlockedSetMaskU32()

FORCEINLINE uint32_t InterlockedSetMaskU32 ( volatile uint32_t * target,
uint32_t mask )

Definition at line 179 of file atomic.h.