Mercurial > hg > nginx
comparison src/os/unix/ngx_atomic.h @ 1327:b766d9c0a2be stable-0.5
r1306, r1307, r1308, r1309, r1310, r1311, r1322, r1325 merge:
Sun Studio related fixes
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Sun, 22 Jul 2007 08:47:45 +0000 |
parents | ca9fe5ae412b |
children |
comparison
equal
deleted
inserted
replaced
1326:ccd8734e4a80 | 1327:b766d9c0a2be |
---|---|
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; |