Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+19 -19
+7 -7
arch/cris/arch-v10/lib/usercopy.c
··· 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. ··· 186 187 187 188 return retn; 188 189 } 190 + EXPORT_SYMBOL(__copy_user); 189 191 190 192 /* Copy from user to kernel, zeroing the bytes that were inaccessible in 191 193 userland. The return-value is the number of bytes that were 192 194 inaccessible. */ 193 195 194 - unsigned long 195 - __copy_user_zeroing(void *pdst, const void __user *psrc, unsigned long pn) 196 + unsigned long __copy_user_zeroing(void *pdst, const void __user *psrc, 197 + unsigned long pn) 196 198 { 197 199 /* We want the parameters put in special registers. 198 200 Make sure the compiler is able to make something useful of this. ··· 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. ··· 520 521 521 522 return retn; 522 523 } 524 + EXPORT_SYMBOL(__do_clear_user);
+7 -8
arch/cris/arch-v32/lib/usercopy.c
··· 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. ··· 154 155 155 156 return retn; 156 157 } 158 + EXPORT_SYMBOL(__copy_user); 157 159 158 160 /* Copy from user to kernel, zeroing the bytes that were inaccessible in 159 161 userland. The return-value is the number of bytes that were 160 162 inaccessible. */ 161 - 162 - unsigned long 163 - __copy_user_zeroing(void *pdst, const void __user *psrc, unsigned long pn) 163 + unsigned long __copy_user_zeroing(void *pdst, const void __user *psrc, 164 + unsigned long pn) 164 165 { 165 166 /* We want the parameters put in special registers. 166 167 Make sure the compiler is able to make something useful of this. ··· 320 321 321 322 return retn + n; 322 323 } 324 + EXPORT_SYMBOL(__copy_user_zeroing); 323 325 324 326 /* Zero userspace. */ 325 - 326 - unsigned long 327 - __do_clear_user (void __user *pto, unsigned long pn) 327 + unsigned long __do_clear_user(void __user *pto, unsigned long pn) 328 328 { 329 329 /* We want the parameters put in special registers. 330 330 Make sure the compiler is able to make something useful of this. ··· 466 468 467 469 return retn; 468 470 } 471 + EXPORT_SYMBOL(__do_clear_user);
+5 -4
arch/cris/kernel/crisksyms.c
··· 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 66 EXPORT_SYMBOL(schedule_usleep); 67 67 #endif 68 68 EXPORT_SYMBOL(csum_partial); 69 + EXPORT_SYMBOL(csum_partial_copy_from_user);