From db3848515aff369404c31ef5a63699799913518f Mon Sep 17 00:00:00 2001 From: "Naveen N. Rao" Date: Mon, 21 May 2018 20:43:56 +0530 Subject: selftests/powerpc: Move UCONTEXT_NIA() into utils.h ... so that it can be used by others. Signed-off-by: Naveen N. Rao Signed-off-by: Michael Ellerman --- tools/testing/selftests/powerpc/include/utils.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tools/testing/selftests/powerpc/include') diff --git a/tools/testing/selftests/powerpc/include/utils.h b/tools/testing/selftests/powerpc/include/utils.h index c58c370828b4..da1b963cdb32 100644 --- a/tools/testing/selftests/powerpc/include/utils.h +++ b/tools/testing/selftests/powerpc/include/utils.h @@ -80,4 +80,12 @@ do { \ #define PPC_FEATURE2_ARCH_3_00 0x00800000 #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 */ -- cgit v1.2.3-59-g8ed1b