8#ifndef INCLUDED_BSLS_ATOMICOPERATIONS_SPARC64_SUN_CC
9#define INCLUDED_BSLS_ATOMICOPERATIONS_SPARC64_SUN_CC
54#include <bsls_atomicoperations_default.h>
59#if defined(BSLS_PLATFORM_CPU_SPARC_V9) \
60 && (defined(BSLS_PLATFORM_CMP_GNU) || defined(BSLS_PLATFORM_CMP_SUN))
71 void bsls_AtomicOperations_Sparc64_SetInt64(
104struct AtomicOperations_SPARC64_SUN_CC;
105typedef AtomicOperations_SPARC64_SUN_CC AtomicOperations_Imp;
112struct Atomic_TypeTraits<AtomicOperations_SPARC64_SUN_CC>
116#ifdef BSLS_PLATFORM_CMP_GNU
117 volatile int d_value __attribute__((__aligned__(
sizeof(
int))));
119# pragma align 4 (d_value)
120 volatile int d_value;
126#ifdef BSLS_PLATFORM_CMP_GNU
127 volatile Types::Int64 d_value
128 __attribute__((__aligned__(
sizeof(Types::Int64))));
130# pragma align 8 (d_value)
131 volatile Types::Int64 d_value;
137#ifdef BSLS_PLATFORM_CMP_GNU
138 volatile unsigned int d_value
139 __attribute__((__aligned__(
sizeof(
unsigned int))));
141# pragma align 4 (d_value)
142 volatile unsigned int d_value;
148#ifdef BSLS_PLATFORM_CMP_GNU
149 volatile Types::Uint64 d_value
150 __attribute__((__aligned__(
sizeof(Types::Uint64))));
152# pragma align 8 (d_value)
153 volatile Types::Uint64 d_value;
159#ifdef BSLS_PLATFORM_CMP_GNU
160 void *
volatile d_value __attribute__((__aligned__(
sizeof(
void *))));
162# pragma align 8 (d_value)
163 void *
volatile d_value;
172struct AtomicOperations_SPARC64_SUN_CC
173 : AtomicOperations_SPARC_SUN_CC_Default64<AtomicOperations_SPARC64_SUN_CC>
175 typedef Atomic_TypeTraits<AtomicOperations_SPARC64_SUN_CC> AtomicTypes;
179 static Types::Int64 getInt64(
const AtomicTypes::Int64 *atomicInt);
181 static Types::Int64 getInt64Acquire(
const AtomicTypes::Int64 *atomicInt);
183 static void setInt64(AtomicTypes::Int64 *atomicInt, Types::Int64 value);
185 static void setInt64Release(AtomicTypes::Int64 *atomicInt,
188 static Types::Int64 swapInt64(AtomicTypes::Int64 *atomicInt,
189 Types::Int64 swapValue);
191 static Types::Int64 swapInt64AcqRel(AtomicTypes::Int64 *atomicInt,
192 Types::Int64 swapValue);
194 static Types::Int64 testAndSwapInt64(AtomicTypes::Int64 *atomicInt,
195 Types::Int64 compareValue,
196 Types::Int64 swapValue);
198 static Types::Int64 testAndSwapInt64AcqRel(AtomicTypes::Int64 *atomicInt,
199 Types::Int64 compareValue,
200 Types::Int64 swapValue);
202 static Types::Int64 addInt64Nv(AtomicTypes::Int64 *atomicInt,
205 static Types::Int64 addInt64NvRelaxed(AtomicTypes::Int64 *atomicInt,
208 static Types::Int64 addInt64NvAcqRel(AtomicTypes::Int64 *atomicInt,
222 getInt64(
const AtomicTypes::Int64 *atomicInt)
224 return bsls_AtomicOperations_Sparc64_GetInt64(&atomicInt->d_value);
229 getInt64Acquire(
const AtomicTypes::Int64 *atomicInt)
231 return getInt64Relaxed(atomicInt);
235void AtomicOperations_SPARC64_SUN_CC::
236 setInt64(AtomicTypes::Int64 *atomicInt,
Types::Int64 value)
238 bsls_AtomicOperations_Sparc64_SetInt64(&atomicInt->d_value, value);
242void AtomicOperations_SPARC64_SUN_CC::
243 setInt64Release(AtomicTypes::Int64 *atomicInt,
Types::Int64 value)
245 setInt64Relaxed(atomicInt, value);
250 swapInt64(AtomicTypes::Int64 *atomicInt,
253 return bsls_AtomicOperations_Sparc64_SwapInt64(&atomicInt->d_value,
259 swapInt64AcqRel(AtomicTypes::Int64 *atomicInt,
262 return bsls_AtomicOperations_Sparc64_SwapInt64AcqRel(&atomicInt->d_value,
268 testAndSwapInt64(AtomicTypes::Int64 *atomicInt,
272 return bsls_AtomicOperations_Sparc64_TestAndSwapInt64(&atomicInt->d_value,
279 testAndSwapInt64AcqRel(AtomicTypes::Int64 *atomicInt,
283 return bsls_AtomicOperations_Sparc64_TestAndSwapInt64AcqRel(
291 addInt64Nv(AtomicTypes::Int64 *atomicInt,
294 return bsls_AtomicOperations_Sparc64_AddInt64(&atomicInt->d_value, value);
299 addInt64NvRelaxed(AtomicTypes::Int64 *atomicInt,
302 return bsls_AtomicOperations_Sparc64_AddInt64Relaxed(&atomicInt->d_value,
308 addInt64NvAcqRel(AtomicTypes::Int64 *atomicInt,
311 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