Browse Source

selftests/powerpc: Move UCONTEXT_NIA() into utils.h

... so that it can be used by others.

Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Naveen N. Rao 7 years ago
parent
commit
db3848515a

+ 8 - 0
tools/testing/selftests/powerpc/include/utils.h

@@ -80,4 +80,12 @@ do {								\
 #define PPC_FEATURE2_ARCH_3_00 0x00800000
 #define PPC_FEATURE2_ARCH_3_00 0x00800000
 #endif
 #endif
 
 
+#if defined(__powerpc64__)
+#define UCONTEXT_NIA(UC)	(UC)->uc_mcontext.gp_regs[PT_NIP]
+#elif defined(__powerpc__)
+#define UCONTEXT_NIA(UC)	(UC)->uc_mcontext.uc_regs->gregs[PT_NIP]
+#else
+#error implement UCONTEXT_NIA
+#endif
+
 #endif /* _SELFTESTS_POWERPC_UTILS_H */
 #endif /* _SELFTESTS_POWERPC_UTILS_H */

+ 0 - 8
tools/testing/selftests/powerpc/primitives/load_unaligned_zeropad.c

@@ -65,14 +65,6 @@ static int unprotect_region(void)
 extern char __start___ex_table[];
 extern char __start___ex_table[];
 extern char __stop___ex_table[];
 extern char __stop___ex_table[];
 
 
-#if defined(__powerpc64__)
-#define UCONTEXT_NIA(UC)	(UC)->uc_mcontext.gp_regs[PT_NIP]
-#elif defined(__powerpc__)
-#define UCONTEXT_NIA(UC)	(UC)->uc_mcontext.uc_regs->gregs[PT_NIP]
-#else
-#error implement UCONTEXT_NIA
-#endif
-
 struct extbl_entry {
 struct extbl_entry {
 	int insn;
 	int insn;
 	int fixup;
 	int fixup;