void cpu_loop(CPUCRISState *env)

{

    CPUState *cs = CPU(cris_env_get_cpu(env));

    int trapnr, ret;

    target_siginfo_t info;

    

    while (1) {

        cpu_exec_start(cs);

        trapnr = cpu_cris_exec(cs);

        cpu_exec_end(cs);

        switch (trapnr) {

        case 0xaa:

            {

                info.si_signo = TARGET_SIGSEGV;

                info.si_errno = 0;

                /* XXX: check env->error_code */

                info.si_code = TARGET_SEGV_MAPERR;

                info._sifields._sigfault._addr = env->pregs[PR_EDA];

                queue_signal(env, info.si_signo, &info);

            }

            break;

	case EXCP_INTERRUPT:

	  /* just indicate that signals should be handled asap */

	  break;

        case EXCP_BREAK:

            ret = do_syscall(env, 

                             env->regs[9], 

                             env->regs[10], 

                             env->regs[11], 

                             env->regs[12], 

                             env->regs[13], 

                             env->pregs[7], 

                             env->pregs[11],

                             0, 0);

            env->regs[10] = ret;

            break;

        case EXCP_DEBUG:

            {

                int sig;



                sig = gdb_handlesig(cs, TARGET_SIGTRAP);

                if (sig)

                  {

                    info.si_signo = sig;

                    info.si_errno = 0;

                    info.si_code = TARGET_TRAP_BRKPT;

                    queue_signal(env, info.si_signo, &info);

                  }

            }

            break;

        default:

            printf ("Unhandled trap: 0x%x\n", trapnr);

            cpu_dump_state(cs, stderr, fprintf, 0);

            exit(EXIT_FAILURE);

        }

        process_pending_signals (env);

    }

}

void cpu_loop(CPUCRISState *env)

{

    CPUState *cs = CPU(cris_env_get_cpu(env));

    int trapnr, ret;

    target_siginfo_t info;

    

    while (1) {

        cpu_exec_start(cs);

        trapnr = cpu_cris_exec(cs);

        cpu_exec_end(cs);

        switch (trapnr) {

        case 0xaa:

            {

                info.si_signo = TARGET_SIGSEGV;

                info.si_errno = 0;

                

                info.si_code = TARGET_SEGV_MAPERR;

                info._sifields._sigfault._addr = env->pregs[PR_EDA];

                queue_signal(env, info.si_signo, &info);

            }

            break;

	case EXCP_INTERRUPT:

	  

	  break;

        case EXCP_BREAK:

            ret = do_syscall(env, 

                             env->regs[9], 

                             env->regs[10], 

                             env->regs[11], 

                             env->regs[12], 

                             env->regs[13], 

                             env->pregs[7], 

                             env->pregs[11],

                             0, 0);

            env->regs[10] = ret;

            break;

        case EXCP_DEBUG:

            {

                int sig;



                sig = gdb_handlesig(cs, TARGET_SIGTRAP);

                if (sig)

                  {

                    info.si_signo = sig;

                    info.si_errno = 0;

                    info.si_code = TARGET_TRAP_BRKPT;

                    queue_signal(env, info.si_signo, &info);

                  }

            }

            break;

        default:

            printf ("Unhandled trap: 0x%x\n", trapnr);

            cpu_dump_state(cs, stderr, fprintf, 0);

            exit(EXIT_FAILURE);

        }

        process_pending_signals (env);

    }

}

void FUNC_0(CPUCRISState *VAR_0)

{

    CPUState *cs = CPU(cris_env_get_cpu(VAR_0));

    int VAR_1, VAR_2;

    target_siginfo_t info;

    

    while (1) {

        cpu_exec_start(cs);

        VAR_1 = cpu_cris_exec(cs);

        cpu_exec_end(cs);

        switch (VAR_1) {

        case 0xaa:

            {

                info.si_signo = TARGET_SIGSEGV;

                info.si_errno = 0;

                

                info.si_code = TARGET_SEGV_MAPERR;

                info._sifields._sigfault._addr = VAR_0->pregs[PR_EDA];

                queue_signal(VAR_0, info.si_signo, &info);

            }

            break;

	case EXCP_INTERRUPT:

	  

	  break;

        case EXCP_BREAK:

            VAR_2 = do_syscall(VAR_0, 

                             VAR_0->regs[9], 

                             VAR_0->regs[10], 

                             VAR_0->regs[11], 

                             VAR_0->regs[12], 

                             VAR_0->regs[13], 

                             VAR_0->pregs[7], 

                             VAR_0->pregs[11],

                             0, 0);

            VAR_0->regs[10] = VAR_2;

            break;

        case EXCP_DEBUG:

            {

                int VAR_3;



                VAR_3 = gdb_handlesig(cs, TARGET_SIGTRAP);

                if (VAR_3)

                  {

                    info.si_signo = VAR_3;

                    info.si_errno = 0;

                    info.si_code = TARGET_TRAP_BRKPT;

                    queue_signal(VAR_0, info.si_signo, &info);

                  }

            }

            break;

        default:

            printf ("Unhandled trap: 0x%x\n", VAR_1);

            cpu_dump_state(cs, stderr, fprintf, 0);

            exit(EXIT_FAILURE);

        }

        process_pending_signals (VAR_0);

    }

}

void FUNC_0(CPUCRISState *VAR_0)
{ CPUState *cs = CPU(cris_env_get_cpu(VAR_0)); int VAR_1, VAR_2; target_siginfo_t info; while (1) { cpu_exec_start(cs); VAR_1 = cpu_cris_exec(cs); cpu_exec_end(cs); switch (VAR_1) { case 0xaa:
{ info.si_signo = TARGET_SIGSEGV; info.si_errno = 0; info.si_code = TARGET_SEGV_MAPERR; info._sifields._sigfault._addr = VAR_0->pregs[PR_EDA]; queue_signal(VAR_0, info.si_signo, &info); } break; case EXCP_INTERRUPT:
break; case EXCP_BREAK:
VAR_2 = do_syscall(VAR_0,
VAR_0->regs[9],
VAR_0->regs[10],
VAR_0->regs[11],
VAR_0->regs[12],
VAR_0->regs[13],
VAR_0->pregs[7],
VAR_0->pregs[11],
0, 0); VAR_0->regs[10] = VAR_2; break; case EXCP_DEBUG:
{ int VAR_3; VAR_3 = gdb_handlesig(cs, TARGET_SIGTRAP); if (VAR_3)
{ info.si_signo = VAR_3; info.si_errno = 0; info.si_code = TARGET_TRAP_BRKPT; queue_signal(VAR_0, info.si_signo, &info); } } break; default:
printf ("Unhandled trap: 0x%x\n", VAR_1); cpu_dump_state(cs, stderr, fprintf, 0); exit(EXIT_FAILURE); } process_pending_signals (VAR_0); } }