1 /* SPDX-License-Identifier: GPL-2.0 */
2 // Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.
4 #ifndef __ASM_CSKY_CHECKSUM_H
5 #define __ASM_CSKY_CHECKSUM_H
8 #include <asm/byteorder.h>
10 static inline __sum16
csum_fold(__wsum csum
)
19 : "=r"(csum
), "=r"(tmp
)
22 return (__force __sum16
) ~csum
;
24 #define csum_fold csum_fold
26 static inline __wsum
csum_tcpudp_nofold(__be32 saddr
, __be32 daddr
,
27 unsigned short len
, unsigned short proto
, __wsum sum
)
36 : "r"((__force u32
)saddr
), "r"((__force u32
)daddr
),
40 "r"((proto
+ len
) << 8),
42 "0" ((__force
unsigned long)sum
)
46 #define csum_tcpudp_nofold csum_tcpudp_nofold
48 #include <asm-generic/checksum.h>
50 #endif /* __ASM_CSKY_CHECKSUM_H */