diff options
author | Mike Frysinger <vapier@gentoo.org> | 2015-04-16 02:11:12 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2015-04-17 02:44:30 -0400 |
commit | 034685f9ce92cf6dfb6656745365b6a5904a8e84 (patch) | |
tree | c4b591263048d0a9d89af68c9abd8e69786ed2f7 /sim/mn10300/interp.c | |
parent | 27b97b40bca216097d16d53fa9408a70cd281479 (diff) | |
download | gdb-034685f9ce92cf6dfb6656745365b6a5904a8e84.zip gdb-034685f9ce92cf6dfb6656745365b6a5904a8e84.tar.gz gdb-034685f9ce92cf6dfb6656745365b6a5904a8e84.tar.bz2 |
sim: replace CIA_{GET,SET} with CPU_PC_{GET,SET}
The CIA_{GET,SET} macros serve the same function as CPU_PC_{GET,SET}
except the latter adds a layer of indirection via the sim state. This
lets models set up different functions at runtime and doesn't reach so
directly into the arch-specific cpu state.
It also doesn't make sense to have two sets of macros that do exactly
the same thing, so lets standardize on the one that gets us more.
Diffstat (limited to 'sim/mn10300/interp.c')
-rw-r--r-- | sim/mn10300/interp.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sim/mn10300/interp.c b/sim/mn10300/interp.c index 850f057..4439ac8 100644 --- a/sim/mn10300/interp.c +++ b/sim/mn10300/interp.c @@ -346,7 +346,7 @@ sim_create_inferior (SIM_DESC sd, } else { PC = 0; } - CIA_SET (STATE_CPU (sd, 0), (unsigned64) PC); + CPU_PC_SET (STATE_CPU (sd, 0), (unsigned64) PC); if (STATE_ARCHITECTURE (sd)->mach == bfd_mach_am33_2) PSW |= PSW_FE; @@ -482,7 +482,7 @@ program_interrupt (SIM_DESC sd, { in_interrupt = 1; /* copy NMI handler code from dv-mn103cpu.c */ - store_word (SP - 4, CIA_GET (cpu)); + store_word (SP - 4, CPU_PC_GET (cpu)); store_half (SP - 8, PSW); /* Set the SYSEF flag in NMICR by backdoor method. See @@ -496,7 +496,7 @@ program_interrupt (SIM_DESC sd, PSW &= ~PSW_IE; SP = SP - 8; - CIA_SET (cpu, 0x40000008); + CPU_PC_SET (cpu, 0x40000008); in_interrupt = 0; sim_engine_halt(sd, cpu, NULL, cia, sim_stopped, sig); @@ -511,7 +511,7 @@ mn10300_cpu_exception_trigger(SIM_DESC sd, sim_cpu* cpu, address_word cia) if(State.exc_suspended > 0) sim_io_eprintf(sd, "Warning, nested exception triggered (%d)\n", State.exc_suspended); - CIA_SET (cpu, cia); + CPU_PC_SET (cpu, cia); memcpy(State.exc_trigger_regs, State.regs, sizeof(State.exc_trigger_regs)); State.exc_suspended = 0; } @@ -527,7 +527,7 @@ mn10300_cpu_exception_suspend(SIM_DESC sd, sim_cpu* cpu, int exception) memcpy(State.exc_suspend_regs, State.regs, sizeof(State.exc_suspend_regs)); memcpy(State.regs, State.exc_trigger_regs, sizeof(State.regs)); - CIA_SET (cpu, PC); /* copy PC back from new State.regs */ + CPU_PC_SET (cpu, PC); /* copy PC back from new State.regs */ State.exc_suspended = exception; } @@ -549,7 +549,7 @@ mn10300_cpu_exception_resume(SIM_DESC sd, sim_cpu* cpu, int exception) State.exc_suspended, exception); memcpy(State.regs, State.exc_suspend_regs, sizeof(State.regs)); - CIA_SET (cpu, PC); /* copy PC back from new State.regs */ + CPU_PC_SET (cpu, PC); /* copy PC back from new State.regs */ } else if(exception != 0 && State.exc_suspended == 0) { |