mirror of
https://github.com/nginx/nginx.git
synced 2026-08-04 14:58:20 +00:00
Sun Studio 12 compatibility
This commit is contained in:
parent
de27bce24e
commit
d3cdbc85e8
4 changed files with 76 additions and 16 deletions
|
|
@ -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 ) */
|
||||
|
|
|
|||
|
|
@ -28,3 +28,10 @@
|
|||
lock
|
||||
xaddq %rax, (%rdi)
|
||||
.end
|
||||
|
||||
|
||||
/ ngx_cpu_pause()
|
||||
|
||||
.inline ngx_cpu_pause,0
|
||||
pause
|
||||
.end
|
||||
|
|
|
|||
|
|
@ -29,3 +29,10 @@
|
|||
lock
|
||||
xaddl %eax, (%ecx)
|
||||
.end
|
||||
|
||||
|
||||
/ ngx_cpu_pause()
|
||||
|
||||
.inline ngx_cpu_pause,0
|
||||
pause
|
||||
.end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue