diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-07-03 11:28:57 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-07-03 14:23:52 -0400 |
commit | 1fde902d52ee13ab9fab155bbae757fdf7daf0c1 (patch) | |
tree | 79051f92959ab31aa26d0b13a8cb2b931e77b34a /arch/x86/lib | |
parent | 67d7178f8fc64b7f68d7dd8a1b21dfa0d42c220c (diff) |
x86: atomic64: Export APIs to modules
atomic64_t primitives are used by a handful of drivers,
so export the APIs consistently. These were inlined
before.
Also mark atomic64_32.o a core object, so that the symbols
are available even if not linked to core kernel pieces.
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>
LKML-Reference: <tip-05118ab8859492ac9ddda0154cf90e37b0a4a0b0@git.kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/lib')
-rw-r--r-- | arch/x86/lib/Makefile | 2 | ||||
-rw-r--r-- | arch/x86/lib/atomic64_32.c | 18 |
2 files changed, 19 insertions, 1 deletions
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile index c3c657c8bb8..07c31899c9c 100644 --- a/arch/x86/lib/Makefile +++ b/arch/x86/lib/Makefile | |||
@@ -10,7 +10,7 @@ lib-y += usercopy_$(BITS).o getuser.o putuser.o | |||
10 | lib-y += memcpy_$(BITS).o | 10 | lib-y += memcpy_$(BITS).o |
11 | 11 | ||
12 | ifeq ($(CONFIG_X86_32),y) | 12 | ifeq ($(CONFIG_X86_32),y) |
13 | lib-y += atomic64_32.o | 13 | obj-y += atomic64_32.o |
14 | lib-y += checksum_32.o | 14 | lib-y += checksum_32.o |
15 | lib-y += strstr_32.o | 15 | lib-y += strstr_32.o |
16 | lib-y += semaphore_32.o string_32.o | 16 | lib-y += semaphore_32.o string_32.o |
diff --git a/arch/x86/lib/atomic64_32.c b/arch/x86/lib/atomic64_32.c index cd11803f944..6722a092e40 100644 --- a/arch/x86/lib/atomic64_32.c +++ b/arch/x86/lib/atomic64_32.c | |||
@@ -1,5 +1,7 @@ | |||
1 | #include <linux/compiler.h> | 1 | #include <linux/compiler.h> |
2 | #include <linux/module.h> | ||
2 | #include <linux/types.h> | 3 | #include <linux/types.h> |
4 | |||
3 | #include <asm/processor.h> | 5 | #include <asm/processor.h> |
4 | #include <asm/cmpxchg.h> | 6 | #include <asm/cmpxchg.h> |
5 | #include <asm/atomic.h> | 7 | #include <asm/atomic.h> |
@@ -21,6 +23,7 @@ u64 atomic64_cmpxchg(atomic64_t *ptr, u64 old_val, u64 new_val) | |||
21 | { | 23 | { |
22 | return cmpxchg8b(&ptr->counter, old_val, new_val); | 24 | return cmpxchg8b(&ptr->counter, old_val, new_val); |
23 | } | 25 | } |
26 | EXPORT_SYMBOL(atomic64_cmpxchg); | ||
24 | 27 | ||
25 | /** | 28 | /** |
26 | * atomic64_xchg - xchg atomic64 variable | 29 | * atomic64_xchg - xchg atomic64 variable |
@@ -41,6 +44,7 @@ u64 atomic64_xchg(atomic64_t *ptr, u64 new_val) | |||
41 | 44 | ||
42 | return old_val; | 45 | return old_val; |
43 | } | 46 | } |
47 | EXPORT_SYMBOL(atomic64_xchg); | ||
44 | 48 | ||
45 | /** | 49 | /** |
46 | * atomic64_set - set atomic64 variable | 50 | * atomic64_set - set atomic64 variable |
@@ -53,6 +57,7 @@ void atomic64_set(atomic64_t *ptr, u64 new_val) | |||
53 | { | 57 | { |
54 | atomic64_xchg(ptr, new_val); | 58 | atomic64_xchg(ptr, new_val); |
55 | } | 59 | } |
60 | EXPORT_SYMBOL(atomic64_read); | ||
56 | 61 | ||
57 | /** | 62 | /** |
58 | * atomic64_read - read atomic64 variable | 63 | * atomic64_read - read atomic64 variable |
@@ -74,6 +79,7 @@ u64 atomic64_read(atomic64_t *ptr) | |||
74 | 79 | ||
75 | return res; | 80 | return res; |
76 | } | 81 | } |
82 | EXPORT_SYMBOL(atomic64_read); | ||
77 | 83 | ||
78 | /** | 84 | /** |
79 | * atomic64_add_return - add and return | 85 | * atomic64_add_return - add and return |
@@ -103,21 +109,25 @@ noinline u64 atomic64_add_return(u64 delta, atomic64_t *ptr) | |||
103 | 109 | ||
104 | return new_val; | 110 | return new_val; |
105 | } | 111 | } |
112 | EXPORT_SYMBOL(atomic64_add_return); | ||
106 | 113 | ||
107 | u64 atomic64_sub_return(u64 delta, atomic64_t *ptr) | 114 | u64 atomic64_sub_return(u64 delta, atomic64_t *ptr) |
108 | { | 115 | { |
109 | return atomic64_add_return(-delta, ptr); | 116 | return atomic64_add_return(-delta, ptr); |
110 | } | 117 | } |
118 | EXPORT_SYMBOL(atomic64_sub_return); | ||
111 | 119 | ||
112 | u64 atomic64_inc_return(atomic64_t *ptr) | 120 | u64 atomic64_inc_return(atomic64_t *ptr) |
113 | { | 121 | { |
114 | return atomic64_add_return(1, ptr); | 122 | return atomic64_add_return(1, ptr); |
115 | } | 123 | } |
124 | EXPORT_SYMBOL(atomic64_inc_return); | ||
116 | 125 | ||
117 | u64 atomic64_dec_return(atomic64_t *ptr) | 126 | u64 atomic64_dec_return(atomic64_t *ptr) |
118 | { | 127 | { |
119 | return atomic64_sub_return(1, ptr); | 128 | return atomic64_sub_return(1, ptr); |
120 | } | 129 | } |
130 | EXPORT_SYMBOL(atomic64_dec_return); | ||
121 | 131 | ||
122 | /** | 132 | /** |
123 | * atomic64_add - add integer to atomic64 variable | 133 | * atomic64_add - add integer to atomic64 variable |
@@ -130,6 +140,7 @@ void atomic64_add(u64 delta, atomic64_t *ptr) | |||
130 | { | 140 | { |
131 | atomic64_add_return(delta, ptr); | 141 | atomic64_add_return(delta, ptr); |
132 | } | 142 | } |
143 | EXPORT_SYMBOL(atomic64_add); | ||
133 | 144 | ||
134 | /** | 145 | /** |
135 | * atomic64_sub - subtract the atomic64 variable | 146 | * atomic64_sub - subtract the atomic64 variable |
@@ -142,6 +153,7 @@ void atomic64_sub(u64 delta, atomic64_t *ptr) | |||
142 | { | 153 | { |
143 | atomic64_add(-delta, ptr); | 154 | atomic64_add(-delta, ptr); |
144 | } | 155 | } |
156 | EXPORT_SYMBOL(atomic64_sub); | ||
145 | 157 | ||
146 | /** | 158 | /** |
147 | * atomic64_sub_and_test - subtract value from variable and test result | 159 | * atomic64_sub_and_test - subtract value from variable and test result |
@@ -158,6 +170,7 @@ int atomic64_sub_and_test(u64 delta, atomic64_t *ptr) | |||
158 | 170 | ||
159 | return old_val == 0; | 171 | return old_val == 0; |
160 | } | 172 | } |
173 | EXPORT_SYMBOL(atomic64_sub_and_test); | ||
161 | 174 | ||
162 | /** | 175 | /** |
163 | * atomic64_inc - increment atomic64 variable | 176 | * atomic64_inc - increment atomic64 variable |
@@ -169,6 +182,7 @@ void atomic64_inc(atomic64_t *ptr) | |||
169 | { | 182 | { |
170 | atomic64_add(1, ptr); | 183 | atomic64_add(1, ptr); |
171 | } | 184 | } |
185 | EXPORT_SYMBOL(atomic64_inc); | ||
172 | 186 | ||
173 | /** | 187 | /** |
174 | * atomic64_dec - decrement atomic64 variable | 188 | * atomic64_dec - decrement atomic64 variable |
@@ -180,6 +194,7 @@ void atomic64_dec(atomic64_t *ptr) | |||
180 | { | 194 | { |
181 | atomic64_sub(1, ptr); | 195 | atomic64_sub(1, ptr); |
182 | } | 196 | } |
197 | EXPORT_SYMBOL(atomic64_dec); | ||
183 | 198 | ||
184 | /** | 199 | /** |
185 | * atomic64_dec_and_test - decrement and test | 200 | * atomic64_dec_and_test - decrement and test |
@@ -193,6 +208,7 @@ int atomic64_dec_and_test(atomic64_t *ptr) | |||
193 | { | 208 | { |
194 | return atomic64_sub_and_test(1, ptr); | 209 | return atomic64_sub_and_test(1, ptr); |
195 | } | 210 | } |
211 | EXPORT_SYMBOL(atomic64_dec_and_test); | ||
196 | 212 | ||
197 | /** | 213 | /** |
198 | * atomic64_inc_and_test - increment and test | 214 | * atomic64_inc_and_test - increment and test |
@@ -206,6 +222,7 @@ int atomic64_inc_and_test(atomic64_t *ptr) | |||
206 | { | 222 | { |
207 | return atomic64_sub_and_test(-1, ptr); | 223 | return atomic64_sub_and_test(-1, ptr); |
208 | } | 224 | } |
225 | EXPORT_SYMBOL(atomic64_inc_and_test); | ||
209 | 226 | ||
210 | /** | 227 | /** |
211 | * atomic64_add_negative - add and test if negative | 228 | * atomic64_add_negative - add and test if negative |
@@ -222,3 +239,4 @@ int atomic64_add_negative(u64 delta, atomic64_t *ptr) | |||
222 | 239 | ||
223 | return old_val < 0; | 240 | return old_val < 0; |
224 | } | 241 | } |
242 | EXPORT_SYMBOL(atomic64_add_negative); | ||