aboutsummaryrefslogtreecommitdiffstats
path: root/arch/hexagon/include
diff options
context:
space:
mode:
authorRichard Kuo <rkuo@codeaurora.org>2011-10-31 19:38:04 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-11-01 10:34:18 -0400
commit075a46a049d4ec16925139d69b4473499fd14122 (patch)
tree6e0f63f9e9e3f9fd22aa4db8fd843fda81a6691b /arch/hexagon/include
parentb7840983e841e2870ff69f8e410e349c6b819b9f (diff)
Hexagon: Add checksum functions
Signed-off-by: Richard Kuo <rkuo@codeaurora.org> Signed-off-by: Linas Vepstas <linas@codeaurora.org> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/hexagon/include')
-rw-r--r--arch/hexagon/include/asm/checksum.h50
-rw-r--r--arch/hexagon/include/asm/intrinsics.h26
2 files changed, 76 insertions, 0 deletions
diff --git a/arch/hexagon/include/asm/checksum.h b/arch/hexagon/include/asm/checksum.h
new file mode 100644
index 00000000000..3ce4ecd44f8
--- /dev/null
+++ b/arch/hexagon/include/asm/checksum.h
@@ -0,0 +1,50 @@
1/*
2 * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16 * 02110-1301, USA.
17 */
18
19#ifndef _ASM_CHECKSUM_H
20#define _ASM_CHECKSUM_H
21
22#define do_csum do_csum
23unsigned int do_csum(const void *voidptr, int len);
24
25/*
26 * the same as csum_partial, but copies from src while it
27 * checksums
28 *
29 * here even more important to align src and dst on a 32-bit (or even
30 * better 64-bit) boundary
31 */
32#define csum_partial_copy_nocheck csum_partial_copy_nocheck
33__wsum csum_partial_copy_nocheck(const void *src, void *dst,
34 int len, __wsum sum);
35
36/*
37 * computes the checksum of the TCP/UDP pseudo-header
38 * returns a 16-bit checksum, already complemented
39 */
40#define csum_tcpudp_nofold csum_tcpudp_nofold
41__wsum csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr,
42 unsigned short len, unsigned short proto, __wsum sum);
43
44#define csum_tcpudp_magic csum_tcpudp_magic
45__sum16 csum_tcpudp_magic(unsigned long saddr, unsigned long daddr,
46 unsigned short len, unsigned short proto, __wsum sum);
47
48#include <asm-generic/checksum.h>
49
50#endif
diff --git a/arch/hexagon/include/asm/intrinsics.h b/arch/hexagon/include/asm/intrinsics.h
new file mode 100644
index 00000000000..1c02186d2e9
--- /dev/null
+++ b/arch/hexagon/include/asm/intrinsics.h
@@ -0,0 +1,26 @@
1/*
2 * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16 * 02110-1301, USA.
17 */
18
19#ifndef _ASM_HEXAGON_INTRINSICS_H
20#define _ASM_HEXAGON_INTRINSICS_H
21
22#define HEXAGON_P_vrmpyhacc_PP __builtin_HEXAGON_M2_vrmac_s0
23#define HEXAGON_P_vrmpyh_PP __builtin_HEXAGON_M2_vrmpy_s0
24#define HEXAGON_R_cl0_R __builtin_HEXAGON_S2_cl0
25
26#endif