diff options
author | Anthony Green <green@moxielogic.com> | 2017-09-04 10:00:37 -0400 |
---|---|---|
committer | Anthony Green <green@moxielogic.com> | 2017-09-04 10:00:37 -0400 |
commit | 6c869779dad0cf028bd787e6ebbc0780ee4afe13 (patch) | |
tree | f51a4e118babcd8d5170be6bea31c4ede13857a8 /sim | |
parent | badc00202024619e1c868b8cf70fe6351fc028c3 (diff) | |
download | gdb-6c869779dad0cf028bd787e6ebbc0780ee4afe13.zip gdb-6c869779dad0cf028bd787e6ebbc0780ee4afe13.tar.gz gdb-6c869779dad0cf028bd787e6ebbc0780ee4afe13.tar.bz2 |
Fix simulator
Diffstat (limited to 'sim')
-rw-r--r-- | sim/moxie/ChangeLog | 5 | ||||
-rw-r--r-- | sim/moxie/interp.c | 18 |
2 files changed, 16 insertions, 7 deletions
diff --git a/sim/moxie/ChangeLog b/sim/moxie/ChangeLog index 2371ff1..ba228ce 100644 --- a/sim/moxie/ChangeLog +++ b/sim/moxie/ChangeLog @@ -1,3 +1,8 @@ +2017-09-03 Anthony Green <green@moxielogic.com> + + * interp.c (sim_engine_run): Always pass scpu into + sim_engine_halt. Process events within inner loop. + 2016-01-10 Mike Frysinger <vapier@gentoo.org> * config.in, configure: Regenerate. diff --git a/sim/moxie/interp.c b/sim/moxie/interp.c index c9605d4..217aef3 100644 --- a/sim/moxie/interp.c +++ b/sim/moxie/interp.c @@ -343,7 +343,7 @@ sim_engine_run (SIM_DESC sd, default: { MOXIE_TRACE_INSN ("SIGILL3"); - sim_engine_halt (sd, NULL, NULL, pc, sim_stopped, SIM_SIGILL); + sim_engine_halt (sd, scpu, NULL, pc, sim_stopped, SIM_SIGILL); break; } } @@ -394,7 +394,7 @@ sim_engine_run (SIM_DESC sd, break; default: MOXIE_TRACE_INSN ("SIGILL2"); - sim_engine_halt (sd, NULL, NULL, pc, sim_stopped, SIM_SIGILL); + sim_engine_halt (sd, scpu, NULL, pc, sim_stopped, SIM_SIGILL); break; } } @@ -408,7 +408,7 @@ sim_engine_run (SIM_DESC sd, case 0x00: /* bad */ opc = opcode; MOXIE_TRACE_INSN ("SIGILL0"); - sim_engine_halt (sd, NULL, NULL, pc, sim_stopped, SIM_SIGILL); + sim_engine_halt (sd, scpu, NULL, pc, sim_stopped, SIM_SIGILL); break; case 0x01: /* ldi.l (immediate) */ { @@ -666,7 +666,7 @@ sim_engine_run (SIM_DESC sd, { opc = opcode; MOXIE_TRACE_INSN ("SIGILL0"); - sim_engine_halt (sd, NULL, NULL, pc, sim_stopped, SIM_SIGILL); + sim_engine_halt (sd, scpu, NULL, pc, sim_stopped, SIM_SIGILL); break; } case 0x19: /* jsr */ @@ -933,7 +933,7 @@ sim_engine_run (SIM_DESC sd, { case 0x1: /* SYS_exit */ { - sim_engine_halt (sd, NULL, NULL, pc, sim_exited, + sim_engine_halt (sd, scpu, NULL, pc, sim_exited, cpu.asregs.regs[2]); break; } @@ -1046,7 +1046,7 @@ sim_engine_run (SIM_DESC sd, break; case 0x35: /* brk */ MOXIE_TRACE_INSN ("brk"); - sim_engine_halt (sd, NULL, NULL, pc, sim_stopped, SIM_SIGTRAP); + sim_engine_halt (sd, scpu, NULL, pc, sim_stopped, SIM_SIGTRAP); pc -= 2; /* Adjust pc */ break; case 0x36: /* ldo.b */ @@ -1100,7 +1100,7 @@ sim_engine_run (SIM_DESC sd, default: opc = opcode; MOXIE_TRACE_INSN ("SIGILL1"); - sim_engine_halt (sd, NULL, NULL, pc, sim_stopped, SIM_SIGILL); + sim_engine_halt (sd, scpu, NULL, pc, sim_stopped, SIM_SIGILL); break; } } @@ -1108,6 +1108,10 @@ sim_engine_run (SIM_DESC sd, cpu.asregs.insts++; pc += 2; cpu.asregs.regs[PC_REGNO] = pc; + + if (sim_events_tick (sd)) + sim_events_process (sd); + } while (1); } |