From ebd58f4dde1b5f65e84f61ec05ed5ebf189cb0f3 Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Sat, 16 May 1998 19:51:12 +0000 Subject: [PATCH] * sim-engine.c (sim_engine_set_run_state): New function. * sim-engine.h (sim_engine_set_run_state): Declare. * genmloop.sh (pending_reason,pending_sigrc): New static locals. (@cpu@_engine_stop): New args reason,sigrc. All callers updated. (engine_resume): Reorganize. Allow synchronous exit from main loop. --- sim/common/ChangeLog | 8 ++++++ sim/common/genmloop.sh | 71 ++++++++++++++++++++++++++++++-------------------- 2 files changed, 51 insertions(+), 28 deletions(-) diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index ee51dd9..8298bfe 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,11 @@ +Sat May 16 12:44:52 1998 Doug Evans + + * sim-engine.c (sim_engine_set_run_state): New function. + * sim-engine.h (sim_engine_set_run_state): Declare. + * genmloop.sh (pending_reason,pending_sigrc): New static locals. + (@cpu@_engine_stop): New args reason,sigrc. All callers updated. + (engine_resume): Reorganize. Allow synchronous exit from main loop. + Fri May 15 16:06:05 1998 Doug Evans * cgen-trace.c (trace_insn_init): New arg first_p. diff --git a/sim/common/genmloop.sh b/sim/common/genmloop.sh index 591eb66..d3c18d9 100644 --- a/sim/common/genmloop.sh +++ b/sim/common/genmloop.sh @@ -142,6 +142,10 @@ ${SHELL} $file support cat <jmpbuf = &buf; + sim_engine_set_run_state (sd, sim_running, 0); + pending_reason = sim_running; + pending_sigrc = 0; + + /* ??? Restart support to be added in time. */ + if (setjmp (buf)) { /* Account for the last insn executed. */ ++insn_count; - - engine->jmpbuf = NULL; TRACE_INSN_FINI ((sim_cpu *) cpu, 1); - PROFILE_EXEC_TIME (CPU_PROFILE_DATA (cpu)) - += sim_elapsed_time_since (start_time); - PROFILE_TOTAL_INSN_COUNT (CPU_PROFILE_DATA (cpu)) - += insn_count; - - return; } - - /* ??? Restart support to be added in time. */ - - /* The computed goto switch can be used, and while the number of blocks - may swamp the relatively few that this function contains, when running - with the scache we put the actual semantic code in their own - functions. */ + else + { + /* The computed goto switch can be used, and while the number of blocks + may swamp the relatively few that this function contains, when running + with the scache we put the actual semantic code in their own + functions. */ EOF if [ x$fast = xyes ] ; then cat <jmpbuf = NULL; + PROFILE_EXEC_TIME (CPU_PROFILE_DATA (cpu)) + += sim_elapsed_time_since (start_time); + PROFILE_TOTAL_INSN_COUNT (CPU_PROFILE_DATA (cpu)) + += insn_count; } EOF -- 2.7.4