static void setup_sigframe_v2(struct target_ucontext_v2 *uc,

                              target_sigset_t *set, CPUState *env)

{

    struct target_sigaltstack stack;

    int i;



    /* Clear all the bits of the ucontext we don't use.  */

    memset(uc, 0, offsetof(struct target_ucontext_v2, tuc_mcontext));



    memset(&stack, 0, sizeof(stack));

    __put_user(target_sigaltstack_used.ss_sp, &stack.ss_sp);

    __put_user(target_sigaltstack_used.ss_size, &stack.ss_size);

    __put_user(sas_ss_flags(get_sp_from_cpustate(env)), &stack.ss_flags);

    memcpy(&uc->tuc_stack, &stack, sizeof(stack));



    setup_sigcontext(&uc->tuc_mcontext, env, set->sig[0]);

    /* FIXME: Save coprocessor signal frame.  */

    for(i = 0; i < TARGET_NSIG_WORDS; i++) {

        __put_user(set->sig[i], &uc->tuc_sigmask.sig[i]);

    }

}

static void setup_sigframe_v2(struct target_ucontext_v2 *uc,

                              target_sigset_t *set, CPUState *env)

{

    struct target_sigaltstack stack;

    int i;



    

    memset(uc, 0, offsetof(struct target_ucontext_v2, tuc_mcontext));



    memset(&stack, 0, sizeof(stack));

    __put_user(target_sigaltstack_used.ss_sp, &stack.ss_sp);

    __put_user(target_sigaltstack_used.ss_size, &stack.ss_size);

    __put_user(sas_ss_flags(get_sp_from_cpustate(env)), &stack.ss_flags);

    memcpy(&uc->tuc_stack, &stack, sizeof(stack));



    setup_sigcontext(&uc->tuc_mcontext, env, set->sig[0]);

    

    for(i = 0; i < TARGET_NSIG_WORDS; i++) {

        __put_user(set->sig[i], &uc->tuc_sigmask.sig[i]);

    }

}

static void FUNC_0(struct target_ucontext_v2 *VAR_0,

                              target_sigset_t *VAR_1, CPUState *VAR_2)

{

    struct target_sigaltstack VAR_3;

    int VAR_4;



    

    memset(VAR_0, 0, offsetof(struct target_ucontext_v2, tuc_mcontext));



    memset(&VAR_3, 0, sizeof(VAR_3));

    __put_user(target_sigaltstack_used.ss_sp, &VAR_3.ss_sp);

    __put_user(target_sigaltstack_used.ss_size, &VAR_3.ss_size);

    __put_user(sas_ss_flags(get_sp_from_cpustate(VAR_2)), &VAR_3.ss_flags);

    memcpy(&VAR_0->tuc_stack, &VAR_3, sizeof(VAR_3));



    setup_sigcontext(&VAR_0->tuc_mcontext, VAR_2, VAR_1->sig[0]);

    

    for(VAR_4 = 0; VAR_4 < TARGET_NSIG_WORDS; VAR_4++) {

        __put_user(VAR_1->sig[VAR_4], &VAR_0->tuc_sigmask.sig[VAR_4]);

    }

}

static void FUNC_0(struct target_ucontext_v2 *VAR_0,
target_sigset_t *VAR_1, CPUState *VAR_2)
{ struct target_sigaltstack VAR_3; int VAR_4; memset(VAR_0, 0, offsetof(struct target_ucontext_v2, tuc_mcontext)); memset(&VAR_3, 0, sizeof(VAR_3)); __put_user(target_sigaltstack_used.ss_sp, &VAR_3.ss_sp); __put_user(target_sigaltstack_used.ss_size, &VAR_3.ss_size); __put_user(sas_ss_flags(get_sp_from_cpustate(VAR_2)), &VAR_3.ss_flags); memcpy(&VAR_0->tuc_stack, &VAR_3, sizeof(VAR_3)); setup_sigcontext(&VAR_0->tuc_mcontext, VAR_2, VAR_1->sig[0]); for(VAR_4 = 0; VAR_4 < TARGET_NSIG_WORDS; VAR_4++) { __put_user(VAR_1->sig[VAR_4], &VAR_0->tuc_sigmask.sig[VAR_4]); } }