Mercurial > hg > nginx-vendor-0-7
annotate src/os/unix/ngx_gcc_atomic_x86.h @ 502:89dc5654117c NGINX_0_7_63
nginx 0.7.63
*) Security: now "/../" are disabled in "Destination" request header
line.
*) Change: minimum supported OpenSSL version is 0.9.7.
*) Change: the "ask" parameter of the "ssl_verify_client" directive was
changed to the "optional" parameter and now it checks a client
certificate if it was offered.
Thanks to Brice Figureau.
*) Feature: now the "-V" switch shows TLS SNI support.
*) Feature: the $ssl_client_verify variable.
Thanks to Brice Figureau.
*) Feature: the "ssl_crl" directive.
Thanks to Brice Figureau.
*) Bugfix: the $ssl_client_cert variable usage corrupted memory; the
bug had appeared in 0.7.7.
Thanks to Sergey Zhuravlev.
*) Feature: now the start cache loader runs in a separate process; this
should improve large caches handling.
*) Feature: now temporary files and permanent storage area may reside
at different file systems.
*) Bugfix: nginx counted incorrectly disk cache size.
*) Change: now directive "gzip_disable msie6" does not disable gzipping
for MSIE 6.0 SV1.
*) Bugfix: nginx always added "Vary: Accept-Encoding" response header
line, if both "gzip_static" and "gzip_vary" were on.
*) Feature: the "proxy" parameter of the "geo" directive.
*) Feature: the ngx_http_geoip_module.
*) Feature: the "limit_rate_after" directive.
Thanks to Ivan Debnar.
*) Feature: the "limit_req_log_level" and "limit_conn_log_level"
directives.
*) Bugfix: now "limit_req" directive conforms to the leaky bucket
algorithm.
Thanks to Maxim Dounin.
*) Bugfix: in ngx_http_limit_req_module.
Thanks to Maxim Dounin.
*) Bugfix: now nginx allows underscores in a request method.
*) Bugfix: "proxy_pass_header" and "fastcgi_pass_header" directives did
not pass to a client the "X-Accel-Redirect", "X-Accel-Limit-Rate",
"X-Accel-Buffering", and "X-Accel-Charset" lines from backend
response header.
Thanks to Maxim Dounin.
*) Bugfix: in handling "Last-Modified" and "Accept-Ranges" backend
response header lines; the bug had appeared in 0.7.44.
Thanks to Maxim Dounin.
*) Feature: the "image_filter_transparency" directive.
*) Feature: the "image_filter" directive supports variables for setting
size.
*) Bugfix: in PNG alpha-channel support in the
ngx_http_image_filter_module.
*) Bugfix: in transparency support in the ngx_http_image_filter_module.
*) Feature: now several "perl_modules" directives may be used.
*) Bugfix: ngx_http_perl_module responses did not work in subrequests.
*) Bugfix: nginx sent '\0' in a "Location" response header line on
MKCOL request.
Thanks to Xie Zhenye.
*) Bugfix: an "error_page" directive did not redirect a 413 error; the
bug had appeared in 0.6.10.
*) Bugfix: in memory allocation error handling.
Thanks to Maxim Dounin and Kirill A. Korinskiy.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Mon, 26 Oct 2009 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 * "cmpxchgl r, [m]": | |
16 * | |
17 * if (eax == [m]) { | |
18 * zf = 1; | |
19 * [m] = r; | |
20 * } else { | |
21 * zf = 0; | |
22 * eax = [m]; | |
23 * } | |
24 * | |
126 | 25 * |
274 | 26 * The "r" means the general register. |
27 * The "=a" and "a" are the %eax register. | |
28 * Although we can return result in any register, we use "a" because it is | |
29 * used in cmpxchgl anyway. The result is actually in %al but not in %eax, | |
30 * however, as the code is inlined gcc can test %al as well as %eax, | |
31 * and icc adds "movzbl %al, %eax" by itself. | |
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) | |
39 { | |
274 | 40 u_char res; |
110 | 41 |
42 __asm__ volatile ( | |
43 | |
44 NGX_SMP_LOCK | |
45 " cmpxchgl %3, %1; " | |
274 | 46 " sete %0; " |
110 | 47 |
274 | 48 : "=a" (res) : "m" (*lock), "a" (old), "r" (set) : "cc", "memory"); |
110 | 49 |
50 return res; | |
51 } | |
52 | |
53 | |
54 /* | |
55 * "xaddl r, [m]": | |
56 * | |
57 * temp = [m]; | |
58 * [m] += r; | |
59 * r = temp; | |
60 * | |
61 * | |
274 | 62 * The "+r" means the general register. |
110 | 63 * The "cc" means that flags were changed. |
64 */ | |
65 | |
66 | |
138 | 67 #if !(( __GNUC__ == 2 && __GNUC_MINOR__ <= 7 ) || ( __INTEL_COMPILER >= 800 )) |
68 | |
69 /* | |
70 * icc 8.1 and 9.0 compile broken code with -march=pentium4 option: | |
71 * ngx_atomic_fetch_add() always return the input "add" value, | |
72 * so we use the gcc 2.7 version. | |
73 * | |
74 * icc 8.1 and 9.0 with -march=pentiumpro option or icc 7.1 compile | |
75 * correct code. | |
76 */ | |
110 | 77 |
78 static ngx_inline ngx_atomic_int_t | |
79 ngx_atomic_fetch_add(ngx_atomic_t *value, ngx_atomic_int_t add) | |
80 { | |
81 __asm__ volatile ( | |
82 | |
83 NGX_SMP_LOCK | |
84 " xaddl %0, %1; " | |
85 | |
274 | 86 : "+r" (add) : "m" (*value) : "cc", "memory"); |
110 | 87 |
88 return add; | |
89 } | |
90 | |
91 | |
138 | 92 #else |
110 | 93 |
94 /* | |
274 | 95 * gcc 2.7 does not support "+r", so we have to use the fixed |
96 * %eax ("=a" and "a") and this adds two superfluous instructions in the end | |
97 * of code, something like this: "mov %eax, %edx / mov %edx, %eax". | |
110 | 98 */ |
99 | |
100 static ngx_inline ngx_atomic_int_t | |
101 ngx_atomic_fetch_add(ngx_atomic_t *value, ngx_atomic_int_t add) | |
102 { | |
103 ngx_atomic_uint_t old; | |
104 | |
105 __asm__ volatile ( | |
106 | |
107 NGX_SMP_LOCK | |
108 " xaddl %2, %1; " | |
109 | |
110 : "=a" (old) : "m" (*value), "a" (add) : "cc", "memory"); | |
111 | |
112 return old; | |
113 } | |
114 | |
115 #endif | |
112 | 116 |
117 | |
118 /* | |
119 * on x86 the write operations go in a program order, so we need only | |
120 * to disable the gcc reorder optimizations | |
121 */ | |
122 | |
123 #define ngx_memory_barrier() __asm__ volatile ("" ::: "memory") | |
160 | 124 |
125 /* old as does not support "pause" opcode */ | |
126 #define ngx_cpu_pause() __asm__ (".byte 0xf3, 0x90") |