annotate src/os/unix/ngx_gcc_atomic_sparc64.h @ 577:4d9ea73a627a release-0.3.10

nginx-0.3.10-RELEASE import *) Change: the "valid_referers" directive and the "$invalid_referer" variable were moved to the new ngx_http_referer_module from the ngx_http_rewrite_module. *) Change: the "$apache_bytes_sent" variable name was changed to "$body_bytes_sent". *) Feature: the "$sent_http_..." variables. *) Feature: the "if" directive supports the "=" and "!=" operations. *) Feature: the "proxy_pass" directive supports the HTTPS protocol. *) Feature: the "proxy_set_body" directive. *) Feature: the "post_action" directive. *) Feature: the ngx_http_empty_gif_module. *) Feature: the "worker_cpu_affinity" directive for Linux. *) Bugfix: the "rewrite" directive did not unescape URI part in redirect, now it is unescaped except the %00-%25 and %7F-%FF characters. *) Bugfix: nginx could not be built by the icc 9.0 compiler. *) Bugfix: if the SSI was enabled for zero size static file, then the chunked response was encoded incorrectly.
author Igor Sysoev <igor@sysoev.ru>
date Tue, 15 Nov 2005 13:30:52 +0000
parents 9c2f3ed7a247
children 3f8a2132b93d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
561
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
2 /*
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
3 * Copyright (C) Igor Sysoev
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
4 */
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
5
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
6
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
7 /*
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
8 * "casa [r1] 0x80, r2, r0" and
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
9 * "casxa [r1] 0x80, r2, r0" do the following:
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
10 *
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
11 * if ([r1] == r2) {
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
12 * swap(r0, [r1]);
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
13 * } else {
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
14 * r0 = [r1];
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
15 * }
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
16 *
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
17 * so "r0 == r2" means that the operation was successfull.
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
18 *
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
19 *
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
20 * The "r" means the general register.
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
21 * The "+r" means the general register used for both input and output.
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
22 */
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
23
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
24
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
25 #if (NGX_PTR_SIZE == 4)
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
26 #define NGX_CASA "casa"
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
27 #else
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
28 #define NGX_CASA "casxa"
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
29 #endif
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
30
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
31
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
32 static ngx_inline ngx_atomic_uint_t
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
33 ngx_atomic_cmp_set(ngx_atomic_t *lock, ngx_atomic_uint_t old,
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
34 ngx_atomic_uint_t set)
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
35 {
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
36 __asm__ volatile (
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
37
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
38 NGX_CASA " [%1] 0x80, %2, %0"
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
39
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
40 : "+r" (set) : "r" (lock), "r" (old) : "memory");
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
41
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
42 return (set == old);
577
4d9ea73a627a nginx-0.3.10-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 563
diff changeset
43 }
561
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
44
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
45
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
46 static ngx_inline ngx_atomic_int_t
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
47 ngx_atomic_fetch_add(ngx_atomic_t *value, ngx_atomic_int_t add)
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
48 {
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
49 ngx_atomic_uint_t old, res;
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
50
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
51 old = *value;
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
52
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
53 for ( ;; ) {
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
54
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
55 res = old + add;
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
56
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
57 __asm__ volatile (
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
58
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
59 NGX_CASA " [%1] 0x80, %2, %0"
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
60
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
61 : "+r" (res) : "r" (value), "r" (old) : "memory");
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
62
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
63 if (res == old) {
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
64 return res;
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
65 }
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
66
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
67 old = res;
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
68 }
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
69 }
563
9c2f3ed7a247 nginx-0.3.3-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 561
diff changeset
70
9c2f3ed7a247 nginx-0.3.3-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 561
diff changeset
71
9c2f3ed7a247 nginx-0.3.3-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 561
diff changeset
72 #if (NGX_SMP)
9c2f3ed7a247 nginx-0.3.3-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 561
diff changeset
73 #define ngx_memory_barrier() \
9c2f3ed7a247 nginx-0.3.3-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 561
diff changeset
74 __asm__ volatile ( \
9c2f3ed7a247 nginx-0.3.3-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 561
diff changeset
75 "membar #LoadLoad | #LoadStore | #StoreStore | #StoreLoad" \
9c2f3ed7a247 nginx-0.3.3-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 561
diff changeset
76 ::: "memory")
9c2f3ed7a247 nginx-0.3.3-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 561
diff changeset
77 #else
9c2f3ed7a247 nginx-0.3.3-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 561
diff changeset
78 #define ngx_memory_barrier() __asm__ volatile ("" ::: "memory")
9c2f3ed7a247 nginx-0.3.3-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents: 561
diff changeset
79 #endif