diff options
author | Roland Dreier <rdreier@cisco.com> | 2009-07-29 18:04:02 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-07-29 22:10:35 -0400 |
commit | 3fc7b4b220c7e830a5b3ce0ea5f85a635e0c50f0 (patch) | |
tree | f30750093bda1a0bd233b025f30891bf4010926d | |
parent | e4c6f8bed01f9f9a5c607bd689bf67e7b8a36bd8 (diff) |
lib: export generic atomic64_t functions
The generic atomic64_t implementation in lib/ did not export the functions
it defined, which means that modules that use atomic64_t would not link on
platforms (such as 32-bit powerpc). For example, trying to build a kernel
with CONFIG_NET_RDS on such a platform would fail with:
ERROR: "atomic64_read" [net/rds/rds.ko] undefined!
ERROR: "atomic64_set" [net/rds/rds.ko] undefined!
Fix this by exporting the atomic64_t functions to modules. (I export the
entire API even if it's not all currently used by in-tree modules to avoid
having to continue fixing this in dribs and drabs)
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Acked-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | lib/atomic64.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/atomic64.c b/lib/atomic64.c index c5e725562416..8bee16ec7524 100644 --- a/lib/atomic64.c +++ b/lib/atomic64.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/cache.h> | 13 | #include <linux/cache.h> |
14 | #include <linux/spinlock.h> | 14 | #include <linux/spinlock.h> |
15 | #include <linux/init.h> | 15 | #include <linux/init.h> |
16 | #include <linux/module.h> | ||
16 | #include <asm/atomic.h> | 17 | #include <asm/atomic.h> |
17 | 18 | ||
18 | /* | 19 | /* |
@@ -52,6 +53,7 @@ long long atomic64_read(const atomic64_t *v) | |||
52 | spin_unlock_irqrestore(lock, flags); | 53 | spin_unlock_irqrestore(lock, flags); |
53 | return val; | 54 | return val; |
54 | } | 55 | } |
56 | EXPORT_SYMBOL(atomic64_read); | ||
55 | 57 | ||
56 | void atomic64_set(atomic64_t *v, long long i) | 58 | void atomic64_set(atomic64_t *v, long long i) |
57 | { | 59 | { |
@@ -62,6 +64,7 @@ void atomic64_set(atomic64_t *v, long long i) | |||
62 | v->counter = i; | 64 | v->counter = i; |
63 | spin_unlock_irqrestore(lock, flags); | 65 | spin_unlock_irqrestore(lock, flags); |
64 | } | 66 | } |
67 | EXPORT_SYMBOL(atomic64_set); | ||
65 | 68 | ||
66 | void atomic64_add(long long a, atomic64_t *v) | 69 | void atomic64_add(long long a, atomic64_t *v) |
67 | { | 70 | { |
@@ -72,6 +75,7 @@ void atomic64_add(long long a, atomic64_t *v) | |||
72 | v->counter += a; | 75 | v->counter += a; |
73 | spin_unlock_irqrestore(lock, flags); | 76 | spin_unlock_irqrestore(lock, flags); |
74 | } | 77 | } |
78 | EXPORT_SYMBOL(atomic64_add); | ||
75 | 79 | ||
76 | long long atomic64_add_return(long long a, atomic64_t *v) | 80 | long long atomic64_add_return(long long a, atomic64_t *v) |
77 | { | 81 | { |
@@ -84,6 +88,7 @@ long long atomic64_add_return(long long a, atomic64_t *v) | |||
84 | spin_unlock_irqrestore(lock, flags); | 88 | spin_unlock_irqrestore(lock, flags); |
85 | return val; | 89 | return val; |
86 | } | 90 | } |
91 | EXPORT_SYMBOL(atomic64_add_return); | ||
87 | 92 | ||
88 | void atomic64_sub(long long a, atomic64_t *v) | 93 | void atomic64_sub(long long a, atomic64_t *v) |
89 | { | 94 | { |
@@ -94,6 +99,7 @@ void atomic64_sub(long long a, atomic64_t *v) | |||
94 | v->counter -= a; | 99 | v->counter -= a; |
95 | spin_unlock_irqrestore(lock, flags); | 100 | spin_unlock_irqrestore(lock, flags); |
96 | } | 101 | } |
102 | EXPORT_SYMBOL(atomic64_sub); | ||
97 | 103 | ||
98 | long long atomic64_sub_return(long long a, atomic64_t *v) | 104 | long long atomic64_sub_return(long long a, atomic64_t *v) |
99 | { | 105 | { |
@@ -106,6 +112,7 @@ long long atomic64_sub_return(long long a, atomic64_t *v) | |||
106 | spin_unlock_irqrestore(lock, flags); | 112 | spin_unlock_irqrestore(lock, flags); |
107 | return val; | 113 | return val; |
108 | } | 114 | } |
115 | EXPORT_SYMBOL(atomic64_sub_return); | ||
109 | 116 | ||
110 | long long atomic64_dec_if_positive(atomic64_t *v) | 117 | long long atomic64_dec_if_positive(atomic64_t *v) |
111 | { | 118 | { |
@@ -120,6 +127,7 @@ long long atomic64_dec_if_positive(atomic64_t *v) | |||
120 | spin_unlock_irqrestore(lock, flags); | 127 | spin_unlock_irqrestore(lock, flags); |
121 | return val; | 128 | return val; |
122 | } | 129 | } |
130 | EXPORT_SYMBOL(atomic64_dec_if_positive); | ||
123 | 131 | ||
124 | long long atomic64_cmpxchg(atomic64_t *v, long long o, long long n) | 132 | long long atomic64_cmpxchg(atomic64_t *v, long long o, long long n) |
125 | { | 133 | { |
@@ -134,6 +142,7 @@ long long atomic64_cmpxchg(atomic64_t *v, long long o, long long n) | |||
134 | spin_unlock_irqrestore(lock, flags); | 142 | spin_unlock_irqrestore(lock, flags); |
135 | return val; | 143 | return val; |
136 | } | 144 | } |
145 | EXPORT_SYMBOL(atomic64_cmpxchg); | ||
137 | 146 | ||
138 | long long atomic64_xchg(atomic64_t *v, long long new) | 147 | long long atomic64_xchg(atomic64_t *v, long long new) |
139 | { | 148 | { |
@@ -147,6 +156,7 @@ long long atomic64_xchg(atomic64_t *v, long long new) | |||
147 | spin_unlock_irqrestore(lock, flags); | 156 | spin_unlock_irqrestore(lock, flags); |
148 | return val; | 157 | return val; |
149 | } | 158 | } |
159 | EXPORT_SYMBOL(atomic64_xchg); | ||
150 | 160 | ||
151 | int atomic64_add_unless(atomic64_t *v, long long a, long long u) | 161 | int atomic64_add_unless(atomic64_t *v, long long a, long long u) |
152 | { | 162 | { |
@@ -162,6 +172,7 @@ int atomic64_add_unless(atomic64_t *v, long long a, long long u) | |||
162 | spin_unlock_irqrestore(lock, flags); | 172 | spin_unlock_irqrestore(lock, flags); |
163 | return ret; | 173 | return ret; |
164 | } | 174 | } |
175 | EXPORT_SYMBOL(atomic64_add_unless); | ||
165 | 176 | ||
166 | static int init_atomic64_lock(void) | 177 | static int init_atomic64_lock(void) |
167 | { | 178 | { |