~nginx/nginx/1.0

« back to all changes in this revision

Viewing changes to src/os/unix/ngx_sunpro_amd64.il

  • Committer: Michael Lustfield
  • Date: 2010-12-01 08:06:25 UTC
  • Revision ID: michael@profarius.com-20101201080625-y8i4bq0e54ev2qwy
Tags: 0.9.0
Nginx v0.9.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/
 
2
/ Copyright (C) Igor Sysoev
 
3
/
 
4
 
 
5
/ ngx_atomic_uint_t ngx_atomic_cmp_set(ngx_atomic_t *lock,
 
6
/     ngx_atomic_uint_t old, ngx_atomic_uint_t set);
 
7
/
 
8
/ the arguments are passed in %rdi, %rsi, %rdx
 
9
/ the result is returned in the %rax
 
10
 
 
11
        .inline ngx_atomic_cmp_set,0
 
12
        movq      %rsi, %rax
 
13
        lock
 
14
        cmpxchgq  %rdx, (%rdi)
 
15
        setz      %al
 
16
        movzbq    %al, %rax
 
17
        .end
 
18
 
 
19
 
 
20
/ ngx_atomic_int_t ngx_atomic_fetch_add(ngx_atomic_t *value,
 
21
/     ngx_atomic_int_t add);
 
22
/
 
23
/ the arguments are passed in %rdi, %rsi
 
24
/ the result is returned in the %rax
 
25
 
 
26
        .inline ngx_atomic_fetch_add,0
 
27
        movq      %rsi, %rax
 
28
        lock
 
29
        xaddq     %rax, (%rdi)
 
30
        .end
 
31
 
 
32
 
 
33
/ ngx_cpu_pause()
 
34
/
 
35
/ the "rep; nop" is used instead of "pause" to avoid the "[ PAUSE ]" hardware
 
36
/ capability added by linker because Solaris/amd64 does not know about it:
 
37
/
 
38
/ ld.so.1: nginx: fatal: hardware capability unsupported: 0x2000 [ PAUSE ]
 
39
 
 
40
       .inline ngx_cpu_pause,0
 
41
       rep; nop
 
42
       .end