Sun Studio 12 compatibility

This commit is contained in:
Igor Sysoev 2007-07-16 08:54:04 +00:00
parent de27bce24e
commit d3cdbc85e8
4 changed files with 76 additions and 16 deletions

View file

@ -87,10 +87,17 @@ ngx_atomic_cmp_set(ngx_atomic_t *lock, ngx_atomic_uint_t old,
ngx_atomic_int_t
ngx_atomic_fetch_add(ngx_atomic_t *value, ngx_atomic_int_t add);
/*
* Sun Studio 12 exits with segmentation fault on '__asm ("pause")',
* so ngx_cpu_pause is declared in src/os/unix/ngx_sunpro_x86.il
*/
void
ngx_cpu_pause(void);
/* the code in src/os/unix/ngx_sunpro_x86.il */
#define ngx_memory_barrier() __asm (".volatile"); __asm (".nonvolatile")
#define ngx_cpu_pause() __asm ("pause")
#else /* ( __GNUC__ || __INTEL_COMPILER ) */
@ -121,10 +128,17 @@ ngx_atomic_cmp_set(ngx_atomic_t *lock, ngx_atomic_uint_t old,
ngx_atomic_int_t
ngx_atomic_fetch_add(ngx_atomic_t *value, ngx_atomic_int_t add);
/*
* Sun Studio 12 exits with segmentation fault on '__asm ("pause")',
* so ngx_cpu_pause is declared in src/os/unix/ngx_sunpro_amd64.il
*/
void
ngx_cpu_pause(void);
/* the code in src/os/unix/ngx_sunpro_amd64.il */
#define ngx_memory_barrier() __asm (".volatile"); __asm (".nonvolatile")
#define ngx_cpu_pause() __asm ("pause")
#else /* ( __GNUC__ || __INTEL_COMPILER ) */

View file

@ -28,3 +28,10 @@
lock
xaddq %rax, (%rdi)
.end
/ ngx_cpu_pause()
.inline ngx_cpu_pause,0
pause
.end

View file

@ -29,3 +29,10 @@
lock
xaddl %eax, (%ecx)
.end
/ ngx_cpu_pause()
.inline ngx_cpu_pause,0
pause
.end