diff options
author | Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> | 2018-05-21 18:13:56 +0300 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2018-10-20 05:26:47 +0300 |
commit | db3848515aff369404c31ef5a63699799913518f (patch) | |
tree | e0fd3e81906375a778d945db02137e9325977949 /tools/testing/selftests/powerpc/include | |
parent | 59fe7eaf3598a89cbcd72e645b1d08afd76f7b29 (diff) | |
download | linux-db3848515aff369404c31ef5a63699799913518f.tar.xz |
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>
Diffstat (limited to 'tools/testing/selftests/powerpc/include')
-rw-r--r-- | tools/testing/selftests/powerpc/include/utils.h | 8 |
1 files changed, 8 insertions, 0 deletions
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 */ |