Browse Source

lib/raid6: Build proper raid6test files on powerpc

Previously the raid6 test Makefile did not build the POWER specific files
(altivec and vpermxor).
This patch fixes the bug, so that all appropriate files for powerpc are built.

This patch also fixes the missing and mismatched ifdef statements to allow the
altivec.uc file to be built correctly.

Signed-off-by: Matt Brown <matthew.brown.dev@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Matt Brown 8 years ago
parent
commit
aa9532d489
2 changed files with 6 additions and 2 deletions
  1. 3 0
      lib/raid6/altivec.uc
  2. 3 2
      lib/raid6/test/Makefile

+ 3 - 0
lib/raid6/altivec.uc

@@ -24,10 +24,13 @@
 
 
 #include <linux/raid/pq.h>
 #include <linux/raid/pq.h>
 
 
+#ifdef CONFIG_ALTIVEC
+
 #include <altivec.h>
 #include <altivec.h>
 #ifdef __KERNEL__
 #ifdef __KERNEL__
 # include <asm/cputable.h>
 # include <asm/cputable.h>
 # include <asm/switch_to.h>
 # include <asm/switch_to.h>
+#endif /* __KERNEL__ */
 
 
 /*
 /*
  * This is the C data type to use.  We use a vector of
  * This is the C data type to use.  We use a vector of

+ 3 - 2
lib/raid6/test/Makefile

@@ -45,9 +45,10 @@ else ifeq ($(HAS_NEON),yes)
         CFLAGS += -DCONFIG_KERNEL_MODE_NEON=1
         CFLAGS += -DCONFIG_KERNEL_MODE_NEON=1
 else
 else
         HAS_ALTIVEC := $(shell printf '\#include <altivec.h>\nvector int a;\n' |\
         HAS_ALTIVEC := $(shell printf '\#include <altivec.h>\nvector int a;\n' |\
-                         gcc -c -x c - >&/dev/null && \
-                         rm ./-.o && echo yes)
+                         gcc -c -x c - >/dev/null && rm ./-.o && echo yes)
         ifeq ($(HAS_ALTIVEC),yes)
         ifeq ($(HAS_ALTIVEC),yes)
+                CFLAGS += -I../../../arch/powerpc/include
+                CFLAGS += -DCONFIG_ALTIVEC
                 OBJS += altivec1.o altivec2.o altivec4.o altivec8.o \
                 OBJS += altivec1.o altivec2.o altivec4.o altivec8.o \
                         vpermxor1.o vpermxor2.o vpermxor4.o vpermxor8.o
                         vpermxor1.o vpermxor2.o vpermxor4.o vpermxor8.o
         endif
         endif