aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2013-09-22 22:04:51 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-10-11 01:48:39 -0400
commit7a332b0c9a59e0b0777dec55eefdda0f9a24ac52 (patch)
tree102250f85f5f245f5a208b76a7adae05a679368b /arch
parent52055d07ce0a465949552c9c5d65d2b8b37672c5 (diff)
powerpc: Use generic checksum code in little endian
We need to fix some endian issues in our checksum code. For now just enable the generic checksum routines for little endian builds. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/Kconfig3
-rw-r--r--arch/powerpc/include/asm/checksum.h5
-rw-r--r--arch/powerpc/kernel/ppc_ksyms.c2
-rw-r--r--arch/powerpc/lib/Makefile9
4 files changed, 17 insertions, 2 deletions
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 38f3b7e47ec5..2c69c43ba68e 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -139,6 +139,9 @@ config PPC
139 select OLD_SIGACTION if PPC32 139 select OLD_SIGACTION if PPC32
140 select HAVE_DEBUG_STACKOVERFLOW 140 select HAVE_DEBUG_STACKOVERFLOW
141 141
142config GENERIC_CSUM
143 def_bool CPU_LITTLE_ENDIAN
144
142config EARLY_PRINTK 145config EARLY_PRINTK
143 bool 146 bool
144 default y 147 default y
diff --git a/arch/powerpc/include/asm/checksum.h b/arch/powerpc/include/asm/checksum.h
index ce0c28495f9a..8251a3ba870f 100644
--- a/arch/powerpc/include/asm/checksum.h
+++ b/arch/powerpc/include/asm/checksum.h
@@ -14,6 +14,9 @@
14 * which always checksum on 4 octet boundaries. ihl is the number 14 * which always checksum on 4 octet boundaries. ihl is the number
15 * of 32-bit words and is always >= 5. 15 * of 32-bit words and is always >= 5.
16 */ 16 */
17#ifdef CONFIG_GENERIC_CSUM
18#include <asm-generic/checksum.h>
19#else
17extern __sum16 ip_fast_csum(const void *iph, unsigned int ihl); 20extern __sum16 ip_fast_csum(const void *iph, unsigned int ihl);
18 21
19/* 22/*
@@ -123,5 +126,7 @@ static inline __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr,
123 return sum; 126 return sum;
124#endif 127#endif
125} 128}
129
130#endif
126#endif /* __KERNEL__ */ 131#endif /* __KERNEL__ */
127#endif 132#endif
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
index 21646dbe1bb3..3b485c5cff10 100644
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -79,10 +79,12 @@ EXPORT_SYMBOL(strlen);
79EXPORT_SYMBOL(strcmp); 79EXPORT_SYMBOL(strcmp);
80EXPORT_SYMBOL(strncmp); 80EXPORT_SYMBOL(strncmp);
81 81
82#ifndef CONFIG_GENERIC_CSUM
82EXPORT_SYMBOL(csum_partial); 83EXPORT_SYMBOL(csum_partial);
83EXPORT_SYMBOL(csum_partial_copy_generic); 84EXPORT_SYMBOL(csum_partial_copy_generic);
84EXPORT_SYMBOL(ip_fast_csum); 85EXPORT_SYMBOL(ip_fast_csum);
85EXPORT_SYMBOL(csum_tcpudp_magic); 86EXPORT_SYMBOL(csum_tcpudp_magic);
87#endif
86 88
87EXPORT_SYMBOL(__copy_tofrom_user); 89EXPORT_SYMBOL(__copy_tofrom_user);
88EXPORT_SYMBOL(__clear_user); 90EXPORT_SYMBOL(__clear_user);
diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile
index 450433276699..33ab26112123 100644
--- a/arch/powerpc/lib/Makefile
+++ b/arch/powerpc/lib/Makefile
@@ -10,15 +10,20 @@ CFLAGS_REMOVE_code-patching.o = -pg
10CFLAGS_REMOVE_feature-fixups.o = -pg 10CFLAGS_REMOVE_feature-fixups.o = -pg
11 11
12obj-y := string.o alloc.o \ 12obj-y := string.o alloc.o \
13 checksum_$(CONFIG_WORD_SIZE).o crtsavres.o 13 crtsavres.o
14obj-$(CONFIG_PPC32) += div64.o copy_32.o 14obj-$(CONFIG_PPC32) += div64.o copy_32.o
15obj-$(CONFIG_HAS_IOMEM) += devres.o 15obj-$(CONFIG_HAS_IOMEM) += devres.o
16 16
17obj-$(CONFIG_PPC64) += copypage_64.o copyuser_64.o \ 17obj-$(CONFIG_PPC64) += copypage_64.o copyuser_64.o \
18 memcpy_64.o usercopy_64.o mem_64.o string.o \ 18 memcpy_64.o usercopy_64.o mem_64.o string.o \
19 checksum_wrappers_64.o hweight_64.o \ 19 hweight_64.o \
20 copyuser_power7.o string_64.o copypage_power7.o \ 20 copyuser_power7.o string_64.o copypage_power7.o \
21 memcpy_power7.o 21 memcpy_power7.o
22ifeq ($(CONFIG_GENERIC_CSUM),)
23obj-y += checksum_$(CONFIG_WORD_SIZE).o
24obj-$(CONFIG_PPC64) += checksum_wrappers_64.o
25endif
26
22obj-$(CONFIG_PPC_EMULATE_SSTEP) += sstep.o ldstfp.o 27obj-$(CONFIG_PPC_EMULATE_SSTEP) += sstep.o ldstfp.o
23 28
24ifeq ($(CONFIG_PPC64),y) 29ifeq ($(CONFIG_PPC64),y)