summaryrefslogtreecommitdiff
path: root/arch/microblaze/lib
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2020-01-16 15:58:41 +0100
committerArnd Bergmann <arnd@arndb.de>2021-07-27 23:01:13 +0200
commitb26b181651f3214fa2383411fb85029b7f3e1788 (patch)
tree06163a94c86fc93e2c7ef7c70caeb651b8da2859 /arch/microblaze/lib
parent0cd1151886933d4845db02b3d09ad4df62d44c50 (diff)
microblaze: use generic strncpy/strnlen from_user
Remove the microblaze implemenation of strncpy/strnlen and instead use the generic versions. The microblaze version is fairly slow because it always does byte accesses even for aligned data, and it lacks a checks for user_addr_max(). Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/microblaze/lib')
-rw-r--r--arch/microblaze/lib/uaccess_old.S90
1 files changed, 0 insertions, 90 deletions
diff --git a/arch/microblaze/lib/uaccess_old.S b/arch/microblaze/lib/uaccess_old.S
index eca290090038..dd5f3bfbc2c5 100644
--- a/arch/microblaze/lib/uaccess_old.S
+++ b/arch/microblaze/lib/uaccess_old.S
@@ -12,96 +12,6 @@
#include <linux/linkage.h>
#include <asm/page.h>
-/*
- * int __strncpy_user(char *to, char *from, int len);
- *
- * Returns:
- * -EFAULT for an exception
- * len if we hit the buffer limit
- * bytes copied
- */
-
- .text
-.globl __strncpy_user;
-.type __strncpy_user, @function
-.align 4;
-__strncpy_user:
-
- /*
- * r5 - to
- * r6 - from
- * r7 - len
- * r3 - temp count
- * r4 - temp val
- */
- beqid r7,3f
- addik r3,r7,0 /* temp_count = len */
-1:
- lbu r4,r6,r0
- beqid r4,2f
- sb r4,r5,r0
-
- addik r5,r5,1
- addik r6,r6,1 /* delay slot */
-
- addik r3,r3,-1
- bnei r3,1b /* break on len */
-2:
- rsubk r3,r3,r7 /* temp_count = len - temp_count */
-3:
- rtsd r15,8
- nop
- .size __strncpy_user, . - __strncpy_user
-
- .section .fixup, "ax"
- .align 2
-4:
- brid 3b
- addik r3,r0, -EFAULT
-
- .section __ex_table, "a"
- .word 1b,4b
-
-/*
- * int __strnlen_user(char __user *str, int maxlen);
- *
- * Returns:
- * 0 on error
- * maxlen + 1 if no NUL byte found within maxlen bytes
- * size of the string (including NUL byte)
- */
-
- .text
-.globl __strnlen_user;
-.type __strnlen_user, @function
-.align 4;
-__strnlen_user:
- beqid r6,3f
- addik r3,r6,0
-1:
- lbu r4,r5,r0
- beqid r4,2f /* break on NUL */
- addik r3,r3,-1 /* delay slot */
-
- bneid r3,1b
- addik r5,r5,1 /* delay slot */
-
- addik r3,r3,-1 /* for break on len */
-2:
- rsubk r3,r3,r6
-3:
- rtsd r15,8
- nop
- .size __strnlen_user, . - __strnlen_user
-
- .section .fixup,"ax"
-4:
- brid 3b
- addk r3,r0,r0
-
- .section __ex_table,"a"
- .word 1b,4b
-
/* Loop unrolling for __copy_tofrom_user */
#define COPY(offset) \
1: lwi r4 , r6, 0x0000 + offset; \