19#ifndef __MBED_UTIL_ATOMIC_H__
20#define __MBED_UTIL_ATOMIC_H__
27#include "platform/mbed_toolchain.h"
57 mbed_memory_order_relaxed = 0x00,
58 mbed_memory_order_consume = 0x01,
59 mbed_memory_order_acquire = 0x02,
60 mbed_memory_order_release = 0x04,
61 mbed_memory_order_acq_rel = 0x06,
62 mbed_memory_order_seq_cst = 0x16
66#ifndef MBED_EXCLUSIVE_ACCESS
67#ifndef __EXCLUSIVE_ACCESS
68#if defined __arm__ || defined __ICC_ARM__ || defined __ARM_ARCH
69#if ((__ARM_ARCH_7M__ == 1U) || \
70 (__ARM_ARCH_7EM__ == 1U) || \
71 (__ARM_ARCH_8M_BASE__ == 1U) || \
72 (__ARM_ARCH_8M_MAIN__ == 1U) || \
73 (__ARM_ARCH_8_1M_MAIN__ == 1U)) || \
74 (__ARM_ARCH_7A__ == 1U)
75#define MBED_EXCLUSIVE_ACCESS 1U
76#define MBED_EXCLUSIVE_ACCESS_THUMB1 (__ARM_ARCH_8M_BASE__ == 1U)
79#define MBED_EXCLUSIVE_ACCESS_ARM 1U
81#define MBED_EXCLUSIVE_ACCESS_ARM 0U
84#if !defined (__thumb__)
85#define MBED_EXCLUSIVE_ACCESS_ARM 1U
87#define MBED_EXCLUSIVE_ACCESS_ARM 0U
90#elif (__ARM_ARCH_6M__ == 1U)
91#define MBED_EXCLUSIVE_ACCESS 0U
92#elif defined __aarch64__
93#define MBED_EXCLUSIVE_ACCESS 0U
95#error "Unknown ARM architecture for exclusive access"
99#define MBED_EXCLUSIVE_ACCESS 0U
102#define MBED_EXCLUSIVE_ACCESS __EXCLUSIVE_ACCESS
106#if MBED_EXCLUSIVE_ACCESS
107#define MBED_INLINE_IF_EX inline
109#define MBED_INLINE_IF_EX
130#define CORE_UTIL_ATOMIC_FLAG_INIT { 0 }
900#include <mstd_type_traits>
970template<
typename T>
inline void core_util_atomic_store(T *
volatile *valuePtr, mstd::type_identity_t<T> *desiredValue)
noexcept;
1010#include "platform/internal/mbed_atomic_impl.h"
A lock-free, primitive atomic flag.