aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/include
diff options
context:
space:
mode:
authorMarkos Chandras <markos.chandras@imgtec.com>2013-12-12 11:21:00 -0500
committerRalf Baechle <ralf@linux-mips.org>2014-03-26 18:09:17 -0400
commitac85227f7637cfb0d811519b8253c454d0d0a159 (patch)
tree7f9da2f3f1efa1c7b46310c658b1f0679d35984e /arch/mips/include
parentc1771216ab48bb077cee30e6d197a5a55f707101 (diff)
MIPS: checksum: Split the 'copy_user' symbol
The 'copy_user' symbol can be used to copy from or to userland so we will use two different symbols for these operations. This makes no difference in the existing code, but when the core is operating in EVA mode, different instructions need to be used to read and write to userland address space. The old function has also been renamed to 'copy_kernel' to denote that it is suitable for copy data to and from kernel space. Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Diffstat (limited to 'arch/mips/include')
-rw-r--r--arch/mips/include/asm/checksum.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/arch/mips/include/asm/checksum.h b/arch/mips/include/asm/checksum.h
index ac3d2b8a20d4..3c9aea55954f 100644
--- a/arch/mips/include/asm/checksum.h
+++ b/arch/mips/include/asm/checksum.h
@@ -7,6 +7,7 @@
7 * Copyright (C) 1999 Silicon Graphics, Inc. 7 * Copyright (C) 1999 Silicon Graphics, Inc.
8 * Copyright (C) 2001 Thiemo Seufer. 8 * Copyright (C) 2001 Thiemo Seufer.
9 * Copyright (C) 2002 Maciej W. Rozycki 9 * Copyright (C) 2002 Maciej W. Rozycki
10 * Copyright (C) 2014 Imagination Technologies Ltd.
10 */ 11 */
11#ifndef _ASM_CHECKSUM_H 12#ifndef _ASM_CHECKSUM_H
12#define _ASM_CHECKSUM_H 13#define _ASM_CHECKSUM_H
@@ -29,8 +30,13 @@
29 */ 30 */
30__wsum csum_partial(const void *buff, int len, __wsum sum); 31__wsum csum_partial(const void *buff, int len, __wsum sum);
31 32
32__wsum __csum_partial_copy_user(const void *src, void *dst, 33__wsum __csum_partial_copy_kernel(const void *src, void *dst,
33 int len, __wsum sum, int *err_ptr); 34 int len, __wsum sum, int *err_ptr);
35
36__wsum __csum_partial_copy_from_user(const void *src, void *dst,
37 int len, __wsum sum, int *err_ptr);
38__wsum __csum_partial_copy_to_user(const void *src, void *dst,
39 int len, __wsum sum, int *err_ptr);
34 40
35/* 41/*
36 * this is a new version of the above that records errors it finds in *errp, 42 * this is a new version of the above that records errors it finds in *errp,
@@ -41,8 +47,8 @@ __wsum csum_partial_copy_from_user(const void __user *src, void *dst, int len,
41 __wsum sum, int *err_ptr) 47 __wsum sum, int *err_ptr)
42{ 48{
43 might_fault(); 49 might_fault();
44 return __csum_partial_copy_user((__force void *)src, dst, 50 return __csum_partial_copy_from_user((__force void *)src, dst,
45 len, sum, err_ptr); 51 len, sum, err_ptr);
46} 52}
47 53
48/* 54/*
@@ -55,8 +61,8 @@ __wsum csum_and_copy_to_user(const void *src, void __user *dst, int len,
55{ 61{
56 might_fault(); 62 might_fault();
57 if (access_ok(VERIFY_WRITE, dst, len)) 63 if (access_ok(VERIFY_WRITE, dst, len))
58 return __csum_partial_copy_user(src, (__force void *)dst, 64 return __csum_partial_copy_to_user(src, (__force void *)dst,
59 len, sum, err_ptr); 65 len, sum, err_ptr);
60 if (len) 66 if (len)
61 *err_ptr = -EFAULT; 67 *err_ptr = -EFAULT;
62 68