unicore32: get rid of zeroing and switch to RAW_COPY_USER
authorAl Viro <viro@zeniv.linux.org.uk>
Tue, 28 Mar 2017 05:37:07 +0000 (01:37 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 28 Mar 2017 22:24:04 +0000 (18:24 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/unicore32/Kconfig
arch/unicore32/include/asm/uaccess.h
arch/unicore32/kernel/ksyms.c
arch/unicore32/lib/copy_from_user.S
arch/unicore32/lib/copy_to_user.S

index 0769066929c636ecbaa78a9b9a0455aaa7f3abef..319519eaed246a3ec77ee2bdd670029776ecc8db 100644 (file)
@@ -18,6 +18,7 @@ config UNICORE32
        select ARCH_WANT_FRAME_POINTERS
        select GENERIC_IOMAP
        select MODULES_USE_ELF_REL
+       select ARCH_HAS_RAW_COPY_USER
        help
          UniCore-32 is 32-bit Instruction Set Architecture,
          including a series of low-power-consumption RISC chip
index b2bcab69dfeefcec7a3a698c77277469aae1dec1..1d55f2f8375917956b258845a3f2521cabd88fb5 100644 (file)
 #define __access_ok(addr, size)        (__kernel_ok || __user_ok((addr), (size)))
 
 extern unsigned long __must_check
-__copy_from_user(void *to, const void __user *from, unsigned long n);
+raw_copy_from_user(void *to, const void __user *from, unsigned long n);
 extern unsigned long __must_check
-__copy_to_user(void __user *to, const void *from, unsigned long n);
+raw_copy_to_user(void __user *to, const void *from, unsigned long n);
 extern unsigned long __must_check
 __clear_user(void __user *addr, unsigned long n);
 extern unsigned long __must_check
 __strncpy_from_user(char *to, const char __user *from, unsigned long count);
 extern unsigned long
 __strnlen_user(const char __user *s, long n);
+#define INLINE_COPY_FROM_USER
+#define INLINE_COPY_TO_USER
 
 #include <asm-generic/uaccess.h>
 
index 0323528a80fd48395f544a9d2387f0c3ce82e437..dcc72ee1fcdb09a0cff6d43d6b965984a9e2314a 100644 (file)
@@ -46,8 +46,8 @@ EXPORT_SYMBOL(__strncpy_from_user);
 
 EXPORT_SYMBOL(copy_page);
 
-EXPORT_SYMBOL(__copy_from_user);
-EXPORT_SYMBOL(__copy_to_user);
+EXPORT_SYMBOL(raw_copy_from_user);
+EXPORT_SYMBOL(raw_copy_to_user);
 EXPORT_SYMBOL(__clear_user);
 
 EXPORT_SYMBOL(__ashldi3);
index ab0767ea5dbd09733f1c2fa957141d6757affda8..5f80fcbe863152ec2a98199268b39aeaf00f632a 100644 (file)
@@ -16,7 +16,7 @@
 /*
  * Prototype:
  *
- *     size_t __copy_from_user(void *to, const void *from, size_t n)
+ *     size_t raw_copy_from_user(void *to, const void *from, size_t n)
  *
  * Purpose:
  *
 
        .text
 
-ENTRY(__copy_from_user)
+ENTRY(raw_copy_from_user)
 
 #include "copy_template.S"
 
-ENDPROC(__copy_from_user)
+ENDPROC(raw_copy_from_user)
 
        .pushsection .fixup,"ax"
        .align 0
        copy_abort_preamble
-       ldm.w   (r1, r2), [sp]+
-       sub     r3, r0, r1
-       rsub    r2, r3, r2
-       stw     r2, [sp]
-       mov     r1, #0
-       b.l     memset
-       ldw.w   r0, [sp]+, #4
+       ldm.w   (r1, r2, r3), [sp]+
+       sub     r0, r0, r1
+       rsub    r0, r0, r2
        copy_abort_end
        .popsection
 
index 6e22151c840d703e6ff336dd93c0fc633f476332..857c6816ffe783c0e6681a8fd14ea942f1706d3d 100644 (file)
@@ -16,7 +16,7 @@
 /*
  * Prototype:
  *
- *     size_t __copy_to_user(void *to, const void *from, size_t n)
+ *     size_t raw_copy_to_user(void *to, const void *from, size_t n)
  *
  * Purpose:
  *
 
        .text
 
-WEAK(__copy_to_user)
+WEAK(raw_copy_to_user)
 
 #include "copy_template.S"
 
-ENDPROC(__copy_to_user)
+ENDPROC(raw_copy_to_user)
 
        .pushsection .fixup,"ax"
        .align 0