1 //===- llvm/System/Atomic.h - Atomic Operations -----------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file declares the llvm::sys atomic operations.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_SYSTEM_ATOMIC_H
15 #define LLVM_SYSTEM_ATOMIC_H
17 #include "llvm/System/DataTypes.h"
23 typedef uint32_t cas_flag;
24 cas_flag CompareAndSwap(volatile cas_flag* ptr,
27 cas_flag AtomicIncrement(volatile cas_flag* ptr);
28 cas_flag AtomicDecrement(volatile cas_flag* ptr);
29 cas_flag AtomicAdd(volatile cas_flag* ptr, cas_flag val);
30 cas_flag AtomicMul(volatile cas_flag* ptr, cas_flag val);
31 cas_flag AtomicDiv(volatile cas_flag* ptr, cas_flag val);