unify generic instances of csum_partial_copy_nocheck()
[linux-2.6-block.git] / arch / c6x / include / asm / checksum.h
CommitLineData
d2912cb1 1/* SPDX-License-Identifier: GPL-2.0-only */
09831ca7
AJ
2/*
3 * Copyright (C) 2011 Texas Instruments Incorporated
4 * Author: Mark Salter <msalter@redhat.com>
09831ca7
AJ
5 */
6#ifndef _ASM_C6X_CHECKSUM_H
7#define _ASM_C6X_CHECKSUM_H
8
9static inline __wsum
01cfbad7
AD
10csum_tcpudp_nofold(__be32 saddr, __be32 daddr, __u32 len,
11 __u8 proto, __wsum sum)
09831ca7
AJ
12{
13 unsigned long long tmp;
14
15 asm ("add .d1 %1,%5,%1\n"
16 "|| addu .l1 %3,%4,%0\n"
17 "addu .l1 %2,%0,%0\n"
18#ifndef CONFIG_CPU_BIG_ENDIAN
19 "|| shl .s1 %1,8,%1\n"
20#endif
21 "addu .l1 %1,%0,%0\n"
22 "add .l1 %P0,%p0,%2\n"
23 : "=&a"(tmp), "+a"(len), "+a"(sum)
24 : "a" (saddr), "a" (daddr), "a" (proto));
25 return sum;
26}
27#define csum_tcpudp_nofold csum_tcpudp_nofold
28
6e41c585
AV
29#define _HAVE_ARCH_CSUM_AND_COPY
30extern __wsum csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum);
31
09831ca7
AJ
32#include <asm-generic/checksum.h>
33
34#endif /* _ASM_C6X_CHECKSUM_H */