OSDN Git Service

selftests/powerpc: Move shared headers into new include dir
authorSimon Guo <wei.guo.simon@gmail.com>
Fri, 30 Sep 2016 02:32:51 +0000 (10:32 +0800)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 17 Nov 2016 06:11:47 +0000 (17:11 +1100)
There are some functions, especially register related, which can
be shared across multiple selftests/powerpc test directories.

This patch creates a new include directory to store those shared
files, so that the file layout becomes more neat.

Signed-off-by: Simon Guo <wei.guo.simon@gmail.com>
[mpe: Reworked to move the headers only]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
19 files changed:
tools/testing/selftests/powerpc/Makefile
tools/testing/selftests/powerpc/benchmarks/context_switch.c
tools/testing/selftests/powerpc/copyloops/validate.c
tools/testing/selftests/powerpc/include/basic_asm.h [moved from tools/testing/selftests/powerpc/basic_asm.h with 66% similarity]
tools/testing/selftests/powerpc/include/fpu_asm.h [moved from tools/testing/selftests/powerpc/fpu_asm.h with 100% similarity]
tools/testing/selftests/powerpc/include/gpr_asm.h [moved from tools/testing/selftests/powerpc/gpr_asm.h with 100% similarity]
tools/testing/selftests/powerpc/include/instructions.h [moved from tools/testing/selftests/powerpc/instructions.h with 100% similarity]
tools/testing/selftests/powerpc/include/reg.h [moved from tools/testing/selftests/powerpc/reg.h with 100% similarity]
tools/testing/selftests/powerpc/include/subunit.h [moved from tools/testing/selftests/powerpc/subunit.h with 100% similarity]
tools/testing/selftests/powerpc/include/utils.h [moved from tools/testing/selftests/powerpc/utils.h with 100% similarity]
tools/testing/selftests/powerpc/include/vmx_asm.h [moved from tools/testing/selftests/powerpc/vmx_asm.h with 100% similarity]
tools/testing/selftests/powerpc/include/vsx_asm.h [moved from tools/testing/selftests/powerpc/vsx_asm.h with 100% similarity]
tools/testing/selftests/powerpc/math/fpu_asm.S
tools/testing/selftests/powerpc/math/vmx_asm.S
tools/testing/selftests/powerpc/math/vsx_asm.S
tools/testing/selftests/powerpc/signal/signal.S
tools/testing/selftests/powerpc/stringloops/memcmp.c
tools/testing/selftests/powerpc/tm/tm-signal.S
tools/testing/selftests/powerpc/tm/tm.h

index db54a33..561afa1 100644 (file)
@@ -8,7 +8,7 @@ ifeq ($(ARCH),powerpc)
 
 GIT_VERSION = $(shell git describe --always --long --dirty || echo "unknown")
 
-CFLAGS := -std=gnu99 -Wall -O2 -Wall -Werror -DGIT_VERSION='"$(GIT_VERSION)"' -I$(CURDIR) $(CFLAGS)
+CFLAGS := -std=gnu99 -Wall -O2 -Wall -Werror -DGIT_VERSION='"$(GIT_VERSION)"' -I$(CURDIR)/include $(CFLAGS)
 
 export CFLAGS
 
index a36883a..778f5fb 100644 (file)
@@ -28,7 +28,7 @@
 #ifdef __powerpc__
 #include <altivec.h>
 #endif
-#include "../utils.h"
+#include "utils.h"
 
 static unsigned int timeout = 30;
 
index 1750ff5..7fb436f 100644 (file)
@@ -3,7 +3,7 @@
 #include <stdlib.h>
 #include <stdbool.h>
 
-#include "../utils.h"
+#include "utils.h"
 
 #define MAX_LEN 8192
 #define MAX_OFFSET 16
@@ -4,12 +4,12 @@
 #include <ppc-asm.h>
 #include <asm/unistd.h>
 
-#define LOAD_REG_IMMEDIATE(reg,expr) \
-       lis     reg,(expr)@highest;     \
-       ori     reg,reg,(expr)@higher;  \
-       rldicr  reg,reg,32,31;  \
-       oris    reg,reg,(expr)@high;    \
-       ori     reg,reg,(expr)@l;
+#define LOAD_REG_IMMEDIATE(reg, expr) \
+       lis     reg, (expr)@highest;    \
+       ori     reg, reg, (expr)@higher;        \
+       rldicr  reg, reg, 32, 31;       \
+       oris    reg, reg, (expr)@high;  \
+       ori     reg, reg, (expr)@l;
 
 /*
  * Note: These macros assume that variables being stored on the stack are
@@ -20,7 +20,8 @@
 #define STACK_FRAME_MIN_SIZE 32
 #define STACK_FRAME_TOC_POS  24
 #define __STACK_FRAME_PARAM(_param)  (32 + ((_param)*8))
-#define __STACK_FRAME_LOCAL(_num_params,_var_num)  ((STACK_FRAME_PARAM(_num_params)) + ((_var_num)*8))
+#define __STACK_FRAME_LOCAL(_num_params, _var_num)  \
+       ((STACK_FRAME_PARAM(_num_params)) + ((_var_num)*8))
 #else
 #define STACK_FRAME_MIN_SIZE 112
 #define STACK_FRAME_TOC_POS  40
  * Caveat: if a function passed more than 8 doublewords, the caller will have
  * made more space... which would render the 112 incorrect.
  */
-#define __STACK_FRAME_LOCAL(_num_params,_var_num)  (112 + ((_var_num)*8))
+#define __STACK_FRAME_LOCAL(_num_params, _var_num)  \
+       (112 + ((_var_num)*8))
 #endif
 
 /* Parameter x saved to the stack */
 #define STACK_FRAME_PARAM(var)    __STACK_FRAME_PARAM(var)
 
 /* Local variable x saved to the stack after x parameters */
-#define STACK_FRAME_LOCAL(num_params,var)    __STACK_FRAME_LOCAL(num_params,var)
+#define STACK_FRAME_LOCAL(num_params, var)    \
+       __STACK_FRAME_LOCAL(num_params, var)
 #define STACK_FRAME_LR_POS   16
 #define STACK_FRAME_CR_POS   8
 
  */
 #define PUSH_BASIC_STACK(_extra) \
        mflr    r0; \
-       std     r0,STACK_FRAME_LR_POS(%r1); \
-       stdu    %r1,-(_extra + STACK_FRAME_MIN_SIZE)(%r1); \
+       std     r0, STACK_FRAME_LR_POS(%r1); \
+       stdu    %r1, -(_extra + STACK_FRAME_MIN_SIZE)(%r1); \
        mfcr    r0; \
-       stw     r0,STACK_FRAME_CR_POS(%r1); \
-       std     %r2,STACK_FRAME_TOC_POS(%r1);
+       stw     r0, STACK_FRAME_CR_POS(%r1); \
+       std     %r2, STACK_FRAME_TOC_POS(%r1);
 
 #define POP_BASIC_STACK(_extra) \
-       ld      %r2,STACK_FRAME_TOC_POS(%r1); \
-       lwz     r0,STACK_FRAME_CR_POS(%r1); \
+       ld      %r2, STACK_FRAME_TOC_POS(%r1); \
+       lwz     r0, STACK_FRAME_CR_POS(%r1); \
        mtcr    r0; \
-       addi    %r1,%r1,(_extra + STACK_FRAME_MIN_SIZE); \
-       ld      r0,STACK_FRAME_LR_POS(%r1); \
+       addi    %r1, %r1, (_extra + STACK_FRAME_MIN_SIZE); \
+       ld      r0, STACK_FRAME_LR_POS(%r1); \
        mtlr    r0;
 
 #endif /* _SELFTESTS_POWERPC_BASIC_ASM_H */
index 241f067..8a04bb1 100644 (file)
@@ -7,8 +7,8 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include "../basic_asm.h"
-#include "../fpu_asm.h"
+#include "basic_asm.h"
+#include "fpu_asm.h"
 
 FUNC_START(check_fpu)
        mr r4,r3
index fd74da4..cb1e5ae 100644 (file)
@@ -7,8 +7,8 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include "../basic_asm.h"
-#include "../vmx_asm.h"
+#include "basic_asm.h"
+#include "vmx_asm.h"
 
 # Should be safe from C, only touches r4, r5 and v0,v1,v2
 FUNC_START(check_vmx)
index a110dd8..8f431f6 100644 (file)
@@ -7,8 +7,8 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include "../basic_asm.h"
-#include "../vsx_asm.h"
+#include "basic_asm.h"
+#include "vsx_asm.h"
 
 #long check_vsx(vector int *r3);
 #This function wraps storeing VSX regs to the end of an array and a
index 7043d52..322f2f1 100644 (file)
@@ -7,7 +7,7 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include "../basic_asm.h"
+#include "basic_asm.h"
 
 /* long signal_self(pid_t pid, int sig); */
 FUNC_START(signal_self)
index 17417dd..30b1222 100644 (file)
@@ -1,7 +1,7 @@
 #include <malloc.h>
 #include <stdlib.h>
 #include <string.h>
-#include "../utils.h"
+#include "utils.h"
 
 #define SIZE 256
 #define ITERATIONS 10000
index 4e13e8b..506a4eb 100644 (file)
@@ -7,11 +7,11 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include "../basic_asm.h"
-#include "../gpr_asm.h"
-#include "../fpu_asm.h"
-#include "../vmx_asm.h"
-#include "../vsx_asm.h"
+#include "basic_asm.h"
+#include "gpr_asm.h"
+#include "fpu_asm.h"
+#include "vmx_asm.h"
+#include "vsx_asm.h"
 
 /*
  * Large caveat here being that the caller cannot expect the
index 2c8da74..0ffff04 100644 (file)
@@ -10,7 +10,7 @@
 #include <asm/cputable.h>
 #include <stdbool.h>
 
-#include "../utils.h"
+#include "utils.h"
 
 static inline bool have_htm(void)
 {