static int do_setcontext(struct target_ucontext *ucp, CPUPPCState *env, int sig)

{

    struct target_mcontext *mcp;

    target_ulong mcp_addr;

    sigset_t blocked;

    target_sigset_t set;



    if (copy_from_user(&set, h2g(ucp) + offsetof(struct target_ucontext, tuc_sigmask),

                       sizeof (set)))

        return 1;



#if defined(TARGET_PPC64)

    fprintf (stderr, "do_setcontext: not implemented\n");

    return 0;

#else

    if (__get_user(mcp_addr, &ucp->tuc_regs))

        return 1;



    if (!lock_user_struct(VERIFY_READ, mcp, mcp_addr, 1))

        return 1;



    target_to_host_sigset_internal(&blocked, &set);

    do_sigprocmask(SIG_SETMASK, &blocked, NULL);

    if (restore_user_regs(env, mcp, sig))

        goto sigsegv;



    unlock_user_struct(mcp, mcp_addr, 1);

    return 0;



sigsegv:

    unlock_user_struct(mcp, mcp_addr, 1);

    return 1;

#endif

}

static int do_setcontext(struct target_ucontext *ucp, CPUPPCState *env, int sig)

{

    struct target_mcontext *mcp;

    target_ulong mcp_addr;

    sigset_t blocked;

    target_sigset_t set;



    if (copy_from_user(&set, h2g(ucp) + offsetof(struct target_ucontext, tuc_sigmask),

                       sizeof (set)))

        return 1;



#if defined(TARGET_PPC64)

    fprintf (stderr, "do_setcontext: not implemented\n");

    return 0;

#else

    if (__get_user(mcp_addr, &ucp->tuc_regs))

        return 1;



    if (!lock_user_struct(VERIFY_READ, mcp, mcp_addr, 1))

        return 1;



    target_to_host_sigset_internal(&blocked, &set);

    do_sigprocmask(SIG_SETMASK, &blocked, NULL);

    if (restore_user_regs(env, mcp, sig))

        goto sigsegv;



    unlock_user_struct(mcp, mcp_addr, 1);

    return 0;



sigsegv:

    unlock_user_struct(mcp, mcp_addr, 1);

    return 1;

#endif

}

static int FUNC_0(struct target_ucontext *VAR_0, CPUPPCState *VAR_1, int VAR_2)

{

    struct target_mcontext *VAR_3;

    target_ulong mcp_addr;

    sigset_t blocked;

    target_sigset_t set;



    if (copy_from_user(&set, h2g(VAR_0) + offsetof(struct target_ucontext, tuc_sigmask),

                       sizeof (set)))

        return 1;



#if defined(TARGET_PPC64)

    fprintf (stderr, "FUNC_0: not implemented\n");

    return 0;

#else

    if (__get_user(mcp_addr, &VAR_0->tuc_regs))

        return 1;



    if (!lock_user_struct(VERIFY_READ, VAR_3, mcp_addr, 1))

        return 1;



    target_to_host_sigset_internal(&blocked, &set);

    do_sigprocmask(SIG_SETMASK, &blocked, NULL);

    if (restore_user_regs(VAR_1, VAR_3, VAR_2))

        goto sigsegv;



    unlock_user_struct(VAR_3, mcp_addr, 1);

    return 0;



sigsegv:

    unlock_user_struct(VAR_3, mcp_addr, 1);

    return 1;

#endif

}

static int FUNC_0(struct target_ucontext *VAR_0, CPUPPCState *VAR_1, int VAR_2)
{ struct target_mcontext *VAR_3; target_ulong mcp_addr; sigset_t blocked; target_sigset_t set; if (copy_from_user(&set, h2g(VAR_0) + offsetof(struct target_ucontext, tuc_sigmask),
sizeof (set)))
return 1; #if defined(TARGET_PPC64)
fprintf (stderr, "FUNC_0: not implemented\n"); return 0; #else
if (__get_user(mcp_addr, &VAR_0->tuc_regs))
return 1; if (!lock_user_struct(VERIFY_READ, VAR_3, mcp_addr, 1))
return 1; target_to_host_sigset_internal(&blocked, &set); do_sigprocmask(SIG_SETMASK, &blocked, NULL); if (restore_user_regs(VAR_1, VAR_3, VAR_2))
goto sigsegv; unlock_user_struct(VAR_3, mcp_addr, 1); return 0; sigsegv:
unlock_user_struct(VAR_3, mcp_addr, 1); return 1; #endif
}