static void setup_frame(int sig, struct target_sigaction *ka,

                        target_sigset_t *set, CPUM68KState *env)

{

    struct target_sigframe *frame;

    abi_ulong frame_addr;

    abi_ulong retcode_addr;

    abi_ulong sc_addr;

    int err = 0;

    int i;



    frame_addr = get_sigframe(ka, env, sizeof *frame);

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

	goto give_sigsegv;



    __put_user(sig, &frame->sig);



    sc_addr = frame_addr + offsetof(struct target_sigframe, sc);

    __put_user(sc_addr, &frame->psc);



    err |= setup_sigcontext(&frame->sc, env, set->sig[0]);

    if (err)

	goto give_sigsegv;



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

        if (__put_user(set->sig[i], &frame->extramask[i - 1]))

            goto give_sigsegv;

    }



    /* Set up to return from userspace.  */



    retcode_addr = frame_addr + offsetof(struct target_sigframe, retcode);

    __put_user(retcode_addr, &frame->pretcode);



    /* moveq #,d0; trap #0 */



    __put_user(0x70004e40 + (TARGET_NR_sigreturn << 16),

                      (long *)(frame->retcode));



    if (err)

        goto give_sigsegv;



    /* Set up to return from userspace */



    env->aregs[7] = frame_addr;

    env->pc = ka->_sa_handler;



    unlock_user_struct(frame, frame_addr, 1);

    return;



give_sigsegv:

    unlock_user_struct(frame, frame_addr, 1);

    force_sig(TARGET_SIGSEGV);

}

static void setup_frame(int sig, struct target_sigaction *ka,

                        target_sigset_t *set, CPUM68KState *env)

{

    struct target_sigframe *frame;

    abi_ulong frame_addr;

    abi_ulong retcode_addr;

    abi_ulong sc_addr;

    int err = 0;

    int i;



    frame_addr = get_sigframe(ka, env, sizeof *frame);

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

	goto give_sigsegv;



    __put_user(sig, &frame->sig);



    sc_addr = frame_addr + offsetof(struct target_sigframe, sc);

    __put_user(sc_addr, &frame->psc);



    err |= setup_sigcontext(&frame->sc, env, set->sig[0]);

    if (err)

	goto give_sigsegv;



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

        if (__put_user(set->sig[i], &frame->extramask[i - 1]))

            goto give_sigsegv;

    }



    



    retcode_addr = frame_addr + offsetof(struct target_sigframe, retcode);

    __put_user(retcode_addr, &frame->pretcode);



    



    __put_user(0x70004e40 + (TARGET_NR_sigreturn << 16),

                      (long *)(frame->retcode));



    if (err)

        goto give_sigsegv;



    



    env->aregs[7] = frame_addr;

    env->pc = ka->_sa_handler;



    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_sigset_t *VAR_2, CPUM68KState *VAR_3)

{

    struct target_sigframe *VAR_4;

    abi_ulong frame_addr;

    abi_ulong retcode_addr;

    abi_ulong sc_addr;

    int VAR_5 = 0;

    int VAR_6;



    frame_addr = get_sigframe(VAR_1, VAR_3, sizeof *VAR_4);

    if (!lock_user_struct(VERIFY_WRITE, VAR_4, frame_addr, 0))

	goto give_sigsegv;



    __put_user(VAR_0, &VAR_4->VAR_0);



    sc_addr = frame_addr + offsetof(struct target_sigframe, sc);

    __put_user(sc_addr, &VAR_4->psc);



    VAR_5 |= setup_sigcontext(&VAR_4->sc, VAR_3, VAR_2->VAR_0[0]);

    if (VAR_5)

	goto give_sigsegv;



    for(VAR_6 = 1; VAR_6 < TARGET_NSIG_WORDS; VAR_6++) {

        if (__put_user(VAR_2->VAR_0[VAR_6], &VAR_4->extramask[VAR_6 - 1]))

            goto give_sigsegv;

    }



    



    retcode_addr = frame_addr + offsetof(struct target_sigframe, retcode);

    __put_user(retcode_addr, &VAR_4->pretcode);



    



    __put_user(0x70004e40 + (TARGET_NR_sigreturn << 16),

                      (long *)(VAR_4->retcode));



    if (VAR_5)

        goto give_sigsegv;



    



    VAR_3->aregs[7] = frame_addr;

    VAR_3->pc = VAR_1->_sa_handler;



    unlock_user_struct(VAR_4, frame_addr, 1);

    return;



give_sigsegv:

    unlock_user_struct(VAR_4, frame_addr, 1);

    force_sig(TARGET_SIGSEGV);

}

static void FUNC_0(int VAR_0, struct target_sigaction *VAR_1,
target_sigset_t *VAR_2, CPUM68KState *VAR_3)
{ struct target_sigframe *VAR_4; abi_ulong frame_addr; abi_ulong retcode_addr; abi_ulong sc_addr; int VAR_5 = 0; int VAR_6; frame_addr = get_sigframe(VAR_1, VAR_3, sizeof *VAR_4); if (!lock_user_struct(VERIFY_WRITE, VAR_4, frame_addr, 0))
goto give_sigsegv; __put_user(VAR_0, &VAR_4->VAR_0); sc_addr = frame_addr + offsetof(struct target_sigframe, sc); __put_user(sc_addr, &VAR_4->psc); VAR_5 |= setup_sigcontext(&VAR_4->sc, VAR_3, VAR_2->VAR_0[0]); if (VAR_5)
goto give_sigsegv; for(VAR_6 = 1; VAR_6 < TARGET_NSIG_WORDS; VAR_6++) { if (__put_user(VAR_2->VAR_0[VAR_6], &VAR_4->extramask[VAR_6 - 1]))
goto give_sigsegv; } retcode_addr = frame_addr + offsetof(struct target_sigframe, retcode); __put_user(retcode_addr, &VAR_4->pretcode); __put_user(0x70004e40 + (TARGET_NR_sigreturn << 16),
(long *)(VAR_4->retcode)); if (VAR_5)
goto give_sigsegv; VAR_3->aregs[7] = frame_addr; VAR_3->pc = VAR_1->_sa_handler; unlock_user_struct(VAR_4, frame_addr, 1); return; give_sigsegv:
unlock_user_struct(VAR_4, frame_addr, 1); force_sig(TARGET_SIGSEGV); }