Mercurial > hg > nginx-vendor-0-7
annotate src/os/unix/ngx_gcc_atomic_amd64.h @ 358:9121a0a91f47 NGINX_0_6_23
nginx 0.6.23
*) Change: the "off" parameter in the "ssl_session_cache" directive;
now this is default parameter.
*) Change: the "open_file_cache_retest" directive was renamed to the
"open_file_cache_valid".
*) Feature: the "open_file_cache_min_uses" directive.
*) Feature: the ngx_http_gzip_static_module.
*) Feature: the "gzip_disable" directive.
*) Feature: the "memcached_pass" directive may be used inside the "if"
block.
*) Bugfix: a segmentation fault occurred in worker process, if the
"memcached_pass" and "if" directives were used in the same location.
*) Bugfix: if a "satisfy_any on" directive was used and not all access
and auth modules directives were set, then other given access and
auth directives were not tested;
*) Bugfix: regex parameters in a "valid_referers" directive were not
inherited from previous level.
*) Bugfix: a "post_action" directive did run if a request was completed
with 499 status code.
*) Bugfix: optimization of 16K buffer usage in a SSL connection.
Thanks to Ben Maurer.
*) Bugfix: the STARTTLS in SMTP mode did not work.
Thanks to Oleg Motienko.
*) Bugfix: in HTTPS mode requests might fail with the "bad write retry"
error; bug appeared in 0.5.13.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Thu, 27 Dec 2007 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") |