static void target_setup_frame(int usig, struct target_sigaction *ka,

                               target_siginfo_t *info, target_sigset_t *set,

                               CPUARMState *env)

{

    struct target_rt_sigframe *frame;

    abi_ulong frame_addr, return_addr;



    frame_addr = get_sigframe(ka, env);

    if (!lock_user_struct(VERIFY_WRITE, frame, frame_addr, 0)) {

        goto give_sigsegv;

    }



    __put_user(0, &frame->uc.tuc_flags);

    __put_user(0, &frame->uc.tuc_link);



    __put_user(target_sigaltstack_used.ss_sp,

                      &frame->uc.tuc_stack.ss_sp);

    __put_user(sas_ss_flags(env->xregs[31]),

                      &frame->uc.tuc_stack.ss_flags);

    __put_user(target_sigaltstack_used.ss_size,

                      &frame->uc.tuc_stack.ss_size);

    target_setup_sigframe(frame, env, set);

    if (ka->sa_flags & TARGET_SA_RESTORER) {

        return_addr = ka->sa_restorer;

    } else {

        /* mov x8,#__NR_rt_sigreturn; svc #0 */

        __put_user(0xd2801168, &frame->tramp[0]);

        __put_user(0xd4000001, &frame->tramp[1]);

        return_addr = frame_addr + offsetof(struct target_rt_sigframe, tramp);

    }

    env->xregs[0] = usig;

    env->xregs[31] = frame_addr;

    env->xregs[29] = env->xregs[31] + offsetof(struct target_rt_sigframe, fp);

    env->pc = ka->_sa_handler;

    env->xregs[30] = return_addr;

    if (info) {

        if (copy_siginfo_to_user(&frame->info, info)) {

            goto give_sigsegv;

        }

        env->xregs[1] = frame_addr + offsetof(struct target_rt_sigframe, info);

        env->xregs[2] = frame_addr + offsetof(struct target_rt_sigframe, uc);

    }



    unlock_user_struct(frame, frame_addr, 1);

    return;



 give_sigsegv:

    unlock_user_struct(frame, frame_addr, 1);

    force_sig(TARGET_SIGSEGV);

}

static void target_setup_frame(int usig, struct target_sigaction *ka,

                               target_siginfo_t *info, target_sigset_t *set,

                               CPUARMState *env)

{

    struct target_rt_sigframe *frame;

    abi_ulong frame_addr, return_addr;



    frame_addr = get_sigframe(ka, env);

    if (!lock_user_struct(VERIFY_WRITE, frame, frame_addr, 0)) {

        goto give_sigsegv;

    }



    __put_user(0, &frame->uc.tuc_flags);

    __put_user(0, &frame->uc.tuc_link);



    __put_user(target_sigaltstack_used.ss_sp,

                      &frame->uc.tuc_stack.ss_sp);

    __put_user(sas_ss_flags(env->xregs[31]),

                      &frame->uc.tuc_stack.ss_flags);

    __put_user(target_sigaltstack_used.ss_size,

                      &frame->uc.tuc_stack.ss_size);

    target_setup_sigframe(frame, env, set);

    if (ka->sa_flags & TARGET_SA_RESTORER) {

        return_addr = ka->sa_restorer;

    } else {

        

        __put_user(0xd2801168, &frame->tramp[0]);

        __put_user(0xd4000001, &frame->tramp[1]);

        return_addr = frame_addr + offsetof(struct target_rt_sigframe, tramp);

    }

    env->xregs[0] = usig;

    env->xregs[31] = frame_addr;

    env->xregs[29] = env->xregs[31] + offsetof(struct target_rt_sigframe, fp);

    env->pc = ka->_sa_handler;

    env->xregs[30] = return_addr;

    if (info) {

        if (copy_siginfo_to_user(&frame->info, info)) {

            goto give_sigsegv;

        }

        env->xregs[1] = frame_addr + offsetof(struct target_rt_sigframe, info);

        env->xregs[2] = frame_addr + offsetof(struct target_rt_sigframe, uc);

    }



    unlock_user_struct(frame, frame_addr, 1);

    return;



 give_sigsegv:

    unlock_user_struct(frame, frame_addr, 1);

    force_sig(TARGET_SIGSEGV);

}

static void FUNC_0(int VAR_0, struct target_sigaction *VAR_1,

                               target_siginfo_t *VAR_2, target_sigset_t *VAR_3,

                               CPUARMState *VAR_4)

{

    struct target_rt_sigframe *VAR_5;

    abi_ulong frame_addr, return_addr;



    frame_addr = get_sigframe(VAR_1, VAR_4);

    if (!lock_user_struct(VERIFY_WRITE, VAR_5, frame_addr, 0)) {

        goto give_sigsegv;

    }



    __put_user(0, &VAR_5->uc.tuc_flags);

    __put_user(0, &VAR_5->uc.tuc_link);



    __put_user(target_sigaltstack_used.ss_sp,

                      &VAR_5->uc.tuc_stack.ss_sp);

    __put_user(sas_ss_flags(VAR_4->xregs[31]),

                      &VAR_5->uc.tuc_stack.ss_flags);

    __put_user(target_sigaltstack_used.ss_size,

                      &VAR_5->uc.tuc_stack.ss_size);

    target_setup_sigframe(VAR_5, VAR_4, VAR_3);

    if (VAR_1->sa_flags & TARGET_SA_RESTORER) {

        return_addr = VAR_1->sa_restorer;

    } else {

        

        __put_user(0xd2801168, &VAR_5->tramp[0]);

        __put_user(0xd4000001, &VAR_5->tramp[1]);

        return_addr = frame_addr + offsetof(struct target_rt_sigframe, tramp);

    }

    VAR_4->xregs[0] = VAR_0;

    VAR_4->xregs[31] = frame_addr;

    VAR_4->xregs[29] = VAR_4->xregs[31] + offsetof(struct target_rt_sigframe, fp);

    VAR_4->pc = VAR_1->_sa_handler;

    VAR_4->xregs[30] = return_addr;

    if (VAR_2) {

        if (copy_siginfo_to_user(&VAR_5->VAR_2, VAR_2)) {

            goto give_sigsegv;

        }

        VAR_4->xregs[1] = frame_addr + offsetof(struct target_rt_sigframe, VAR_2);

        VAR_4->xregs[2] = frame_addr + offsetof(struct target_rt_sigframe, uc);

    }



    unlock_user_struct(VAR_5, frame_addr, 1);

    return;



 give_sigsegv:

    unlock_user_struct(VAR_5, frame_addr, 1);

    force_sig(TARGET_SIGSEGV);

}

static void FUNC_0(int VAR_0, struct target_sigaction *VAR_1,
target_siginfo_t *VAR_2, target_sigset_t *VAR_3,
CPUARMState *VAR_4)
{ struct target_rt_sigframe *VAR_5; abi_ulong frame_addr, return_addr; frame_addr = get_sigframe(VAR_1, VAR_4); if (!lock_user_struct(VERIFY_WRITE, VAR_5, frame_addr, 0)) { goto give_sigsegv; } __put_user(0, &VAR_5->uc.tuc_flags); __put_user(0, &VAR_5->uc.tuc_link); __put_user(target_sigaltstack_used.ss_sp,
&VAR_5->uc.tuc_stack.ss_sp); __put_user(sas_ss_flags(VAR_4->xregs[31]),
&VAR_5->uc.tuc_stack.ss_flags); __put_user(target_sigaltstack_used.ss_size,
&VAR_5->uc.tuc_stack.ss_size); target_setup_sigframe(VAR_5, VAR_4, VAR_3); if (VAR_1->sa_flags & TARGET_SA_RESTORER) { return_addr = VAR_1->sa_restorer; } else { __put_user(0xd2801168, &VAR_5->tramp[0]); __put_user(0xd4000001, &VAR_5->tramp[1]); return_addr = frame_addr + offsetof(struct target_rt_sigframe, tramp); } VAR_4->xregs[0] = VAR_0; VAR_4->xregs[31] = frame_addr; VAR_4->xregs[29] = VAR_4->xregs[31] + offsetof(struct target_rt_sigframe, fp); VAR_4->pc = VAR_1->_sa_handler; VAR_4->xregs[30] = return_addr; if (VAR_2) { if (copy_siginfo_to_user(&VAR_5->VAR_2, VAR_2)) { goto give_sigsegv; } VAR_4->xregs[1] = frame_addr + offsetof(struct target_rt_sigframe, VAR_2); VAR_4->xregs[2] = frame_addr + offsetof(struct target_rt_sigframe, uc); } unlock_user_struct(VAR_5, frame_addr, 1); return; give_sigsegv:
unlock_user_struct(VAR_5, frame_addr, 1); force_sig(TARGET_SIGSEGV); }