8#ifndef INCLUDED_BSLS_ATOMICOPERATIONS_SPARC_SUN_CC_DEFAULT
9#define INCLUDED_BSLS_ATOMICOPERATIONS_SPARC_SUN_CC_DEFAULT
55#include <bsls_atomicoperations_default.h>
59#if (defined(BSLS_PLATFORM_CPU_SPARC_V9) \
60 || defined(BSLS_PLATFORM_CPU_SPARC_32)) \
61 && (defined(BSLS_PLATFORM_CMP_GNU) || defined(BSLS_PLATFORM_CMP_SUN))
69 int bsls_AtomicOperations_Sparc_GetInt(
70 const volatile int *atomicInt);
72 void bsls_AtomicOperations_Sparc_SetInt(
73 volatile int *atomicInt,
76 int bsls_AtomicOperations_Sparc_SwapInt(
77 volatile int *atomicInt,
80 int bsls_AtomicOperations_Sparc_SwapIntAcqRel(
81 volatile int *atomicInt,
84 int bsls_AtomicOperations_Sparc_TestAndSwapInt(
85 volatile int *atomicInt,
89 int bsls_AtomicOperations_Sparc_TestAndSwapIntAcqRel(
90 volatile int *atomicInt,
94 int bsls_AtomicOperations_Sparc_AddInt(
95 volatile int *atomicInt,
98 int bsls_AtomicOperations_Sparc_AddIntRelaxed(
99 volatile int *atomicInt,
109template <
typename IMP>
110struct AtomicOperations_SPARC_SUN_CC_DefaultInt
111 : AtomicOperations_DefaultInt<IMP>
113 typedef Atomic_TypeTraits<IMP> AtomicTypes;
115 using AtomicOperations_DefaultInt<IMP>::getIntRelaxed;
116 using AtomicOperations_DefaultInt<IMP>::setIntRelaxed;
120 static int getInt(
typename AtomicTypes::Int
const *atomicInt);
122 static int getIntAcquire(
typename AtomicTypes::Int
const *atomicInt);
124 static void setInt(
typename AtomicTypes::Int *atomicInt,
int value);
126 static void setIntRelease(
typename AtomicTypes::Int *atomicInt,
int value);
128 static int swapInt(
typename AtomicTypes::Int *atomicInt,
int swapValue);
130 static int swapIntAcqRel(
typename AtomicTypes::Int *atomicInt,
133 static int testAndSwapInt(
typename AtomicTypes::Int *atomicInt,
137 static int testAndSwapIntAcqRel(
typename AtomicTypes::Int *atomicInt,
141 static int addIntNv(
typename AtomicTypes::Int *atomicInt,
int value);
143 static int addIntNvRelaxed(
typename AtomicTypes::Int *atomicInt,
146 static int addIntNvAcqRel(
typename AtomicTypes::Int *atomicInt,
int value);
153template <
typename IMP>
154struct AtomicOperations_SPARC_SUN_CC_Default32
155 : AtomicOperations_SPARC_SUN_CC_DefaultInt<IMP>
156 , AtomicOperations_DefaultInt64<IMP>
157 , AtomicOperations_DefaultUint<IMP>
158 , AtomicOperations_DefaultUint64<IMP>
159 , AtomicOperations_DefaultPointer32<IMP>
166template <
typename IMP>
167struct AtomicOperations_SPARC_SUN_CC_Default64
168 : AtomicOperations_SPARC_SUN_CC_DefaultInt<IMP>
169 , AtomicOperations_DefaultInt64<IMP>
170 , AtomicOperations_DefaultUint<IMP>
171 , AtomicOperations_DefaultUint64<IMP>
172 , AtomicOperations_DefaultPointer64<IMP>
183template <
typename IMP>
185int AtomicOperations_SPARC_SUN_CC_DefaultInt<IMP>::
186 getInt(
typename AtomicTypes::Int
const *atomicInt)
188 return bsls_AtomicOperations_Sparc_GetInt(&atomicInt->d_value);
191template <
typename IMP>
193int AtomicOperations_SPARC_SUN_CC_DefaultInt<IMP>::
194 getIntAcquire(
typename AtomicTypes::Int
const *atomicInt)
196 return getIntRelaxed(atomicInt);
199template <
typename IMP>
201void AtomicOperations_SPARC_SUN_CC_DefaultInt<IMP>::
202 setInt(
typename AtomicTypes::Int *atomicInt,
int value)
204 bsls_AtomicOperations_Sparc_SetInt(&atomicInt->d_value, value);
207template <
typename IMP>
209void AtomicOperations_SPARC_SUN_CC_DefaultInt<IMP>::
210 setIntRelease(
typename AtomicTypes::Int *atomicInt,
int value)
212 setIntRelaxed(atomicInt, value);
215template <
typename IMP>
217int AtomicOperations_SPARC_SUN_CC_DefaultInt<IMP>::
218 swapInt(
typename AtomicTypes::Int *atomicInt,
int swapValue)
220 return bsls_AtomicOperations_Sparc_SwapInt(&atomicInt->d_value, swapValue);
223template <
typename IMP>
225int AtomicOperations_SPARC_SUN_CC_DefaultInt<IMP>::
226 swapIntAcqRel(
typename AtomicTypes::Int *atomicInt,
int swapValue)
228 return bsls_AtomicOperations_Sparc_SwapIntAcqRel(&atomicInt->d_value,
232template <
typename IMP>
234int AtomicOperations_SPARC_SUN_CC_DefaultInt<IMP>::
235 testAndSwapInt(
typename AtomicTypes::Int *atomicInt,
239 return bsls_AtomicOperations_Sparc_TestAndSwapInt(&atomicInt->d_value,
244template <
typename IMP>
246int AtomicOperations_SPARC_SUN_CC_DefaultInt<IMP>::
247 testAndSwapIntAcqRel(
typename AtomicTypes::Int *atomicInt,
251 return bsls_AtomicOperations_Sparc_TestAndSwapIntAcqRel(
257template <
typename IMP>
259int AtomicOperations_SPARC_SUN_CC_DefaultInt<IMP>::
260 addIntNv(
typename AtomicTypes::Int *atomicInt,
int value)
262 return bsls_AtomicOperations_Sparc_AddInt(&atomicInt->d_value, value);
265template <
typename IMP>
267int AtomicOperations_SPARC_SUN_CC_DefaultInt<IMP>::
268 addIntNvRelaxed(
typename AtomicTypes::Int *atomicInt,
int value)
270 return bsls_AtomicOperations_Sparc_AddIntRelaxed(&atomicInt->d_value,
274template <
typename IMP>
276int AtomicOperations_SPARC_SUN_CC_DefaultInt<IMP>::
277 addIntNvAcqRel(
typename AtomicTypes::Int *atomicInt,
int value)
279 return addIntNvRelaxed(atomicInt, value);
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition bdlt_iso8601util.h:691