diff options
author | Atsushi Nemoto <anemo@mba.ocn.ne.jp> | 2006-12-13 01:22:06 +0900 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2007-01-08 21:41:04 +0000 |
commit | f860c90bd6ce22c6a0a352cc16acc74fba3d628e (patch) | |
tree | fee63d3ff954439d19932beeb0109508a0bc899c /arch/mips/lib/csum_partial_copy.c | |
parent | 61e84f99877fa8caaf1be86d51d825406e8d8bc1 (diff) | |
download | blackbird-op-linux-f860c90bd6ce22c6a0a352cc16acc74fba3d628e.tar.gz blackbird-op-linux-f860c90bd6ce22c6a0a352cc16acc74fba3d628e.zip |
[MIPS] csum_partial and copy in parallel
Implement optimized asm version of csum_partial_copy_nocheck,
csum_partial_copy_from_user and csum_and_copy_to_user which can do
calculate and copy in parallel, based on memcpy.S.
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/lib/csum_partial_copy.c')
-rw-r--r-- | arch/mips/lib/csum_partial_copy.c | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/arch/mips/lib/csum_partial_copy.c b/arch/mips/lib/csum_partial_copy.c deleted file mode 100644 index 06771040a267..000000000000 --- a/arch/mips/lib/csum_partial_copy.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 1994, 1995 Waldorf Electronics GmbH - * Copyright (C) 1998, 1999 Ralf Baechle - */ -#include <linux/kernel.h> -#include <linux/module.h> -#include <linux/types.h> -#include <asm/byteorder.h> -#include <asm/string.h> -#include <asm/uaccess.h> -#include <net/checksum.h> - -/* - * copy while checksumming, otherwise like csum_partial - */ -__wsum csum_partial_copy_nocheck(const void *src, - void *dst, int len, __wsum sum) -{ - /* - * It's 2:30 am and I don't feel like doing it real ... - * This is lots slower than the real thing (tm) - */ - sum = csum_partial(src, len, sum); - memcpy(dst, src, len); - - return sum; -} - -EXPORT_SYMBOL(csum_partial_copy_nocheck); - -/* - * Copy from userspace and compute checksum. If we catch an exception - * then zero the rest of the buffer. - */ -__wsum csum_partial_copy_from_user (const void __user *src, - void *dst, int len, __wsum sum, int *err_ptr) -{ - int missing; - - might_sleep(); - missing = copy_from_user(dst, src, len); - if (missing) { - memset(dst + len - missing, 0, missing); - *err_ptr = -EFAULT; - } - - return csum_partial(dst, len, sum); -} |