ReactOS  0.4.14-dev-315-gbb6fece
_sparc_atomic.h
Go to the documentation of this file.
1 
2 // Currently, SUN CC requires object file
3 
4 #if defined (__GNUC__)
5 
6 /*
7 ** int _STLP_atomic_exchange (__stl_atomic_t *pvalue, __stl_atomic_t value)
8 */
9 
10 # if defined(__sparc_v9__) || defined (__sparcv9)
11 
12 # ifdef __arch64__
13 
14 # define _STLP_EXCH_ASM asm volatile ("casx [%3], %4, %0 ; membar #LoadLoad | #LoadStore " : \
15  "=r" (_L_value2), "=m" (*_L_pvalue1) : \
16  "m" (*_L_pvalue1), "r" (_L_pvalue1), "r" (_L_value1), "0" (_L_value2) )
17 
18 # else /* __arch64__ */
19 
20 # define _STLP_EXCH_ASM asm volatile ("cas [%3], %4, %0" : \
21  "=r" (_L_value2), "=m" (*_L_pvalue1) : \
22  "m" (*_L_pvalue1), "r" (_L_pvalue1), "r" (_L_value1), "0" (_L_value2) )
23 # endif
24 
25 # else /* __sparc_v9__ */
26 
27 # define _STLP_EXCH_ASM asm volatile ("swap [%3], %0 " : \
28  "=r" (_L_value2), "=m" (*_L_pvalue1) : \
29  "m" (*_L_pvalue1), "r" (_L_pvalue1), "0" (_L_value2) )
30 # endif
31 
32 
33 # define _STLP_ATOMIC_EXCHANGE(__pvalue1, __value2) \
34  ({ register volatile __stl_atomic_t *_L_pvalue1 = __pvalue1; \
35  register __stl_atomic_t _L_value1, _L_value2 = __value2 ; \
36  do { _L_value1 = *_L_pvalue1; _STLP_EXCH_ASM; } while ( _L_value1 != _L_value2 ) ; \
37  _L_value1; })
38 
39 # define _STLP_ATOMIC_INCREMENT(__pvalue1) \
40  ({ register volatile __stl_atomic_t *_L_pvalue1 = __pvalue1; \
41  register __stl_atomic_t _L_value1, _L_value2; \
42  do { _L_value1 = *_L_pvalue1; _L_value2 = _L_value1+1; _STLP_EXCH_ASM; } while ( _L_value1 != _L_value2 ) ; \
43  (_L_value2 + 1); })
44 
45 # define _STLP_ATOMIC_DECREMENT(__pvalue1) \
46  ({ register volatile __stl_atomic_t *_L_pvalue1 = __pvalue1; \
47  register __stl_atomic_t _L_value1, _L_value2; \
48  do { _L_value1 = *_L_pvalue1; _L_value2 = _L_value1-1; _STLP_EXCH_ASM; } while ( _L_value1 != _L_value2 ) ; \
49  (_L_value2 - 1); })
50 
51 # elif ! defined (_STLP_NO_EXTERN_INLINE)
52 
54 extern "C" void _STLP_atomic_decrement(__stl_atomic_t* i);
55 extern "C" void _STLP_atomic_increment(__stl_atomic_t* i);
56 
57 # define _STLP_ATOMIC_INCREMENT(__x) _STLP_atomic_increment((__stl_atomic_t*)__x)
58 # define _STLP_ATOMIC_DECREMENT(__x) _STLP_atomic_decrement((__stl_atomic_t*)__x)
59 # define _STLP_ATOMIC_EXCHANGE(__x, __y) _STLP_atomic_exchange((__stl_atomic_t*)__x, (__stl_atomic_t)__y)
60 
61 #endif
void _STLP_atomic_increment(__stl_atomic_t *i)
__stl_atomic_t _STLP_atomic_exchange(__stl_atomic_t *__x, __stl_atomic_t __v)
void _STLP_atomic_decrement(__stl_atomic_t *i)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
size_t __stl_atomic_t
Definition: _threads.h:232