root/arch/unicore32/include/asm/checksum.h

/* [<][>][^][v][top][bottom][index][help] */

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. csum_tcpudp_nofold

   1 /* SPDX-License-Identifier: GPL-2.0-only */
   2 /*
   3  * linux/arch/unicore32/include/asm/checksum.h
   4  *
   5  * Code specific to PKUnity SoC and UniCore ISA
   6  *
   7  * Copyright (C) 2001-2010 GUAN Xue-tao
   8  *
   9  * IP checksum routines
  10  */
  11 #ifndef __UNICORE_CHECKSUM_H__
  12 #define __UNICORE_CHECKSUM_H__
  13 
  14 /*
  15  * computes the checksum of the TCP/UDP pseudo-header
  16  * returns a 16-bit checksum, already complemented
  17  */
  18 
  19 static inline __wsum
  20 csum_tcpudp_nofold(__be32 saddr, __be32 daddr, __u32 len,
  21                    __u8 proto, __wsum sum)
  22 {
  23         __asm__(
  24         "add.a  %0, %1, %2\n"
  25         "addc.a %0, %0, %3\n"
  26         "addc.a %0, %0, %4 << #8\n"
  27         "addc.a %0, %0, %5\n"
  28         "addc   %0, %0, #0\n"
  29         : "=&r"(sum)
  30         : "r" (sum), "r" (daddr), "r" (saddr), "r" (len), "Ir" (htons(proto))
  31         : "cc");
  32         return sum;
  33 }
  34 #define csum_tcpudp_nofold      csum_tcpudp_nofold
  35 
  36 #include <asm-generic/checksum.h>
  37 
  38 #endif

/* [<][>][^][v][top][bottom][index][help] */