diff options
author | Nicolas Pitre <nico@cam.org> | 2009-03-08 22:34:45 -0400 |
---|---|---|
committer | Nicolas Pitre <nico@cam.org> | 2009-05-29 22:34:45 -0400 |
commit | a1f98849fdf2f2fef3ef1c260178cd5fc662b773 (patch) | |
tree | 2d6825bc4a9a1eaaaaa7295c337c47b899bc7d72 /arch/arm/lib | |
parent | 59a3759d0fe8d969888c741bb33f4946e4d3750d (diff) |
[ARM] allow for alternative __copy_to_user/__clear_user implementations
This allows for optional alternative implementations of __copy_to_user
and __clear_user, with a possible runtime fallback to the standard
version when the alternative provides no gain over that standard
version. This is done by making the standard __copy_to_user into a weak
alias for the symbol __copy_to_user_std. Same thing for __clear_user.
Those two functions are particularly good candidates to have alternative
implementations for, since they rely on the STRT instruction which has
lower performances than STM instructions on some CPU cores such as
the ARM1176 and Marvell Feroceon.
Signed-off-by: Nicolas Pitre <nico@marvell.com>
Diffstat (limited to 'arch/arm/lib')
-rw-r--r-- | arch/arm/lib/clear_user.S | 3 | ||||
-rw-r--r-- | arch/arm/lib/copy_to_user.S | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/arch/arm/lib/clear_user.S b/arch/arm/lib/clear_user.S index 4d6bc71231f3..844f56785ebc 100644 --- a/arch/arm/lib/clear_user.S +++ b/arch/arm/lib/clear_user.S | |||
@@ -18,7 +18,8 @@ | |||
18 | * : sz - number of bytes to clear | 18 | * : sz - number of bytes to clear |
19 | * Returns : number of bytes NOT cleared | 19 | * Returns : number of bytes NOT cleared |
20 | */ | 20 | */ |
21 | ENTRY(__clear_user) | 21 | ENTRY(__clear_user_std) |
22 | WEAK(__clear_user) | ||
22 | stmfd sp!, {r1, lr} | 23 | stmfd sp!, {r1, lr} |
23 | mov r2, #0 | 24 | mov r2, #0 |
24 | cmp r1, #4 | 25 | cmp r1, #4 |
diff --git a/arch/arm/lib/copy_to_user.S b/arch/arm/lib/copy_to_user.S index 22f968bbdffd..878820f0a320 100644 --- a/arch/arm/lib/copy_to_user.S +++ b/arch/arm/lib/copy_to_user.S | |||
@@ -86,7 +86,8 @@ | |||
86 | 86 | ||
87 | .text | 87 | .text |
88 | 88 | ||
89 | ENTRY(__copy_to_user) | 89 | ENTRY(__copy_to_user_std) |
90 | WEAK(__copy_to_user) | ||
90 | 91 | ||
91 | #include "copy_template.S" | 92 | #include "copy_template.S" |
92 | 93 | ||