Mercurial > hg > nginx-vendor-current
annotate src/os/unix/ngx_gcc_atomic_amd64.h @ 694:88a1b4797f2e NGINX_1_3_10
nginx 1.3.10
*) Change: domain names specified in configuration file are now resolved
to IPv6 addresses as well as IPv4 ones.
*) Change: now if the "include" directive with mask is used on Unix
systems, included files are sorted in alphabetical order.
*) Change: the "add_header" directive adds headers to 201 responses.
*) Feature: the "geo" directive now supports IPv6 addresses in CIDR
notation.
*) Feature: the "flush" and "gzip" parameters of the "access_log"
directive.
*) Feature: variables support in the "auth_basic" directive.
*) Bugfix: nginx could not be built with the ngx_http_perl_module in
some cases.
*) Bugfix: a segmentation fault might occur in a worker process if the
ngx_http_xslt_module was used.
*) Bugfix: nginx could not be built on MacOSX in some cases.
Thanks to Piotr Sikora.
*) Bugfix: the "limit_rate" directive with high rates might result in
truncated responses on 32-bit platforms.
Thanks to Alexey Antropov.
*) Bugfix: a segmentation fault might occur in a worker process if the
"if" directive was used.
Thanks to Piotr Sikora.
*) Bugfix: a "100 Continue" response was issued with "413 Request Entity
Too Large" responses.
*) Bugfix: the "image_filter", "image_filter_jpeg_quality" and
"image_filter_sharpen" directives might be inherited incorrectly.
Thanks to Ian Babrou.
*) Bugfix: "crypt_r() failed" errors might appear if the "auth_basic"
directive was used on Linux.
*) Bugfix: in backup servers handling.
Thanks to Thomas Chen.
*) Bugfix: proxied HEAD requests might return incorrect response if the
"gzip" directive was used.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Tue, 25 Dec 2012 00:00:00 +0400 |
parents | d0f7a625f27c |
children |
rev | line source |
---|---|
110 | 1 |
2 /* | |
3 * Copyright (C) Igor Sysoev | |
660 | 4 * Copyright (C) Nginx, Inc. |
110 | 5 */ |
6 | |
7 | |
8 #if (NGX_SMP) | |
9 #define NGX_SMP_LOCK "lock;" | |
10 #else | |
11 #define NGX_SMP_LOCK | |
12 #endif | |
13 | |
14 | |
15 /* | |
16 * "cmpxchgq r, [m]": | |
17 * | |
18 * if (rax == [m]) { | |
19 * zf = 1; | |
20 * [m] = r; | |
21 * } else { | |
22 * zf = 0; | |
23 * rax = [m]; | |
24 * } | |
25 * | |
26 * | |
27 * The "r" is any register, %rax (%r0) - %r16. | |
274 | 28 * The "=a" and "a" are the %rax register. |
29 * Although we can return result in any register, we use "a" because it is | |
30 * used in cmpxchgq anyway. The result is actually in %al but not in $rax, | |
31 * however as the code is inlined gcc can test %al as well as %rax. | |
32 * | |
110 | 33 * The "cc" means that flags were changed. |
34 */ | |
35 | |
36 static ngx_inline ngx_atomic_uint_t | |
37 ngx_atomic_cmp_set(ngx_atomic_t *lock, ngx_atomic_uint_t old, | |
38 ngx_atomic_uint_t set) | |
126 | 39 { |
274 | 40 u_char res; |
110 | 41 |
42 __asm__ volatile ( | |
43 | |
44 NGX_SMP_LOCK | |
45 " cmpxchgq %3, %1; " | |
274 | 46 " sete %0; " |
110 | 47 |
48 : "=a" (res) : "m" (*lock), "a" (old), "r" (set) : "cc", "memory"); | |
49 | |
50 return res; | |
51 } | |
52 | |
53 | |
54 /* | |
55 * "xaddq r, [m]": | |
56 * | |
57 * temp = [m]; | |
58 * [m] += r; | |
59 * r = temp; | |
60 * | |
61 * | |
62 * The "+r" is any register, %rax (%r0) - %r16. | |
63 * The "cc" means that flags were changed. | |
64 */ | |
65 | |
66 static ngx_inline ngx_atomic_int_t | |
67 ngx_atomic_fetch_add(ngx_atomic_t *value, ngx_atomic_int_t add) | |
68 { | |
69 __asm__ volatile ( | |
70 | |
71 NGX_SMP_LOCK | |
72 " xaddq %0, %1; " | |
73 | |
274 | 74 : "+r" (add) : "m" (*value) : "cc", "memory"); |
110 | 75 |
76 return add; | |
77 } | |
112 | 78 |
79 | |
160 | 80 #define ngx_memory_barrier() __asm__ volatile ("" ::: "memory") |
81 | |
82 #define ngx_cpu_pause() __asm__ ("pause") |