Commit dbd3c7e1bfb1e4319402eda23e04cc08dd26c50e

Authored by Jesper Nilsson
1 parent 82e6df1e86

CRIS: Export missing function symbols

strcmp was lost when all other string functions were removed,
but we still have an optimized version for this on CRISv32,
so any driver built as a module would not have access to this symbol.

In a similar manner, we had optimized versions of
csum_partial_copy_from_user and __do_clear_user
but no exported symbols for them, breaking bunch of other drivers
when built as a module.

At the same time, move EXPORT_SYMBOL(__copy_user) and
EXPORT_SYMBOL(__copy_user_zeroing) C-files so it's
located together with the function definition.

Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>

Showing 3 changed files with 19 additions and 19 deletions Side-by-side Diff

arch/cris/arch-v10/lib/usercopy.c
... ... @@ -30,8 +30,7 @@
30 30 /* Copy to userspace. This is based on the memcpy used for
31 31 kernel-to-kernel copying; see "string.c". */
32 32  
33   -unsigned long
34   -__copy_user (void __user *pdst, const void *psrc, unsigned long pn)
  33 +unsigned long __copy_user(void __user *pdst, const void *psrc, unsigned long pn)
35 34 {
36 35 /* We want the parameters put in special registers.
37 36 Make sure the compiler is able to make something useful of this.
38 37  
... ... @@ -187,13 +186,14 @@
187 186  
188 187 return retn;
189 188 }
  189 +EXPORT_SYMBOL(__copy_user);
190 190  
191 191 /* Copy from user to kernel, zeroing the bytes that were inaccessible in
192 192 userland. The return-value is the number of bytes that were
193 193 inaccessible. */
194 194  
195   -unsigned long
196   -__copy_user_zeroing(void *pdst, const void __user *psrc, unsigned long pn)
  195 +unsigned long __copy_user_zeroing(void *pdst, const void __user *psrc,
  196 + unsigned long pn)
197 197 {
198 198 /* We want the parameters put in special registers.
199 199 Make sure the compiler is able to make something useful of this.
200 200  
... ... @@ -369,11 +369,10 @@
369 369  
370 370 return retn + n;
371 371 }
  372 +EXPORT_SYMBOL(__copy_user_zeroing);
372 373  
373 374 /* Zero userspace. */
374   -
375   -unsigned long
376   -__do_clear_user (void __user *pto, unsigned long pn)
  375 +unsigned long __do_clear_user(void __user *pto, unsigned long pn)
377 376 {
378 377 /* We want the parameters put in special registers.
379 378 Make sure the compiler is able to make something useful of this.
... ... @@ -521,4 +520,5 @@
521 520  
522 521 return retn;
523 522 }
  523 +EXPORT_SYMBOL(__do_clear_user);
arch/cris/arch-v32/lib/usercopy.c
... ... @@ -26,8 +26,7 @@
26 26 /* Copy to userspace. This is based on the memcpy used for
27 27 kernel-to-kernel copying; see "string.c". */
28 28  
29   -unsigned long
30   -__copy_user (void __user *pdst, const void *psrc, unsigned long pn)
  29 +unsigned long __copy_user(void __user *pdst, const void *psrc, unsigned long pn)
31 30 {
32 31 /* We want the parameters put in special registers.
33 32 Make sure the compiler is able to make something useful of this.
34 33  
... ... @@ -155,13 +154,13 @@
155 154  
156 155 return retn;
157 156 }
  157 +EXPORT_SYMBOL(__copy_user);
158 158  
159 159 /* Copy from user to kernel, zeroing the bytes that were inaccessible in
160 160 userland. The return-value is the number of bytes that were
161 161 inaccessible. */
162   -
163   -unsigned long
164   -__copy_user_zeroing(void *pdst, const void __user *psrc, unsigned long pn)
  162 +unsigned long __copy_user_zeroing(void *pdst, const void __user *psrc,
  163 + unsigned long pn)
165 164 {
166 165 /* We want the parameters put in special registers.
167 166 Make sure the compiler is able to make something useful of this.
168 167  
... ... @@ -321,11 +320,10 @@
321 320  
322 321 return retn + n;
323 322 }
  323 +EXPORT_SYMBOL(__copy_user_zeroing);
324 324  
325 325 /* Zero userspace. */
326   -
327   -unsigned long
328   -__do_clear_user (void __user *pto, unsigned long pn)
  326 +unsigned long __do_clear_user(void __user *pto, unsigned long pn)
329 327 {
330 328 /* We want the parameters put in special registers.
331 329 Make sure the compiler is able to make something useful of this.
... ... @@ -468,4 +466,5 @@
468 466  
469 467 return retn;
470 468 }
  469 +EXPORT_SYMBOL(__do_clear_user);
arch/cris/kernel/crisksyms.c
... ... @@ -47,16 +47,16 @@
47 47 EXPORT_SYMBOL(__ioremap);
48 48 EXPORT_SYMBOL(iounmap);
49 49  
50   -/* Userspace access functions */
51   -EXPORT_SYMBOL(__copy_user_zeroing);
52   -EXPORT_SYMBOL(__copy_user);
53   -
54 50 #undef memcpy
55 51 #undef memset
56 52 extern void * memset(void *, int, __kernel_size_t);
57 53 extern void * memcpy(void *, const void *, __kernel_size_t);
58 54 EXPORT_SYMBOL(memcpy);
59 55 EXPORT_SYMBOL(memset);
  56 +#ifdef CONFIG_ETRAX_ARCH_V32
  57 +#undef strcmp
  58 +EXPORT_SYMBOL(strcmp);
  59 +#endif
60 60  
61 61 #ifdef CONFIG_ETRAX_FAST_TIMER
62 62 /* Fast timer functions */
... ... @@ -66,4 +66,5 @@
66 66 EXPORT_SYMBOL(schedule_usleep);
67 67 #endif
68 68 EXPORT_SYMBOL(csum_partial);
  69 +EXPORT_SYMBOL(csum_partial_copy_from_user);