aboutsummaryrefslogtreecommitdiffstats
path: root/arch/tile/include/asm/checksum.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-07-23 22:10:54 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-23 22:10:54 -0400
commitf0a08fcb5972167e55faa330c4a24fbaa3328b1f (patch)
treee24c42230888bd0e6422b2f81d7991da4373bb5d /arch/tile/include/asm/checksum.h
parent474183b188b3c5af45831c71151f819fc70479b8 (diff)
parentf6d2ce00da145ae31ec22d21daca6ca5e22b3c84 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile
Pull arch/tile updates from Chris Metcalf: "These changes provide support for PCIe root complex and USB host mode for tilegx's on-chip I/Os. In addition, this pull provides the required underpinning for the on-chip networking support that was pulled into 3.5. The changes have all been through LKML (with several rounds for PCIe RC) and on linux-next." * git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile: tile: updates to pci root complex from community feedback bounce: allow use of bounce pool via config option usb: add host support for the tilegx architecture arch/tile: provide kernel support for the tilegx USB shim tile pci: enable IOMMU to support DMA for legacy devices arch/tile: enable ZONE_DMA for tilegx tilegx pci: support I/O to arbitrarily-cached pages tile: remove unused header arch/tile: tilegx PCI root complex support arch/tile: provide kernel support for the tilegx TRIO shim arch/tile: break out the "csum a long" function to <asm/checksum.h> arch/tile: provide kernel support for the tilegx mPIPE shim arch/tile: common DMA code for the GXIO IORPC subsystem arch/tile: support MMIO-based readb/writeb etc. arch/tile: introduce GXIO IORPC framework for tilegx
Diffstat (limited to 'arch/tile/include/asm/checksum.h')
-rw-r--r--arch/tile/include/asm/checksum.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/tile/include/asm/checksum.h b/arch/tile/include/asm/checksum.h
index a120766c7264..b21a2fdec9f7 100644
--- a/arch/tile/include/asm/checksum.h
+++ b/arch/tile/include/asm/checksum.h
@@ -21,4 +21,22 @@
21__wsum do_csum(const unsigned char *buff, int len); 21__wsum do_csum(const unsigned char *buff, int len);
22#define do_csum do_csum 22#define do_csum do_csum
23 23
24/*
25 * Return the sum of all the 16-bit subwords in a long.
26 * This sums two subwords on a 32-bit machine, and four on 64 bits.
27 * The implementation does two vector adds to capture any overflow.
28 */
29static inline unsigned int csum_long(unsigned long x)
30{
31 unsigned long ret;
32#ifdef __tilegx__
33 ret = __insn_v2sadu(x, 0);
34 ret = __insn_v2sadu(ret, 0);
35#else
36 ret = __insn_sadh_u(x, 0);
37 ret = __insn_sadh_u(ret, 0);
38#endif
39 return ret;
40}
41
24#endif /* _ASM_TILE_CHECKSUM_H */ 42#endif /* _ASM_TILE_CHECKSUM_H */