diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-28 19:20:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-28 19:20:26 -0400 |
commit | 76a22271fd14e3fe7660f8646db12f0780fa4fd2 (patch) | |
tree | d0cf8ffb69c3d4030fa66c43662285f57bea12cb /include/asm-arm/uaccess.h | |
parent | fffcb480e4224f25c965b93fa65541bfc7dd732e (diff) | |
parent | e033108bf7e585755350b554048229d1fd10a02e (diff) |
Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm:
[ARM] 3672/1: PXA: don't probe output GPIOs for interrupt
[ARM] 3671/1: ep93xx: add cirrus logic edb9315 support
[ARM] 3370/2: ep93xx: add crunch support
[ARM] 3665/1: crunch: add ptrace support
[ARM] 3664/1: crunch: add signal frame save/restore
[ARM] 3663/1: fix resource->end off-by-one thinko during physmap conversion
[ARM] 3662/1: ixp23xx: don't include asm/hardware.h in uncompress.h
[ARM] 3660/1: Remove legacy defines
[ARM] 3661/1: S3C2412: Fix compilation if CPU_S3C2410 only
[ARM] 3658/1: S3C244X: Change usb-gadget name to s3c2440-usbgadget
[ARM] Remove the __arch_* layer from uaccess.h
Diffstat (limited to 'include/asm-arm/uaccess.h')
-rw-r--r-- | include/asm-arm/uaccess.h | 45 |
1 files changed, 13 insertions, 32 deletions
diff --git a/include/asm-arm/uaccess.h b/include/asm-arm/uaccess.h index 064f0f5e8e2b..f909dc75301a 100644 --- a/include/asm-arm/uaccess.h +++ b/include/asm-arm/uaccess.h | |||
@@ -353,66 +353,47 @@ do { \ | |||
353 | : "r" (x), "i" (-EFAULT) \ | 353 | : "r" (x), "i" (-EFAULT) \ |
354 | : "cc") | 354 | : "cc") |
355 | 355 | ||
356 | extern unsigned long __arch_copy_from_user(void *to, const void __user *from, unsigned long n); | 356 | |
357 | extern unsigned long __arch_copy_to_user(void __user *to, const void *from, unsigned long n); | 357 | extern unsigned long __copy_from_user(void *to, const void __user *from, unsigned long n); |
358 | extern unsigned long __arch_clear_user(void __user *addr, unsigned long n); | 358 | extern unsigned long __copy_to_user(void __user *to, const void *from, unsigned long n); |
359 | extern unsigned long __arch_strncpy_from_user(char *to, const char __user *from, unsigned long count); | 359 | extern unsigned long __clear_user(void __user *addr, unsigned long n); |
360 | extern unsigned long __arch_strnlen_user(const char __user *s, long n); | 360 | extern unsigned long __strncpy_from_user(char *to, const char __user *from, unsigned long count); |
361 | extern unsigned long __strnlen_user(const char __user *s, long n); | ||
361 | 362 | ||
362 | static inline unsigned long copy_from_user(void *to, const void __user *from, unsigned long n) | 363 | static inline unsigned long copy_from_user(void *to, const void __user *from, unsigned long n) |
363 | { | 364 | { |
364 | if (access_ok(VERIFY_READ, from, n)) | 365 | if (access_ok(VERIFY_READ, from, n)) |
365 | n = __arch_copy_from_user(to, from, n); | 366 | n = __copy_from_user(to, from, n); |
366 | else /* security hole - plug it */ | 367 | else /* security hole - plug it */ |
367 | memzero(to, n); | 368 | memzero(to, n); |
368 | return n; | 369 | return n; |
369 | } | 370 | } |
370 | 371 | ||
371 | static inline unsigned long __copy_from_user(void *to, const void __user *from, unsigned long n) | ||
372 | { | ||
373 | return __arch_copy_from_user(to, from, n); | ||
374 | } | ||
375 | |||
376 | static inline unsigned long copy_to_user(void __user *to, const void *from, unsigned long n) | 372 | static inline unsigned long copy_to_user(void __user *to, const void *from, unsigned long n) |
377 | { | 373 | { |
378 | if (access_ok(VERIFY_WRITE, to, n)) | 374 | if (access_ok(VERIFY_WRITE, to, n)) |
379 | n = __arch_copy_to_user(to, from, n); | 375 | n = __copy_to_user(to, from, n); |
380 | return n; | 376 | return n; |
381 | } | 377 | } |
382 | 378 | ||
383 | static inline unsigned long __copy_to_user(void __user *to, const void *from, unsigned long n) | ||
384 | { | ||
385 | return __arch_copy_to_user(to, from, n); | ||
386 | } | ||
387 | |||
388 | #define __copy_to_user_inatomic __copy_to_user | 379 | #define __copy_to_user_inatomic __copy_to_user |
389 | #define __copy_from_user_inatomic __copy_from_user | 380 | #define __copy_from_user_inatomic __copy_from_user |
390 | 381 | ||
391 | static inline unsigned long clear_user (void __user *to, unsigned long n) | 382 | static inline unsigned long clear_user(void __user *to, unsigned long n) |
392 | { | 383 | { |
393 | if (access_ok(VERIFY_WRITE, to, n)) | 384 | if (access_ok(VERIFY_WRITE, to, n)) |
394 | n = __arch_clear_user(to, n); | 385 | n = __clear_user(to, n); |
395 | return n; | 386 | return n; |
396 | } | 387 | } |
397 | 388 | ||
398 | static inline unsigned long __clear_user (void __user *to, unsigned long n) | 389 | static inline long strncpy_from_user(char *dst, const char __user *src, long count) |
399 | { | ||
400 | return __arch_clear_user(to, n); | ||
401 | } | ||
402 | |||
403 | static inline long strncpy_from_user (char *dst, const char __user *src, long count) | ||
404 | { | 390 | { |
405 | long res = -EFAULT; | 391 | long res = -EFAULT; |
406 | if (access_ok(VERIFY_READ, src, 1)) | 392 | if (access_ok(VERIFY_READ, src, 1)) |
407 | res = __arch_strncpy_from_user(dst, src, count); | 393 | res = __strncpy_from_user(dst, src, count); |
408 | return res; | 394 | return res; |
409 | } | 395 | } |
410 | 396 | ||
411 | static inline long __strncpy_from_user (char *dst, const char __user *src, long count) | ||
412 | { | ||
413 | return __arch_strncpy_from_user(dst, src, count); | ||
414 | } | ||
415 | |||
416 | #define strlen_user(s) strnlen_user(s, ~0UL >> 1) | 397 | #define strlen_user(s) strnlen_user(s, ~0UL >> 1) |
417 | 398 | ||
418 | static inline long strnlen_user(const char __user *s, long n) | 399 | static inline long strnlen_user(const char __user *s, long n) |
@@ -420,7 +401,7 @@ static inline long strnlen_user(const char __user *s, long n) | |||
420 | unsigned long res = 0; | 401 | unsigned long res = 0; |
421 | 402 | ||
422 | if (__addr_ok(s)) | 403 | if (__addr_ok(s)) |
423 | res = __arch_strnlen_user(s, n); | 404 | res = __strnlen_user(s, n); |
424 | 405 | ||
425 | return res; | 406 | return res; |
426 | } | 407 | } |