diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2006-01-12 04:06:24 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-12 12:09:02 -0500 |
commit | 11c40f8a6ac8bd057043b1f9e7c9490c0e6149f3 (patch) | |
tree | 2086869126f3e327f96f41cb3b85a8f4399e2ef1 /include/asm-m68k | |
parent | ad9ec4f8de264903c6b5ba7ae8d8e96432188858 (diff) |
[PATCH] m68k: basic __user annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-m68k')
-rw-r--r-- | include/asm-m68k/uaccess.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/include/asm-m68k/uaccess.h b/include/asm-m68k/uaccess.h index f5cedf19cf68..a653bf80b848 100644 --- a/include/asm-m68k/uaccess.h +++ b/include/asm-m68k/uaccess.h | |||
@@ -42,6 +42,7 @@ struct exception_table_entry | |||
42 | ({ \ | 42 | ({ \ |
43 | int __pu_err; \ | 43 | int __pu_err; \ |
44 | typeof(*(ptr)) __pu_val = (x); \ | 44 | typeof(*(ptr)) __pu_val = (x); \ |
45 | __chk_user_ptr(ptr); \ | ||
45 | switch (sizeof (*(ptr))) { \ | 46 | switch (sizeof (*(ptr))) { \ |
46 | case 1: \ | 47 | case 1: \ |
47 | __put_user_asm(__pu_err, __pu_val, ptr, b); \ | 48 | __put_user_asm(__pu_err, __pu_val, ptr, b); \ |
@@ -91,6 +92,7 @@ __asm__ __volatile__ \ | |||
91 | ({ \ | 92 | ({ \ |
92 | int __gu_err; \ | 93 | int __gu_err; \ |
93 | typeof(*(ptr)) __gu_val; \ | 94 | typeof(*(ptr)) __gu_val; \ |
95 | __chk_user_ptr(ptr); \ | ||
94 | switch (sizeof(*(ptr))) { \ | 96 | switch (sizeof(*(ptr))) { \ |
95 | case 1: \ | 97 | case 1: \ |
96 | __get_user_asm(__gu_err, __gu_val, ptr, b, "=d"); \ | 98 | __get_user_asm(__gu_err, __gu_val, ptr, b, "=d"); \ |
@@ -105,7 +107,7 @@ __asm__ __volatile__ \ | |||
105 | __gu_err = __constant_copy_from_user(&__gu_val, ptr, 8); \ | 107 | __gu_err = __constant_copy_from_user(&__gu_val, ptr, 8); \ |
106 | break; \ | 108 | break; \ |
107 | default: \ | 109 | default: \ |
108 | __gu_val = 0; \ | 110 | __gu_val = (typeof(*(ptr)))0; \ |
109 | __gu_err = __get_user_bad(); \ | 111 | __gu_err = __get_user_bad(); \ |
110 | break; \ | 112 | break; \ |
111 | } \ | 113 | } \ |
@@ -134,7 +136,7 @@ __asm__ __volatile__ \ | |||
134 | : "m"(*(ptr)), "i" (-EFAULT), "0"(0)) | 136 | : "m"(*(ptr)), "i" (-EFAULT), "0"(0)) |
135 | 137 | ||
136 | static inline unsigned long | 138 | static inline unsigned long |
137 | __generic_copy_from_user(void *to, const void *from, unsigned long n) | 139 | __generic_copy_from_user(void *to, const void __user *from, unsigned long n) |
138 | { | 140 | { |
139 | unsigned long tmp; | 141 | unsigned long tmp; |
140 | __asm__ __volatile__ | 142 | __asm__ __volatile__ |
@@ -189,7 +191,7 @@ __generic_copy_from_user(void *to, const void *from, unsigned long n) | |||
189 | } | 191 | } |
190 | 192 | ||
191 | static inline unsigned long | 193 | static inline unsigned long |
192 | __generic_copy_to_user(void *to, const void *from, unsigned long n) | 194 | __generic_copy_to_user(void __user *to, const void *from, unsigned long n) |
193 | { | 195 | { |
194 | unsigned long tmp; | 196 | unsigned long tmp; |
195 | __asm__ __volatile__ | 197 | __asm__ __volatile__ |
@@ -264,7 +266,7 @@ __generic_copy_to_user(void *to, const void *from, unsigned long n) | |||
264 | : "d0", "memory") | 266 | : "d0", "memory") |
265 | 267 | ||
266 | static inline unsigned long | 268 | static inline unsigned long |
267 | __constant_copy_from_user(void *to, const void *from, unsigned long n) | 269 | __constant_copy_from_user(void *to, const void __user *from, unsigned long n) |
268 | { | 270 | { |
269 | switch (n) { | 271 | switch (n) { |
270 | case 0: | 272 | case 0: |
@@ -520,7 +522,7 @@ __constant_copy_from_user(void *to, const void *from, unsigned long n) | |||
520 | #define __copy_from_user_inatomic __copy_from_user | 522 | #define __copy_from_user_inatomic __copy_from_user |
521 | 523 | ||
522 | static inline unsigned long | 524 | static inline unsigned long |
523 | __constant_copy_to_user(void *to, const void *from, unsigned long n) | 525 | __constant_copy_to_user(void __user *to, const void *from, unsigned long n) |
524 | { | 526 | { |
525 | switch (n) { | 527 | switch (n) { |
526 | case 0: | 528 | case 0: |
@@ -766,7 +768,7 @@ __constant_copy_to_user(void *to, const void *from, unsigned long n) | |||
766 | */ | 768 | */ |
767 | 769 | ||
768 | static inline long | 770 | static inline long |
769 | strncpy_from_user(char *dst, const char *src, long count) | 771 | strncpy_from_user(char *dst, const char __user *src, long count) |
770 | { | 772 | { |
771 | long res; | 773 | long res; |
772 | if (count == 0) return count; | 774 | if (count == 0) return count; |
@@ -799,7 +801,7 @@ strncpy_from_user(char *dst, const char *src, long count) | |||
799 | * | 801 | * |
800 | * Return 0 on exception, a value greater than N if too long | 802 | * Return 0 on exception, a value greater than N if too long |
801 | */ | 803 | */ |
802 | static inline long strnlen_user(const char *src, long n) | 804 | static inline long strnlen_user(const char __user *src, long n) |
803 | { | 805 | { |
804 | long res; | 806 | long res; |
805 | 807 | ||
@@ -842,7 +844,7 @@ static inline long strnlen_user(const char *src, long n) | |||
842 | */ | 844 | */ |
843 | 845 | ||
844 | static inline unsigned long | 846 | static inline unsigned long |
845 | clear_user(void *to, unsigned long n) | 847 | clear_user(void __user *to, unsigned long n) |
846 | { | 848 | { |
847 | __asm__ __volatile__ | 849 | __asm__ __volatile__ |
848 | (" tstl %1\n" | 850 | (" tstl %1\n" |