Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
8cd920f2
Commit
8cd920f2
authored
Mar 19, 2017
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
m32r: get rid of zeroing
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
35f8acd5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
69 deletions
+6
-69
arch/m32r/include/asm/uaccess.h
arch/m32r/include/asm/uaccess.h
+1
-65
arch/m32r/lib/usercopy.c
arch/m32r/lib/usercopy.c
+5
-4
No files found.
arch/m32r/include/asm/uaccess.h
View file @
8cd920f2
...
...
@@ -460,77 +460,13 @@ do { \
: "r14", "memory"); \
} while (0)
#define __copy_user_zeroing(to, from, size) \
do { \
unsigned long __dst, __src, __c; \
__asm__ __volatile__ ( \
" mv r14, %0\n" \
" or r14, %1\n" \
" beq %0, %1, 9f\n" \
" beqz %2, 9f\n" \
" and3 r14, r14, #3\n" \
" bnez r14, 2f\n" \
" and3 %2, %2, #3\n" \
" beqz %3, 2f\n" \
" addi %0, #-4 ; word_copy \n" \
" .fillinsn\n" \
"0: ld r14, @%1+\n" \
" addi %3, #-1\n" \
" .fillinsn\n" \
"1: st r14, @+%0\n" \
" bnez %3, 0b\n" \
" beqz %2, 9f\n" \
" addi %0, #4\n" \
" .fillinsn\n" \
"2: ldb r14, @%1 ; byte_copy \n" \
" .fillinsn\n" \
"3: stb r14, @%0\n" \
" addi %1, #1\n" \
" addi %2, #-1\n" \
" addi %0, #1\n" \
" bnez %2, 2b\n" \
" .fillinsn\n" \
"9:\n" \
".section .fixup,\"ax\"\n" \
" .balign 4\n" \
"5: addi %3, #1\n" \
" addi %1, #-4\n" \
" .fillinsn\n" \
"6: slli %3, #2\n" \
" add %2, %3\n" \
" addi %0, #4\n" \
" .fillinsn\n" \
"7: ldi r14, #0 ; store zero \n" \
" .fillinsn\n" \
"8: addi %2, #-1\n" \
" stb r14, @%0 ; ACE? \n" \
" addi %0, #1\n" \
" bnez %2, 8b\n" \
" seth r14, #high(9b)\n" \
" or3 r14, r14, #low(9b)\n" \
" jmp r14\n" \
".previous\n" \
".section __ex_table,\"a\"\n" \
" .balign 4\n" \
" .long 0b,6b\n" \
" .long 1b,5b\n" \
" .long 2b,7b\n" \
" .long 3b,7b\n" \
".previous\n" \
: "=&r" (__dst), "=&r" (__src), "=&r" (size), \
"=&r" (__c) \
: "0" (to), "1" (from), "2" (size), "3" (size / 4) \
: "r14", "memory"); \
} while (0)
/* We let the __ versions of copy_from/to_user inline, because they're often
* used in fast paths and have only a small space overhead.
*/
static
inline
unsigned
long
__generic_copy_from_user_nocheck
(
void
*
to
,
const
void
__user
*
from
,
unsigned
long
n
)
{
__copy_user
_zeroing
(
to
,
from
,
n
);
__copy_user
(
to
,
from
,
n
);
return
n
;
}
...
...
arch/m32r/lib/usercopy.c
View file @
8cd920f2
...
...
@@ -23,12 +23,13 @@ __generic_copy_to_user(void __user *to, const void *from, unsigned long n)
unsigned
long
__generic_copy_from_user
(
void
*
to
,
const
void
__user
*
from
,
unsigned
long
n
)
{
unsigned
long
ret
=
n
;
prefetchw
(
to
);
if
(
access_ok
(
VERIFY_READ
,
from
,
n
))
__copy_user_zeroing
(
to
,
from
,
n
);
else
memset
(
to
,
0
,
n
);
return
n
;
ret
=
__copy_user
(
to
,
from
,
n
);
if
(
unlikely
(
ret
))
memset
(
to
+
n
-
ret
,
0
,
ret
);
return
ret
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment