Michael Ellerman wrote:
"Naveen N. Rao" <[email protected]> writes:

diff --git a/tools/testing/selftests/powerpc/utils.c 
b/tools/testing/selftests/powerpc/utils.c
index d46916867a6f..c6b1d20ed3ba 100644
--- a/tools/testing/selftests/powerpc/utils.c
+++ b/tools/testing/selftests/powerpc/utils.c
@@ -104,3 +111,149 @@ int pick_online_cpu(void)
        printf("No cpus in affinity mask?!\n");
        return -1;
 }
...
+
+static void sigill_handler(int signr, siginfo_t *info, void *unused)
+{
+       static int warned = 0;
+       ucontext_t *ctx = (ucontext_t *)unused;
+       unsigned int *pc = (unsigned int *)ctx->uc_mcontext.gp_regs[PT_NIP];

The above doesn't work on 32-bit, and this code is sometimes built 32-bit.

For an example of how to handle 32 and 64-bit, see eg:

  tools/testing/selftests/powerpc/primitives/load_unaligned_zeropad.c

Thanks. I'll post a v2 that addresses the 32-bit build issue.

- Naveen


Reply via email to