Blame view

kernel/linux-rt-4.4.41/arch/microblaze/include/asm/checksum.h 961 Bytes
5113f6f70   김현기   kernel add
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
  /*
   * Copyright (C) 2008 Michal Simek <monstr@monstr.eu>
   * Copyright (C) 2006 Atmark Techno, Inc.
   *
   * This file is subject to the terms and conditions of the GNU General Public
   * License. See the file "COPYING" in the main directory of this archive
   * for more details.
   */
  
  #ifndef _ASM_MICROBLAZE_CHECKSUM_H
  #define _ASM_MICROBLAZE_CHECKSUM_H
  
  /*
   * computes the checksum of the TCP/UDP pseudo-header
   * returns a 16-bit checksum, already complemented
   */
  #define csum_tcpudp_nofold	csum_tcpudp_nofold
  static inline __wsum
  csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len,
  		   unsigned short proto, __wsum sum)
  {
  	__asm__("add %0, %0, %1
  \t"
  		"addc %0, %0, %2
  \t"
  		"addc %0, %0, %3
  \t"
  		"addc %0, %0, r0
  \t"
  		: "+&d" (sum)
  		: "d" (saddr), "d" (daddr),
  #ifdef __MICROBLAZEEL__
  	"d" ((len + proto) << 8)
  #else
  	"d" (len + proto)
  #endif
  );
  	return sum;
  }
  
  #include <asm-generic/checksum.h>
  
  #endif /* _ASM_MICROBLAZE_CHECKSUM_H */