Path: blob/master/arch/unicore32/include/asm/checksum.h
10818 views
/*1* linux/arch/unicore32/include/asm/checksum.h2*3* Code specific to PKUnity SoC and UniCore ISA4*5* Copyright (C) 2001-2010 GUAN Xue-tao6*7* This program is free software; you can redistribute it and/or modify8* it under the terms of the GNU General Public License version 2 as9* published by the Free Software Foundation.10*11* IP checksum routines12*/13#ifndef __UNICORE_CHECKSUM_H__14#define __UNICORE_CHECKSUM_H__1516/*17* computes the checksum of the TCP/UDP pseudo-header18* returns a 16-bit checksum, already complemented19*/2021static inline __wsum22csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len,23unsigned short proto, __wsum sum)24{25__asm__(26"add.a %0, %1, %2\n"27"addc.a %0, %0, %3\n"28"addc.a %0, %0, %4 << #8\n"29"addc.a %0, %0, %5\n"30"addc %0, %0, #0\n"31: "=&r"(sum)32: "r" (sum), "r" (daddr), "r" (saddr), "r" (len), "Ir" (htons(proto))33: "cc");34return sum;35}36#define csum_tcpudp_nofold csum_tcpudp_nofold3738#include <asm-generic/checksum.h>3940#endif414243