Path: blob/master/arch/microblaze/include/asm/checksum.h
26439 views
/* SPDX-License-Identifier: GPL-2.0 */1/*2* Copyright (C) 2008 Michal Simek <[email protected]>3* Copyright (C) 2006 Atmark Techno, Inc.4*/56#ifndef _ASM_MICROBLAZE_CHECKSUM_H7#define _ASM_MICROBLAZE_CHECKSUM_H89/*10* computes the checksum of the TCP/UDP pseudo-header11* returns a 16-bit checksum, already complemented12*/13#define csum_tcpudp_nofold csum_tcpudp_nofold14static inline __wsum15csum_tcpudp_nofold(__be32 saddr, __be32 daddr, __u32 len,16__u8 proto, __wsum sum)17{18__asm__("add %0, %0, %1\n\t"19"addc %0, %0, %2\n\t"20"addc %0, %0, %3\n\t"21"addc %0, %0, r0\n\t"22: "+&d" (sum)23: "d" (saddr), "d" (daddr),24#ifdef __MICROBLAZEEL__25"d" ((len + proto) << 8)26#else27"d" (len + proto)28#endif29);30return sum;31}3233#include <asm-generic/checksum.h>3435#endif /* _ASM_MICROBLAZE_CHECKSUM_H */363738