aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/blackfin/Kconfig1
-rw-r--r--arch/blackfin/include/asm/uaccess.h26
2 files changed, 5 insertions, 22 deletions
diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig
index 3c1bd640042a..919dad1436f7 100644
--- a/arch/blackfin/Kconfig
+++ b/arch/blackfin/Kconfig
@@ -41,6 +41,7 @@ config BLACKFIN
41 select MODULES_USE_ELF_RELA 41 select MODULES_USE_ELF_RELA
42 select HAVE_DEBUG_STACKOVERFLOW 42 select HAVE_DEBUG_STACKOVERFLOW
43 select HAVE_NMI 43 select HAVE_NMI
44 select ARCH_HAS_RAW_COPY_USER
44 45
45config GENERIC_CSUM 46config GENERIC_CSUM
46 def_bool y 47 def_bool y
diff --git a/arch/blackfin/include/asm/uaccess.h b/arch/blackfin/include/asm/uaccess.h
index 9019cccf2aea..f54a34f31cea 100644
--- a/arch/blackfin/include/asm/uaccess.h
+++ b/arch/blackfin/include/asm/uaccess.h
@@ -144,41 +144,23 @@ static inline int bad_user_access_length(void)
144 : "a" (__ptr(ptr))); \ 144 : "a" (__ptr(ptr))); \
145}) 145})
146 146
147#define __copy_to_user_inatomic __copy_to_user
148#define __copy_from_user_inatomic __copy_from_user
149
150static inline unsigned long __must_check 147static inline unsigned long __must_check
151__copy_from_user(void *to, const void __user *from, unsigned long n) 148raw_copy_from_user(void *to, const void __user *from, unsigned long n)
152{ 149{
153 memcpy(to, (const void __force *)from, n); 150 memcpy(to, (const void __force *)from, n);
154 return 0; 151 return 0;
155} 152}
156 153
157static inline unsigned long __must_check 154static inline unsigned long __must_check
158__copy_to_user(void __user *to, const void *from, unsigned long n) 155raw_copy_to_user(void __user *to, const void *from, unsigned long n)
159{ 156{
160 memcpy((void __force *)to, from, n); 157 memcpy((void __force *)to, from, n);
161 SSYNC(); 158 SSYNC();
162 return 0; 159 return 0;
163} 160}
164 161
165static inline unsigned long __must_check 162#define INLINE_COPY_FROM_USER
166copy_from_user(void *to, const void __user *from, unsigned long n) 163#define INLINE_COPY_TO_USER
167{
168 if (likely(access_ok(VERIFY_READ, from, n)))
169 return __copy_from_user(to, from, n);
170 memset(to, 0, n);
171 return n;
172}
173
174static inline unsigned long __must_check
175copy_to_user(void __user *to, const void *from, unsigned long n)
176{
177 if (likely(access_ok(VERIFY_WRITE, to, n)))
178 return __copy_to_user(to, from, n);
179 return n;
180}
181
182/* 164/*
183 * Copy a null terminated string from userspace. 165 * Copy a null terminated string from userspace.
184 */ 166 */