aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/lib/Makefile2
-rw-r--r--arch/x86/lib/atomic64_32.c18
2 files changed, 19 insertions, 1 deletions
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
index c3c657c8bb83..07c31899c9c2 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -10,7 +10,7 @@ lib-y += usercopy_$(BITS).o getuser.o putuser.o
10lib-y += memcpy_$(BITS).o 10lib-y += memcpy_$(BITS).o
11 11
12ifeq ($(CONFIG_X86_32),y) 12ifeq ($(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 cd11803f9448..6722a092e407 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}
26EXPORT_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}
47EXPORT_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}
60EXPORT_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}
82EXPORT_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}
112EXPORT_SYMBOL(atomic64_add_return);
106 113
107u64 atomic64_sub_return(u64 delta, atomic64_t *ptr) 114u64 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}
118EXPORT_SYMBOL(atomic64_sub_return);
111 119
112u64 atomic64_inc_return(atomic64_t *ptr) 120u64 atomic64_inc_return(atomic64_t *ptr)
113{ 121{
114 return atomic64_add_return(1, ptr); 122 return atomic64_add_return(1, ptr);
115} 123}
124EXPORT_SYMBOL(atomic64_inc_return);
116 125
117u64 atomic64_dec_return(atomic64_t *ptr) 126u64 atomic64_dec_return(atomic64_t *ptr)
118{ 127{
119 return atomic64_sub_return(1, ptr); 128 return atomic64_sub_return(1, ptr);
120} 129}
130EXPORT_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}
143EXPORT_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}
156EXPORT_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}
173EXPORT_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}
185EXPORT_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}
197EXPORT_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}
211EXPORT_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}
225EXPORT_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}
242EXPORT_SYMBOL(atomic64_add_negative);