]>
git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - arch/cris/include/arch-v10/arch/checksum.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _CRIS_ARCH_CHECKSUM_H
3 #define _CRIS_ARCH_CHECKSUM_H
5 /* Checksum some values used in TCP/UDP headers.
7 * The gain by doing this in asm is that C will not generate carry-additions
8 * for the 32-bit components of the checksum, so otherwise we would have had
9 * to split all of those into 16-bit components, then add.
13 csum_tcpudp_nofold(__be32 saddr
, __be32 daddr
, __u32 len
,
14 __u8 proto
, __wsum sum
)
17 __asm__ ("add.d %2, %0\n\t"
25 : "0" (sum
), "r" (daddr
), "r" (saddr
), "r" ((len
+ proto
) << 8));