diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-26 19:57:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-26 19:57:16 -0400 |
commit | 1e2aec873ad6d16538512dbb96853caa1fa076af (patch) | |
tree | d792b19ac47be44debd24610ae27f1330fa490e4 /arch/sparc/include/asm/uaccess_64.h | |
parent | ae32adc1e06d096399f195eeda12d443d53539c4 (diff) | |
parent | 2c66f623631709aa5f2e4c14c7e089682e7394a3 (diff) |
Merge branch 'generic-string-functions'
This makes <asm/word-at-a-time.h> actually live up to its promise of
allowing architectures to help tune the string functions that do their
work a word at a time.
David had already taken the x86 strncpy_from_user() function, modified
it to work on sparc, and then done the extra work to make it generically
useful. This then expands on that work by making x86 use that generic
version, completing the circle.
But more importantly, it fixes up the word-at-a-time interfaces so that
it's now easy to also support things like strnlen_user(), and pretty
much most random string functions.
David reports that it all works fine on sparc, and Jonas Bonn reported
that an earlier version of this worked on OpenRISC too. It's pretty
easy for architectures to add support for this and just replace their
private versions with the generic code.
* generic-string-functions:
sparc: use the new generic strnlen_user() function
x86: use the new generic strnlen_user() function
lib: add generic strnlen_user() function
word-at-a-time: make the interfaces truly generic
x86: use generic strncpy_from_user routine
Diffstat (limited to 'arch/sparc/include/asm/uaccess_64.h')
-rw-r--r-- | arch/sparc/include/asm/uaccess_64.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/sparc/include/asm/uaccess_64.h b/arch/sparc/include/asm/uaccess_64.h index dcdfb89cbf3f..7c831d848b4e 100644 --- a/arch/sparc/include/asm/uaccess_64.h +++ b/arch/sparc/include/asm/uaccess_64.h | |||
@@ -17,6 +17,8 @@ | |||
17 | 17 | ||
18 | #ifndef __ASSEMBLY__ | 18 | #ifndef __ASSEMBLY__ |
19 | 19 | ||
20 | #include <asm/processor.h> | ||
21 | |||
20 | /* | 22 | /* |
21 | * Sparc64 is segmented, though more like the M68K than the I386. | 23 | * Sparc64 is segmented, though more like the M68K than the I386. |
22 | * We use the secondary ASI to address user memory, which references a | 24 | * We use the secondary ASI to address user memory, which references a |
@@ -257,11 +259,9 @@ extern unsigned long __must_check __clear_user(void __user *, unsigned long); | |||
257 | 259 | ||
258 | #define clear_user __clear_user | 260 | #define clear_user __clear_user |
259 | 261 | ||
260 | extern long __strlen_user(const char __user *); | 262 | extern __must_check long strlen_user(const char __user *str); |
261 | extern long __strnlen_user(const char __user *, long len); | 263 | extern __must_check long strnlen_user(const char __user *str, long n); |
262 | 264 | ||
263 | #define strlen_user __strlen_user | ||
264 | #define strnlen_user __strnlen_user | ||
265 | #define __copy_to_user_inatomic ___copy_to_user | 265 | #define __copy_to_user_inatomic ___copy_to_user |
266 | #define __copy_from_user_inatomic ___copy_from_user | 266 | #define __copy_from_user_inatomic ___copy_from_user |
267 | 267 | ||