From d47f5b30d8481272e9480118bdcb283690070349 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 2 Jan 2016 09:23:06 -0500 Subject: sim: delete dead current_state globals The global current_state handle to the current simulator state is a design idea that was half implemented, but never really cleaned up. The point was to have a global variable pointing to the state so that funcs could more quickly & easily access the state anywhere. We've instead moved in the direction of passing state around everywhere and don't have any intention of moving back. I also can't find any references to gdb using this variable, or to cgen related "dump_regs" functions, both of which were used in the comments related to this code. --- sim/frv/ChangeLog | 6 ++++++ sim/frv/reset.c | 2 +- sim/frv/sim-if.c | 8 -------- 3 files changed, 7 insertions(+), 9 deletions(-) (limited to 'sim/frv') diff --git a/sim/frv/ChangeLog b/sim/frv/ChangeLog index c716e6a..a566ba0 100644 --- a/sim/frv/ChangeLog +++ b/sim/frv/ChangeLog @@ -1,3 +1,9 @@ +2016-01-02 Mike Frysinger + + * reset.c (frv_term): Change current_state to sd. + * sim-if.c (current_state): Delete. + (sim_open): Delete current_state assignment. + 2015-12-27 Mike Frysinger * Makefile.in (SIM_OBJS): Delete sim-hload.o. diff --git a/sim/frv/reset.c b/sim/frv/reset.c index 0bc9dd9..6f973b5 100644 --- a/sim/frv/reset.c +++ b/sim/frv/reset.c @@ -105,7 +105,7 @@ frv_term (SIM_DESC sd) then turn it off again. This is the only place we can currently gain control to do this. */ if (frv_interrupt_state.timer.enabled && ! frv_save_profile_model_p) - sim_profile_set_option (current_state, "-model", PROFILE_MODEL_IDX, "0"); + sim_profile_set_option (sd, "-model", PROFILE_MODEL_IDX, "0"); } /* Perform a power on reset. */ diff --git a/sim/frv/sim-if.c b/sim/frv/sim-if.c index aab8ff7..6bf77fd 100644 --- a/sim/frv/sim-if.c +++ b/sim/frv/sim-if.c @@ -30,10 +30,6 @@ along with this program. If not, see . */ static void free_state (SIM_DESC); static void print_frv_misc_cpu (SIM_CPU *cpu, int verbose); - -/* Records simulator descriptor so utilities like frv_dump_regs can be - called from gdb. */ -SIM_DESC current_state; /* Cover function of sim_state_free to free the cpu buffers as well. */ @@ -175,10 +171,6 @@ sim_open (kind, callback, abfd, argv) frv_initialize (cpu, sd); } - /* Store in a global so things like sparc32_dump_regs can be invoked - from the gdb command line. */ - current_state = sd; - return sd; } -- cgit v1.1