diff options
author | Mike Frysinger <vapier@gentoo.org> | 2015-11-15 03:41:26 -0800 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2015-11-15 21:49:41 -0500 |
commit | 9db36cf86d58f93def38a94ed05e1854beda3b20 (patch) | |
tree | 789e580ff94a4be35a0a6c970347eec3a8ab10b9 /sim/cr16/interp.c | |
parent | 0ef7f98177f610dbb503d87f405c54e3722d8b25 (diff) | |
download | gdb-9db36cf86d58f93def38a94ed05e1854beda3b20.zip gdb-9db36cf86d58f93def38a94ed05e1854beda3b20.tar.gz gdb-9db36cf86d58f93def38a94ed05e1854beda3b20.tar.bz2 |
sim: cr16: drop global callback state
Now that we have access to the sim state in all the right places,
use existing sim helpers in place of cr16_callback directly.
Diffstat (limited to 'sim/cr16/interp.c')
-rw-r--r-- | sim/cr16/interp.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/sim/cr16/interp.c b/sim/cr16/interp.c index 8925d85..967f1b1 100644 --- a/sim/cr16/interp.c +++ b/sim/cr16/interp.c @@ -35,8 +35,6 @@ int cr16_debug; -host_callback *cr16_callback; - uint32 OP[4]; uint32 sign_flag; @@ -326,12 +324,11 @@ get_operands (operand_desc *s, uint64 ins, int isize, int nops) static int do_run (SIM_DESC sd, SIM_CPU *cpu, uint64 mcode) { - host_callback *cr16_callback = STATE_CALLBACK (sd); struct hash_entry *h; #ifdef DEBUG if ((cr16_debug & DEBUG_INSTRUCTION) != 0) - (*cr16_callback->printf_filtered) (cr16_callback, "do_long 0x%x\n", mcode); + sim_io_printf (sd, "do_long 0x%x\n", mcode); #endif h = lookup_hash (sd, cpu, mcode, 1); @@ -463,8 +460,6 @@ sim_open (SIM_OPEN_KIND kind, struct host_callback_struct *cb, struct bfd *abfd, but it matches what the toolchain currently expects. Ugh. */ sim_do_commandf (sd, "memory-size %#x", 20 * 1024 * 1024); - cr16_callback = cb; - /* put all the opcodes in the hash table. */ if (!init_p++) { @@ -585,7 +580,7 @@ step_once (SIM_DESC sd, SIM_CPU *cpu) curr_ins_size = do_run (sd, cpu, mcode); #if CR16_DEBUG - (*cr16_callback->printf_filtered) (cr16_callback, "INS: PC=0x%X, mcode=0x%X\n", PC, mcode); + sim_io_printf (sd, "INS: PC=0x%X, mcode=0x%X\n", PC, mcode); #endif if (curr_ins_size == 0) @@ -674,7 +669,7 @@ sim_create_inferior (SIM_DESC sd, struct bfd *abfd, char **argv, char **env) start_address = 0x0; #ifdef DEBUG if (cr16_debug) - (*cr16_callback->printf_filtered) (cr16_callback, "sim_create_inferior: PC=0x%lx\n", (long) start_address); + sim_io_printf (sd, "sim_create_inferior: PC=0x%lx\n", (long) start_address); #endif { SIM_CPU *cpu = STATE_CPU (sd, 0); |