aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/lib/uaccess_pt.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/lib/uaccess_pt.c')
-rw-r--r--arch/s390/lib/uaccess_pt.c31
1 files changed, 9 insertions, 22 deletions
diff --git a/arch/s390/lib/uaccess_pt.c b/arch/s390/lib/uaccess_pt.c
index 2fa696b39b56..b49c3a440a24 100644
--- a/arch/s390/lib/uaccess_pt.c
+++ b/arch/s390/lib/uaccess_pt.c
@@ -211,7 +211,7 @@ fault:
211 return 0; 211 return 0;
212} 212}
213 213
214static size_t copy_from_user_pt(void *to, const void __user *from, size_t n) 214size_t copy_from_user_pt(void *to, const void __user *from, size_t n)
215{ 215{
216 size_t rc; 216 size_t rc;
217 217
@@ -223,14 +223,14 @@ static size_t copy_from_user_pt(void *to, const void __user *from, size_t n)
223 return rc; 223 return rc;
224} 224}
225 225
226static size_t copy_to_user_pt(void __user *to, const void *from, size_t n) 226size_t copy_to_user_pt(void __user *to, const void *from, size_t n)
227{ 227{
228 if (segment_eq(get_fs(), KERNEL_DS)) 228 if (segment_eq(get_fs(), KERNEL_DS))
229 return copy_in_kernel(to, (void __user *) from, n); 229 return copy_in_kernel(to, (void __user *) from, n);
230 return __user_copy_pt((unsigned long) to, (void *) from, n, 1); 230 return __user_copy_pt((unsigned long) to, (void *) from, n, 1);
231} 231}
232 232
233static size_t clear_user_pt(void __user *to, size_t n) 233size_t clear_user_pt(void __user *to, size_t n)
234{ 234{
235 void *zpage = (void *) empty_zero_page; 235 void *zpage = (void *) empty_zero_page;
236 long done, size, ret; 236 long done, size, ret;
@@ -253,7 +253,7 @@ static size_t clear_user_pt(void __user *to, size_t n)
253 return 0; 253 return 0;
254} 254}
255 255
256static size_t strnlen_user_pt(const char __user *src, size_t count) 256size_t strnlen_user_pt(const char __user *src, size_t count)
257{ 257{
258 unsigned long uaddr = (unsigned long) src; 258 unsigned long uaddr = (unsigned long) src;
259 struct mm_struct *mm = current->mm; 259 struct mm_struct *mm = current->mm;
@@ -289,8 +289,7 @@ fault:
289 goto retry; 289 goto retry;
290} 290}
291 291
292static size_t strncpy_from_user_pt(char *dst, const char __user *src, 292size_t strncpy_from_user_pt(char *dst, const char __user *src, size_t count)
293 size_t count)
294{ 293{
295 size_t done, len, offset, len_str; 294 size_t done, len, offset, len_str;
296 295
@@ -315,8 +314,7 @@ static size_t strncpy_from_user_pt(char *dst, const char __user *src,
315 return done; 314 return done;
316} 315}
317 316
318static size_t copy_in_user_pt(void __user *to, const void __user *from, 317size_t copy_in_user_pt(void __user *to, const void __user *from, size_t n)
319 size_t n)
320{ 318{
321 struct mm_struct *mm = current->mm; 319 struct mm_struct *mm = current->mm;
322 unsigned long offset_max, uaddr, done, size, error_code; 320 unsigned long offset_max, uaddr, done, size, error_code;
@@ -411,7 +409,7 @@ static int __futex_atomic_op_pt(int op, u32 __user *uaddr, int oparg, int *old)
411 return ret; 409 return ret;
412} 410}
413 411
414int futex_atomic_op_pt(int op, u32 __user *uaddr, int oparg, int *old) 412int __futex_atomic_op_inuser(int op, u32 __user *uaddr, int oparg, int *old)
415{ 413{
416 int ret; 414 int ret;
417 415
@@ -449,8 +447,8 @@ static int __futex_atomic_cmpxchg_pt(u32 *uval, u32 __user *uaddr,
449 return ret; 447 return ret;
450} 448}
451 449
452int futex_atomic_cmpxchg_pt(u32 *uval, u32 __user *uaddr, 450int futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
453 u32 oldval, u32 newval) 451 u32 oldval, u32 newval)
454{ 452{
455 int ret; 453 int ret;
456 454
@@ -471,14 +469,3 @@ int futex_atomic_cmpxchg_pt(u32 *uval, u32 __user *uaddr,
471 put_page(virt_to_page(uaddr)); 469 put_page(virt_to_page(uaddr));
472 return ret; 470 return ret;
473} 471}
474
475struct uaccess_ops uaccess_pt = {
476 .copy_from_user = copy_from_user_pt,
477 .copy_to_user = copy_to_user_pt,
478 .copy_in_user = copy_in_user_pt,
479 .clear_user = clear_user_pt,
480 .strnlen_user = strnlen_user_pt,
481 .strncpy_from_user = strncpy_from_user_pt,
482 .futex_atomic_op = futex_atomic_op_pt,
483 .futex_atomic_cmpxchg = futex_atomic_cmpxchg_pt,
484};