X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=include%2Fasm-cris%2Fuaccess.h;h=ea11eaf0e922dfef1018ddae25fbee4625595e26;hb=82248a5e92793014d156a12dbcbba633794ce9f8;hp=7d50086eb5ea08a6de01e4f4f4f7735a2ec4eee0;hpb=0dd7f883a9e21c5f2ff5e8f1cbb0e78cdc044d8a;p=linux-2.6 diff --git a/include/asm-cris/uaccess.h b/include/asm-cris/uaccess.h index 7d50086eb5..ea11eaf0e9 100644 --- a/include/asm-cris/uaccess.h +++ b/include/asm-cris/uaccess.h @@ -1,43 +1,6 @@ /* * Authors: Bjorn Wesen (bjornw@axis.com) * Hans-Peter Nilsson (hp@axis.com) - * - * $Log: uaccess.h,v $ - * Revision 1.8 2001/10/29 13:01:48 bjornw - * Removed unused variable tmp2 in strnlen_user - * - * Revision 1.7 2001/10/02 12:44:52 hp - * Add support for 64-bit put_user/get_user - * - * Revision 1.6 2001/10/01 14:51:17 bjornw - * Added register prefixes and removed underscores - * - * Revision 1.5 2000/10/25 03:33:21 hp - * - Provide implementation for everything else but get_user and put_user; - * copying inline to/from user for constant length 0..16, 20, 24, and - * clearing for 0..4, 8, 12, 16, 20, 24, strncpy_from_user and strnlen_user - * always inline. - * - Constraints for destination addr in get_user cannot be memory, only reg. - * - Correct labels for PC at expected fault points. - * - Nits with assembly code. - * - Don't use statement expressions without value; use "do {} while (0)". - * - Return correct values from __generic_... functions. - * - * Revision 1.4 2000/09/12 16:28:25 bjornw - * * Removed comments from the get/put user asm code - * * Constrains for destination addr in put_user cannot be memory, only reg - * - * Revision 1.3 2000/09/12 14:30:20 bjornw - * MAX_ADDR_USER does not exist anymore - * - * Revision 1.2 2000/07/13 15:52:48 bjornw - * New user-access functions - * - * Revision 1.1.1.1 2000/07/10 16:32:31 bjornw - * CRIS architecture, working draft - * - * - * */ /* Asm:s have been tweaked (within the domain of correctness) to give @@ -209,11 +172,11 @@ extern long __get_user_bad(void); /* More complex functions. Most are inline, but some call functions that live in lib/usercopy.c */ -extern unsigned long __copy_user(void *to, const void *from, unsigned long n); -extern unsigned long __copy_user_zeroing(void *to, const void *from, unsigned long n); -extern unsigned long __do_clear_user(void *to, unsigned long n); +extern unsigned long __copy_user(void __user *to, const void *from, unsigned long n); +extern unsigned long __copy_user_zeroing(void *to, const void __user *from, unsigned long n); +extern unsigned long __do_clear_user(void __user *to, unsigned long n); -extern inline unsigned long +static inline unsigned long __generic_copy_to_user(void __user *to, const void *from, unsigned long n) { if (access_ok(VERIFY_WRITE, to, n)) @@ -221,7 +184,7 @@ __generic_copy_to_user(void __user *to, const void *from, unsigned long n) return n; } -extern inline unsigned long +static inline unsigned long __generic_copy_from_user(void *to, const void __user *from, unsigned long n) { if (access_ok(VERIFY_READ, from, n)) @@ -229,7 +192,7 @@ __generic_copy_from_user(void *to, const void __user *from, unsigned long n) return n; } -extern inline unsigned long +static inline unsigned long __generic_clear_user(void __user *to, unsigned long n) { if (access_ok(VERIFY_WRITE, to, n)) @@ -237,13 +200,13 @@ __generic_clear_user(void __user *to, unsigned long n) return n; } -extern inline long +static inline long __strncpy_from_user(char *dst, const char __user *src, long count) { return __do_strncpy_from_user(dst, src, count); } -extern inline long +static inline long strncpy_from_user(char *dst, const char __user *src, long count) { long res = -EFAULT; @@ -253,10 +216,10 @@ strncpy_from_user(char *dst, const char __user *src, long count) } -/* Note that if these expand awfully if made into switch constructs, so +/* Note that these expand awfully if made into switch constructs, so don't do that. */ -extern inline unsigned long +static inline unsigned long __constant_copy_from_user(void *to, const void __user *from, unsigned long n) { unsigned long ret = 0; @@ -306,7 +269,7 @@ __constant_copy_from_user(void *to, const void __user *from, unsigned long n) /* Ditto, don't make a switch out of this. */ -extern inline unsigned long +static inline unsigned long __constant_copy_to_user(void __user *to, const void *from, unsigned long n) { unsigned long ret = 0; @@ -356,7 +319,7 @@ __constant_copy_to_user(void __user *to, const void *from, unsigned long n) /* No switch, please. */ -extern inline unsigned long +static inline unsigned long __constant_clear_user(void __user *to, unsigned long n) { unsigned long ret = 0; @@ -406,20 +369,22 @@ __constant_clear_user(void __user *to, unsigned long n) * used in fast paths and have only a small space overhead. */ -extern inline unsigned long -__generic_copy_from_user_nocheck(void *to, const void *from, unsigned long n) +static inline unsigned long +__generic_copy_from_user_nocheck(void *to, const void __user *from, + unsigned long n) { return __copy_user_zeroing(to,from,n); } -extern inline unsigned long -__generic_copy_to_user_nocheck(void *to, const void *from, unsigned long n) +static inline unsigned long +__generic_copy_to_user_nocheck(void __user *to, const void *from, + unsigned long n) { return __copy_user(to,from,n); } -extern inline unsigned long -__generic_clear_user_nocheck(void *to, unsigned long n) +static inline unsigned long +__generic_clear_user_nocheck(void __user *to, unsigned long n) { return __do_clear_user(to,n); }