comparison src/os/unix/ngx_atomic.h @ 320:95183808f549 NGINX_0_6_4

nginx 0.6.4 *) Security: the "msie_refresh" directive allowed XSS. Thanks to Maxim Boguk. *) Change: the "proxy_store" and "fastcgi_store" directives were changed. *) Feature: the "proxy_store_access" and "fastcgi_store_access" directives. *) Bugfix: nginx did not work on Solaris/sparc64 if it was built by Sun Studio. Thanks to Andrei Nigmatulin. *) Workaround: for Sun Studio 12. Thanks to Jiang Hong.
author Igor Sysoev <http://sysoev.ru>
date Tue, 17 Jul 2007 00:00:00 +0400
parents 6eb1e38f0f1f
children 34fb3a573548
comparison
equal deleted inserted replaced
319:6ccd0af7f704 320:95183808f549
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
134 #include "ngx_gcc_atomic_amd64.h" 148 #include "ngx_gcc_atomic_amd64.h"
135 149
136 #endif 150 #endif
137 151
138 152
139 #elif ( __sparc__ || __sparcv9 ) 153 #elif ( __sparc__ || __sparc || __sparcv9 )
140 154
141 #if (NGX_PTR_SIZE == 8) 155 #if (NGX_PTR_SIZE == 8)
142 156
143 typedef int64_t ngx_atomic_int_t; 157 typedef int64_t ngx_atomic_int_t;
144 typedef uint64_t ngx_atomic_uint_t; 158 typedef uint64_t ngx_atomic_uint_t;