comparison src/os/unix/ngx_atomic.h @ 1309:08c6ee7a1b11

Sun Studio 12 compatibility
author Igor Sysoev <igor@sysoev.ru>
date Mon, 16 Jul 2007 08:54:04 +0000
parents 63fa39cf8bd0
children c505e2712e13
comparison
equal deleted inserted replaced
1308:63fa39cf8bd0 1309:08c6ee7a1b11
85 ngx_atomic_uint_t set); 85 ngx_atomic_uint_t set);
86 86
87 ngx_atomic_int_t 87 ngx_atomic_int_t
88 ngx_atomic_fetch_add(ngx_atomic_t *value, ngx_atomic_int_t add); 88 ngx_atomic_fetch_add(ngx_atomic_t *value, ngx_atomic_int_t add);
89 89
90 /*
91 * Sun Studio 12 exits with segmentation fault on '__asm ("pause")',
92 * so ngx_cpu_pause is declared in src/os/unix/ngx_sunpro_x86.il
93 */
94
95 void
96 ngx_cpu_pause(void);
97
90 /* the code in src/os/unix/ngx_sunpro_x86.il */ 98 /* the code in src/os/unix/ngx_sunpro_x86.il */
91 99
92 #define ngx_memory_barrier() __asm (".volatile"); __asm (".nonvolatile") 100 #define ngx_memory_barrier() __asm (".volatile"); __asm (".nonvolatile")
93 #define ngx_cpu_pause() __asm ("pause")
94 101
95 102
96 #else /* ( __GNUC__ || __INTEL_COMPILER ) */ 103 #else /* ( __GNUC__ || __INTEL_COMPILER ) */
97 104
98 #define NGX_HAVE_ATOMIC_OPS 1 105 #define NGX_HAVE_ATOMIC_OPS 1
119 ngx_atomic_uint_t set); 126 ngx_atomic_uint_t set);
120 127
121 ngx_atomic_int_t 128 ngx_atomic_int_t
122 ngx_atomic_fetch_add(ngx_atomic_t *value, ngx_atomic_int_t add); 129 ngx_atomic_fetch_add(ngx_atomic_t *value, ngx_atomic_int_t add);
123 130
131 /*
132 * Sun Studio 12 exits with segmentation fault on '__asm ("pause")',
133 * so ngx_cpu_pause is declared in src/os/unix/ngx_sunpro_amd64.il
134 */
135
136 void
137 ngx_cpu_pause(void);
138
124 /* the code in src/os/unix/ngx_sunpro_amd64.il */ 139 /* the code in src/os/unix/ngx_sunpro_amd64.il */
125 140
126 #define ngx_memory_barrier() __asm (".volatile"); __asm (".nonvolatile") 141 #define ngx_memory_barrier() __asm (".volatile"); __asm (".nonvolatile")
127 #define ngx_cpu_pause() __asm ("pause")
128 142
129 143
130 #else /* ( __GNUC__ || __INTEL_COMPILER ) */ 144 #else /* ( __GNUC__ || __INTEL_COMPILER ) */
131 145
132 #define NGX_HAVE_ATOMIC_OPS 1 146 #define NGX_HAVE_ATOMIC_OPS 1