1 /* SPDX-License-Identifier: GPL-2.0 */
3 #ifndef __ASM_CSKY_CHECKSUM_H
4 #define __ASM_CSKY_CHECKSUM_H
7 #include <asm/byteorder.h>
9 static inline __sum16
csum_fold(__wsum csum
)
18 : "=r"(csum
), "=r"(tmp
)
21 return (__force __sum16
) ~csum
;
23 #define csum_fold csum_fold
25 static inline __wsum
csum_tcpudp_nofold(__be32 saddr
, __be32 daddr
,
26 unsigned short len
, unsigned short proto
, __wsum sum
)
35 : "r"((__force u32
)saddr
), "r"((__force u32
)daddr
),
39 "r"((proto
+ len
) << 8),
41 "0" ((__force
unsigned long)sum
)
45 #define csum_tcpudp_nofold csum_tcpudp_nofold
47 #include <asm-generic/checksum.h>
49 #endif /* __ASM_CSKY_CHECKSUM_H */