1 #ifndef _CRIS_ARCH_CHECKSUM_H
2 #define _CRIS_ARCH_CHECKSUM_H
4 /* Checksum some values used in TCP/UDP headers.
6 * The gain by doing this in asm is that C will not generate carry-additions
7 * for the 32-bit components of the checksum, so otherwise we would have had
8 * to split all of those into 16-bit components, then add.
12 csum_tcpudp_nofold(__be32 saddr
, __be32 daddr
, unsigned short len
,
13 unsigned short proto
, __wsum sum
)
16 __asm__ ("add.d %2, %0\n\t"
24 : "0" (sum
), "r" (daddr
), "r" (saddr
), "r" ((len
+ proto
) << 8));