Thread (3 messages) flat view 3 messages, 3 authors, 2016-06-09

Re: [PATCH 2/2] selftests/powerpc: Test unaligned copy and paste

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2016-06-09 10:50:09

On Thu, 2016-06-09 at 17:26 +1000, Michael Neuling wrote:
On Thu, 2016-06-09 at 16:02 +1000, Chris Smart wrote:
quoted
Test that an ISA 3.0 compliant machine performing an unaligned copy,
copy_first, paste or paste_last is sent a SIGBUS.
It's probably overkill but we could check in the signal handler that the
sigbus was on the instruction we actually cared about.  ie something like
this in the sig handler for copy first.

static void sig_handler(int signr, siginfo_t *info, void *ucontext)
{
        ucontext_t *ctx = ucontext;
        unsigned int *pc = ctx->uc_mcontext.gp_regs[PT_NIP];
 
You're a hard taskmaster.

For it to build on 32-bit BE, you'll need:

    #if defined(__powerpc64__)
    pc = ctx->uc_mcontext.gp_regs[PT_NIP];
    #else
    pc = ctx->uc_mcontext.uc_regs->gregs[PT_NIP]
    #endif

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help