Mercurial > hg > nginx-vendor-0-7
annotate src/os/unix/ngx_gcc_atomic_amd64.h @ 366:babd3d9efb62 NGINX_0_6_27
nginx 0.6.27
*) Change: now by default the rtsig method is not built on
Linux 2.6.18+.
*) Change: now a request method is not changed while redirection to a
named location via an "error_page" directive.
*) Feature: the "resolver" and "resolver_timeout" directives in SMTP
proxy.
*) Feature: the "post_action" directive supports named locations.
*) Bugfix: a segmentation fault occurred in worker process, if a
request was redirected from proxy, FastCGI, or memcached location to
static named locations.
*) Bugfix: browsers did not repeat SSL handshake if there is no valid
client certificate in first handshake.
Thanks to Alexander V. Inyukhin.
*) Bugfix: if response code 495-497 was redirected via an "error_page"
directive without code change, then nginx tried to allocate too many
memory.
*) Bugfix: memory leak in long-lived non buffered connections.
*) Bugfix: memory leak in resolver.
*) Bugfix: a segmentation fault occurred in worker process, if a
request was redirected from proxy, FastCGI, or memcached location to
static named locations.
*) Bugfix: in the $proxy_host and $proxy_port variables caching.
Thanks to Sergey Bochenkov.
*) Bugfix: a "proxy_pass" directive with variables used incorrectly the
same port as in another "proxy_pass" directive with the same host
name and without variables.
Thanks to Sergey Bochenkov.
*) Bugfix: an alert "sendmsg() failed (9: Bad file descriptor)" on some
64-bit platforms while reconfiguration.
*) Bugfix: a segmentation fault occurred in worker process, if empty
stub block was used second time in SSI.
*) Bugfix: in copying URI part contained escaped symbols into arguments.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Wed, 12 Mar 2008 00:00:00 +0300 |
parents | 052a7b1d40e5 |
children |
rev | line source |
---|---|
110 | 1 |
2 /* | |
3 * Copyright (C) Igor Sysoev | |
4 */ | |
5 | |
6 | |
7 #if (NGX_SMP) | |
8 #define NGX_SMP_LOCK "lock;" | |
9 #else | |
10 #define NGX_SMP_LOCK | |
11 #endif | |
12 | |
13 | |
14 /* | |
15 * "cmpxchgq r, [m]": | |
16 * | |
17 * if (rax == [m]) { | |
18 * zf = 1; | |
19 * [m] = r; | |
20 * } else { | |
21 * zf = 0; | |
22 * rax = [m]; | |
23 * } | |
24 * | |
25 * | |
26 * The "r" is any register, %rax (%r0) - %r16. | |
274 | 27 * The "=a" and "a" are the %rax register. |
28 * Although we can return result in any register, we use "a" because it is | |
29 * used in cmpxchgq anyway. The result is actually in %al but not in $rax, | |
30 * however as the code is inlined gcc can test %al as well as %rax. | |
31 * | |
110 | 32 * The "cc" means that flags were changed. |
33 */ | |
34 | |
35 static ngx_inline ngx_atomic_uint_t | |
36 ngx_atomic_cmp_set(ngx_atomic_t *lock, ngx_atomic_uint_t old, | |
37 ngx_atomic_uint_t set) | |
126 | 38 { |
274 | 39 u_char res; |
110 | 40 |
41 __asm__ volatile ( | |
42 | |
43 NGX_SMP_LOCK | |
44 " cmpxchgq %3, %1; " | |
274 | 45 " sete %0; " |
110 | 46 |
47 : "=a" (res) : "m" (*lock), "a" (old), "r" (set) : "cc", "memory"); | |
48 | |
49 return res; | |
50 } | |
51 | |
52 | |
53 /* | |
54 * "xaddq r, [m]": | |
55 * | |
56 * temp = [m]; | |
57 * [m] += r; | |
58 * r = temp; | |
59 * | |
60 * | |
61 * The "+r" is any register, %rax (%r0) - %r16. | |
62 * The "cc" means that flags were changed. | |
63 */ | |
64 | |
65 static ngx_inline ngx_atomic_int_t | |
66 ngx_atomic_fetch_add(ngx_atomic_t *value, ngx_atomic_int_t add) | |
67 { | |
68 __asm__ volatile ( | |
69 | |
70 NGX_SMP_LOCK | |
71 " xaddq %0, %1; " | |
72 | |
274 | 73 : "+r" (add) : "m" (*value) : "cc", "memory"); |
110 | 74 |
75 return add; | |
76 } | |
112 | 77 |
78 | |
160 | 79 #define ngx_memory_barrier() __asm__ volatile ("" ::: "memory") |
80 | |
81 #define ngx_cpu_pause() __asm__ ("pause") |