8#ifndef INCLUDED_BSLS_ATOMICOPERATIONS_SPARC32_SUN_CC
9#define INCLUDED_BSLS_ATOMICOPERATIONS_SPARC32_SUN_CC
54#include <bsls_atomicoperations_default.h>
59#if defined(BSLS_PLATFORM_CPU_SPARC_32) \
60 && (defined(BSLS_PLATFORM_CMP_GNU) || defined(BSLS_PLATFORM_CMP_SUN))
74 void bsls_AtomicOperations_Sparc32_SetInt64(
77 void bsls_AtomicOperations_Sparc32_SetInt64Relaxed(
107struct AtomicOperations_SPARC32_SUN_CC;
108typedef AtomicOperations_SPARC32_SUN_CC AtomicOperations_Imp;
115struct Atomic_TypeTraits<AtomicOperations_SPARC32_SUN_CC>
119#ifdef BSLS_PLATFORM_CMP_GNU
120 volatile int d_value __attribute__((__aligned__(
sizeof(
int))));
122# pragma align 4 (d_value)
123 volatile int d_value;
129#ifdef BSLS_PLATFORM_CMP_GNU
130 volatile Types::Int64 d_value
131 __attribute__((__aligned__(
sizeof(Types::Int64))));
133# pragma align 8 (d_value)
134 volatile Types::Int64 d_value;
140#ifdef BSLS_PLATFORM_CMP_GNU
141 volatile unsigned int d_value
142 __attribute__((__aligned__(
sizeof(
unsigned int))));
144# pragma align 4 (d_value)
145 volatile unsigned int d_value;
151#ifdef BSLS_PLATFORM_CMP_GNU
152 volatile Types::Uint64 d_value
153 __attribute__((__aligned__(
sizeof(Types::Uint64))));
155# pragma align 8 (d_value)
156 volatile Types::Uint64 d_value;
162#ifdef BSLS_PLATFORM_CMP_GNU
163 void *
volatile d_value __attribute__((__aligned__(
sizeof(
void *))));
165# pragma align 4 (d_value)
166 void *
volatile d_value;
175struct AtomicOperations_SPARC32_SUN_CC
176 : AtomicOperations_SPARC_SUN_CC_Default32<AtomicOperations_SPARC32_SUN_CC>
178 typedef Atomic_TypeTraits<AtomicOperations_SPARC32_SUN_CC> AtomicTypes;
182 static Types::Int64 getInt64(
const AtomicTypes::Int64 *atomicInt);
184 static Types::Int64 getInt64Relaxed(
const AtomicTypes::Int64 *atomicInt);
186 static Types::Int64 getInt64Acquire(
const AtomicTypes::Int64 *atomicInt);
188 static void setInt64(AtomicTypes::Int64 *atomicInt, Types::Int64 value);
190 static void setInt64Relaxed(AtomicTypes::Int64 *atomicInt,
193 static void setInt64Release(AtomicTypes::Int64 *atomicInt,
196 static Types::Int64 swapInt64(AtomicTypes::Int64 *atomicInt,
197 Types::Int64 swapValue);
199 static Types::Int64 swapInt64AcqRel(AtomicTypes::Int64 *atomicInt,
200 Types::Int64 swapValue);
202 static Types::Int64 testAndSwapInt64(AtomicTypes::Int64 *atomicInt,
203 Types::Int64 compareValue,
204 Types::Int64 swapValue);
206 static Types::Int64 testAndSwapInt64AcqRel(AtomicTypes::Int64 *atomicInt,
207 Types::Int64 compareValue,
208 Types::Int64 swapValue);
210 static Types::Int64 addInt64Nv(AtomicTypes::Int64 *atomicInt,
213 static Types::Int64 addInt64NvRelaxed(AtomicTypes::Int64 *atomicInt,
216 static Types::Int64 addInt64NvAcqRel(AtomicTypes::Int64 *atomicInt,
230 getInt64(
const AtomicTypes::Int64 *atomicInt)
232 return bsls_AtomicOperations_Sparc32_GetInt64(&atomicInt->d_value);
237 getInt64Relaxed(
const AtomicTypes::Int64 *atomicInt)
239 return bsls_AtomicOperations_Sparc32_GetInt64Relaxed(&atomicInt->d_value);
244 getInt64Acquire(
const AtomicTypes::Int64 *atomicInt)
246 return getInt64Relaxed(atomicInt);
250void AtomicOperations_SPARC32_SUN_CC::
251 setInt64(AtomicTypes::Int64 *atomicInt,
Types::Int64 value)
253 bsls_AtomicOperations_Sparc32_SetInt64(&atomicInt->d_value, value);
257void AtomicOperations_SPARC32_SUN_CC::
258 setInt64Relaxed(AtomicTypes::Int64 *atomicInt,
Types::Int64 value)
260 bsls_AtomicOperations_Sparc32_SetInt64Relaxed(&atomicInt->d_value, value);
264void AtomicOperations_SPARC32_SUN_CC::
265 setInt64Release(AtomicTypes::Int64 *atomicInt,
Types::Int64 value)
267 setInt64Relaxed(atomicInt, value);
272 swapInt64(AtomicTypes::Int64 *atomicInt,
275 return bsls_AtomicOperations_Sparc32_SwapInt64(&atomicInt->d_value,
281 swapInt64AcqRel(AtomicTypes::Int64 *atomicInt,
284 return bsls_AtomicOperations_Sparc32_SwapInt64AcqRel(&atomicInt->d_value,
290 testAndSwapInt64(AtomicTypes::Int64 *atomicInt,
294 return bsls_AtomicOperations_Sparc32_TestAndSwapInt64(&atomicInt->d_value,
301 testAndSwapInt64AcqRel(AtomicTypes::Int64 *atomicInt,
305 return bsls_AtomicOperations_Sparc32_TestAndSwapInt64AcqRel(
313 addInt64Nv(AtomicTypes::Int64 *atomicInt,
316 return bsls_AtomicOperations_Sparc32_AddInt64(&atomicInt->d_value, value);
321 addInt64NvRelaxed(AtomicTypes::Int64 *atomicInt,
324 return bsls_AtomicOperations_Sparc32_AddInt64Relaxed(&atomicInt->d_value,
330 addInt64NvAcqRel(AtomicTypes::Int64 *atomicInt,
333 return addInt64NvRelaxed(atomicInt, value);
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition bdlt_iso8601util.h:691
long long Int64
Definition bsls_types.h:132