8#ifndef INCLUDED_BSLS_ATOMICOPERATIONS_ARM32_WIN_MSVC
9#define INCLUDED_BSLS_ATOMICOPERATIONS_ARM32_WIN_MSVC
54#include <bsls_atomicoperations_default.h>
58#if defined(BSLS_PLATFORM_CPU_ARM) && defined(BSLS_PLATFORM_CPU_32_BIT) && \
59 defined(BSLS_PLATFORM_CMP_MSVC)
66struct AtomicOperations_ARM32_WIN_MSVC;
67typedef AtomicOperations_ARM32_WIN_MSVC AtomicOperations_Imp;
74struct Atomic_TypeTraits<AtomicOperations_ARM32_WIN_MSVC>
85 volatile Types::Int64 d_value;
91 volatile
unsigned int d_value;
97 volatile Types::Uint64 d_value;
103 void * volatile d_value;
111struct AtomicOperations_ARM32_WIN_MSVC
112 : AtomicOperations_Default32<AtomicOperations_ARM32_WIN_MSVC>
114 typedef Atomic_TypeTraits<AtomicOperations_ARM32_WIN_MSVC> AtomicTypes;
118 static int getInt(
const AtomicTypes::Int *atomicInt);
120 static int getIntAcquire(
const AtomicTypes::Int *atomicInt);
122 static void setInt(AtomicTypes::Int *atomicInt,
int value);
124 static void setIntRelease(AtomicTypes::Int *atomicInt,
int value);
126 static int swapInt(AtomicTypes::Int *atomicInt,
int swapValue);
128 static int testAndSwapInt(AtomicTypes::Int *atomicInt,
132 static int addIntNv(AtomicTypes::Int *atomicInt,
int value);
136 static Types::Int64 getInt64(
const AtomicTypes::Int64 *atomicInt);
138 static void setInt64(AtomicTypes::Int64 *atomicInt, Types::Int64 value);
140 static Types::Int64 swapInt64(AtomicTypes::Int64 *atomicInt,
141 Types::Int64 swapValue);
143 static Types::Int64 testAndSwapInt64(AtomicTypes::Int64 *atomicInt,
144 Types::Int64 compareValue,
145 Types::Int64 swapValue);
147 static Types::Int64 addInt64Nv(AtomicTypes::Int64 *atomicInt,
160#define BSLS_ATOMIC_FENCE() \
161 __dmb(_ARM_BARRIER_ISH)
164int AtomicOperations_ARM32_WIN_MSVC::
165 getInt(
const AtomicTypes::Int *atomicInt)
167 int result = __iso_volatile_load32(&atomicInt->d_value);
173int AtomicOperations_ARM32_WIN_MSVC::
174 getIntAcquire(
const AtomicTypes::Int *atomicInt)
176 int result = __iso_volatile_load32(&atomicInt->d_value);
182void AtomicOperations_ARM32_WIN_MSVC::
183 setInt(AtomicTypes::Int *atomicInt,
int value)
186 __iso_volatile_store32(&atomicInt->d_value, value);
191void AtomicOperations_ARM32_WIN_MSVC::
192 setIntRelease(AtomicTypes::Int *atomicInt,
int value)
195 __iso_volatile_store32(&atomicInt->d_value, value);
199int AtomicOperations_ARM32_WIN_MSVC::
200 swapInt(AtomicTypes::Int *atomicInt,
int swapValue)
202 return _InterlockedExchange(
203 reinterpret_cast<long volatile *
>(&atomicInt->d_value),
208int AtomicOperations_ARM32_WIN_MSVC::
209 testAndSwapInt(AtomicTypes::Int *atomicInt,
213 return _InterlockedCompareExchange(
214 reinterpret_cast<long volatile *
>(&atomicInt->d_value),
220int AtomicOperations_ARM32_WIN_MSVC::
221 addIntNv(AtomicTypes::Int *atomicInt,
int value)
223 return static_cast<int>(
224 static_cast<unsigned int>(_InterlockedExchangeAdd(
225 reinterpret_cast<long volatile *
>(&atomicInt->d_value),
232Types::Int64 AtomicOperations_ARM32_WIN_MSVC::
233 getInt64(
const AtomicTypes::Int64 *atomicInt)
235 Types::Int64 result = __iso_volatile_load64(&atomicInt->d_value);
241void AtomicOperations_ARM32_WIN_MSVC::
242 setInt64(AtomicTypes::Int64 *atomicInt, Types::Int64 value)
245 __iso_volatile_store64(&atomicInt->d_value, value);
250Types::Int64 AtomicOperations_ARM32_WIN_MSVC::
251 swapInt64(AtomicTypes::Int64 *atomicInt,
252 Types::Int64 swapValue)
254 return _InterlockedExchange64(
260Types::Int64 AtomicOperations_ARM32_WIN_MSVC::
261 testAndSwapInt64(AtomicTypes::Int64 *atomicInt,
262 Types::Int64 compareValue,
263 Types::Int64 swapValue)
265 return _InterlockedCompareExchange64(
272Types::Int64 AtomicOperations_ARM32_WIN_MSVC::
273 addInt64Nv(AtomicTypes::Int64 *atomicInt,
276 return static_cast<Types::Int64
>(
277 static_cast<Types::Uint64
>(
278 _InterlockedExchangeAdd64(&atomicInt->d_value, value)) +
283#undef BSLS_ATOMIC_FENCE
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition bdlt_iso8601util.h:691