Commit d6cb6715 authored by Paul Burton's avatar Paul Burton Committed by Ralf Baechle

MIPS: Export string functions alongside their definitions

Now that EXPORT_SYMBOL can be used from assembly source, move the
EXPORT_SYMBOL invocations for the strlen*, strnlen* & strncpy* functions
to be alongside their definitions.
Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/14513/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 23130042
...@@ -19,20 +19,6 @@ ...@@ -19,20 +19,6 @@
extern void *__bzero_kernel(void *__s, size_t __count); extern void *__bzero_kernel(void *__s, size_t __count);
extern void *__bzero(void *__s, size_t __count); extern void *__bzero(void *__s, size_t __count);
extern long __strncpy_from_kernel_nocheck_asm(char *__to,
const char *__from, long __len);
extern long __strncpy_from_kernel_asm(char *__to, const char *__from,
long __len);
extern long __strncpy_from_user_nocheck_asm(char *__to,
const char *__from, long __len);
extern long __strncpy_from_user_asm(char *__to, const char *__from,
long __len);
extern long __strlen_kernel_asm(const char *s);
extern long __strlen_user_asm(const char *s);
extern long __strnlen_kernel_nocheck_asm(const char *s);
extern long __strnlen_kernel_asm(const char *s);
extern long __strnlen_user_nocheck_asm(const char *s);
extern long __strnlen_user_asm(const char *s);
/* /*
* String functions * String functions
...@@ -60,13 +46,3 @@ EXPORT_SYMBOL(__copy_user_inatomic_eva); ...@@ -60,13 +46,3 @@ EXPORT_SYMBOL(__copy_user_inatomic_eva);
EXPORT_SYMBOL(__bzero_kernel); EXPORT_SYMBOL(__bzero_kernel);
#endif #endif
EXPORT_SYMBOL(__bzero); EXPORT_SYMBOL(__bzero);
EXPORT_SYMBOL(__strncpy_from_kernel_nocheck_asm);
EXPORT_SYMBOL(__strncpy_from_kernel_asm);
EXPORT_SYMBOL(__strncpy_from_user_nocheck_asm);
EXPORT_SYMBOL(__strncpy_from_user_asm);
EXPORT_SYMBOL(__strlen_kernel_asm);
EXPORT_SYMBOL(__strlen_user_asm);
EXPORT_SYMBOL(__strnlen_kernel_nocheck_asm);
EXPORT_SYMBOL(__strnlen_kernel_asm);
EXPORT_SYMBOL(__strnlen_user_nocheck_asm);
EXPORT_SYMBOL(__strnlen_user_asm);
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
*/ */
#include <asm/asm.h> #include <asm/asm.h>
#include <asm/asm-offsets.h> #include <asm/asm-offsets.h>
#include <asm/export.h>
#include <asm/regdef.h> #include <asm/regdef.h>
#define EX(insn,reg,addr,handler) \ #define EX(insn,reg,addr,handler) \
...@@ -24,6 +25,7 @@ ...@@ -24,6 +25,7 @@
*/ */
.macro __BUILD_STRLEN_ASM func .macro __BUILD_STRLEN_ASM func
LEAF(__strlen_\func\()_asm) LEAF(__strlen_\func\()_asm)
EXPORT_SYMBOL(__strlen_\func\()_asm)
LONG_L v0, TI_ADDR_LIMIT($28) # pointer ok? LONG_L v0, TI_ADDR_LIMIT($28) # pointer ok?
and v0, a0 and v0, a0
bnez v0, .Lfault\@ bnez v0, .Lfault\@
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <linux/errno.h> #include <linux/errno.h>
#include <asm/asm.h> #include <asm/asm.h>
#include <asm/asm-offsets.h> #include <asm/asm-offsets.h>
#include <asm/export.h>
#include <asm/regdef.h> #include <asm/regdef.h>
#define EX(insn,reg,addr,handler) \ #define EX(insn,reg,addr,handler) \
...@@ -30,11 +31,13 @@ ...@@ -30,11 +31,13 @@
.macro __BUILD_STRNCPY_ASM func .macro __BUILD_STRNCPY_ASM func
LEAF(__strncpy_from_\func\()_asm) LEAF(__strncpy_from_\func\()_asm)
EXPORT_SYMBOL(__strncpy_from_\func\()_asm)
LONG_L v0, TI_ADDR_LIMIT($28) # pointer ok? LONG_L v0, TI_ADDR_LIMIT($28) # pointer ok?
and v0, a1 and v0, a1
bnez v0, .Lfault\@ bnez v0, .Lfault\@
FEXPORT(__strncpy_from_\func\()_nocheck_asm) FEXPORT(__strncpy_from_\func\()_nocheck_asm)
EXPORT_SYMBOL(__strncpy_from_\func\()_nocheck_asm)
move t0, zero move t0, zero
move v1, a1 move v1, a1
.ifeqs "\func","kernel" .ifeqs "\func","kernel"
...@@ -72,6 +75,8 @@ FEXPORT(__strncpy_from_\func\()_nocheck_asm) ...@@ -72,6 +75,8 @@ FEXPORT(__strncpy_from_\func\()_nocheck_asm)
.global __strncpy_from_user_nocheck_asm .global __strncpy_from_user_nocheck_asm
.set __strncpy_from_user_asm, __strncpy_from_kernel_asm .set __strncpy_from_user_asm, __strncpy_from_kernel_asm
.set __strncpy_from_user_nocheck_asm, __strncpy_from_kernel_nocheck_asm .set __strncpy_from_user_nocheck_asm, __strncpy_from_kernel_nocheck_asm
EXPORT_SYMBOL(__strncpy_from_user_asm)
EXPORT_SYMBOL(__strncpy_from_user_nocheck_asm)
#endif #endif
__BUILD_STRNCPY_ASM kernel __BUILD_STRNCPY_ASM kernel
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
*/ */
#include <asm/asm.h> #include <asm/asm.h>
#include <asm/asm-offsets.h> #include <asm/asm-offsets.h>
#include <asm/export.h>
#include <asm/regdef.h> #include <asm/regdef.h>
#define EX(insn,reg,addr,handler) \ #define EX(insn,reg,addr,handler) \
...@@ -27,11 +28,13 @@ ...@@ -27,11 +28,13 @@
*/ */
.macro __BUILD_STRNLEN_ASM func .macro __BUILD_STRNLEN_ASM func
LEAF(__strnlen_\func\()_asm) LEAF(__strnlen_\func\()_asm)
EXPORT_SYMBOL(__strnlen_\func\()_asm)
LONG_L v0, TI_ADDR_LIMIT($28) # pointer ok? LONG_L v0, TI_ADDR_LIMIT($28) # pointer ok?
and v0, a0 and v0, a0
bnez v0, .Lfault\@ bnez v0, .Lfault\@
FEXPORT(__strnlen_\func\()_nocheck_asm) FEXPORT(__strnlen_\func\()_nocheck_asm)
EXPORT_SYMBOL(__strnlen_\func\()_nocheck_asm)
move v0, a0 move v0, a0
PTR_ADDU a1, a0 # stop pointer PTR_ADDU a1, a0 # stop pointer
1: 1:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment