diff options
| -rw-r--r-- | arch/alpha/Kconfig | 1 | ||||
| -rw-r--r-- | arch/alpha/include/asm/uaccess.h | 33 |
2 files changed, 7 insertions, 27 deletions
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig index 0e49d39ea74a..1be5f61dc630 100644 --- a/arch/alpha/Kconfig +++ b/arch/alpha/Kconfig | |||
| @@ -26,6 +26,7 @@ config ALPHA | |||
| 26 | select ODD_RT_SIGACTION | 26 | select ODD_RT_SIGACTION |
| 27 | select OLD_SIGSUSPEND | 27 | select OLD_SIGSUSPEND |
| 28 | select CPU_NO_EFFICIENT_FFS if !ALPHA_EV67 | 28 | select CPU_NO_EFFICIENT_FFS if !ALPHA_EV67 |
| 29 | select ARCH_HAS_RAW_COPY_USER | ||
| 29 | help | 30 | help |
| 30 | The Alpha is a 64-bit general-purpose processor designed and | 31 | The Alpha is a 64-bit general-purpose processor designed and |
| 31 | marketed by the Digital Equipment Corporation of blessed memory, | 32 | marketed by the Digital Equipment Corporation of blessed memory, |
diff --git a/arch/alpha/include/asm/uaccess.h b/arch/alpha/include/asm/uaccess.h index 9557c12823a9..7b82dc9a8556 100644 --- a/arch/alpha/include/asm/uaccess.h +++ b/arch/alpha/include/asm/uaccess.h | |||
| @@ -300,37 +300,16 @@ __asm__ __volatile__("1: stb %r2,%1\n" \ | |||
| 300 | 300 | ||
| 301 | extern long __copy_user(void *to, const void *from, long len); | 301 | extern long __copy_user(void *to, const void *from, long len); |
| 302 | 302 | ||
| 303 | #define __copy_to_user(to, from, n) \ | 303 | static inline unsigned long |
| 304 | ({ \ | 304 | raw_copy_from_user(void *to, const void __user *from, unsigned long len) |
| 305 | __chk_user_ptr(to); \ | ||
| 306 | __copy_user((__force void *)(to), (from), (n)); \ | ||
| 307 | }) | ||
| 308 | #define __copy_from_user(to, from, n) \ | ||
| 309 | ({ \ | ||
| 310 | __chk_user_ptr(from); \ | ||
| 311 | __copy_user((to), (__force void *)(from), (n)); \ | ||
| 312 | }) | ||
| 313 | |||
| 314 | #define __copy_to_user_inatomic __copy_to_user | ||
| 315 | #define __copy_from_user_inatomic __copy_from_user | ||
| 316 | |||
| 317 | extern inline long | ||
| 318 | copy_to_user(void __user *to, const void *from, long n) | ||
| 319 | { | 305 | { |
| 320 | if (likely(__access_ok((unsigned long)to, n))) | 306 | return __copy_user(to, (__force const void *)from, len); |
| 321 | n = __copy_user((__force void *)to, from, n); | ||
| 322 | return n; | ||
| 323 | } | 307 | } |
| 324 | 308 | ||
| 325 | extern inline long | 309 | static inline unsigned long |
| 326 | copy_from_user(void *to, const void __user *from, long n) | 310 | raw_copy_to_user(void __user *to, const void *from, unsigned long len) |
| 327 | { | 311 | { |
| 328 | long res = n; | 312 | return __copy_user((__force void *)to, from, len); |
| 329 | if (likely(__access_ok((unsigned long)from, n))) | ||
| 330 | res = __copy_from_user_inatomic(to, from, n); | ||
| 331 | if (unlikely(res)) | ||
| 332 | memset(to + (n - res), 0, res); | ||
| 333 | return res; | ||
| 334 | } | 313 | } |
| 335 | 314 | ||
| 336 | extern long __clear_user(void __user *to, long len); | 315 | extern long __clear_user(void __user *to, long len); |
