diff options
Diffstat (limited to 'sim/mn10300')
-rw-r--r-- | sim/mn10300/ChangeLog | 9 | ||||
-rw-r--r-- | sim/mn10300/interp.c | 19 |
2 files changed, 18 insertions, 10 deletions
diff --git a/sim/mn10300/ChangeLog b/sim/mn10300/ChangeLog index a159aa4..d59a7e8 100644 --- a/sim/mn10300/ChangeLog +++ b/sim/mn10300/ChangeLog @@ -1,3 +1,12 @@ +2015-12-30 Mike Frysinger <vapier@gentoo.org> + + * wrapper.c (mn10300_reg_store, mn10300_reg_fetch): Define. + (sim_open): Call CPU_REG_FETCH/CPU_REG_STORE. + (sim_store_register): Rename to ... + (mn10300_reg_store): ... this. + (sim_fetch_register): Rename to ... + (mn10300_reg_fetch): ... this. + 2015-12-27 Mike Frysinger <vapier@gentoo.org> * Makefile.in (MN10300_OBJS): Delete sim-hload.o. diff --git a/sim/mn10300/interp.c b/sim/mn10300/interp.c index 4940acc..8550c45 100644 --- a/sim/mn10300/interp.c +++ b/sim/mn10300/interp.c @@ -86,6 +86,9 @@ mn10300_pc_set (sim_cpu *cpu, sim_cia pc) PC = pc; } +static int mn10300_reg_fetch (SIM_CPU *, int, unsigned char *, int); +static int mn10300_reg_store (SIM_CPU *, int, unsigned char *, int); + /* These default values correspond to expected usage for the chip. */ SIM_DESC @@ -308,6 +311,8 @@ sim_open (SIM_OPEN_KIND kind, { SIM_CPU *cpu = STATE_CPU (sd, i); + CPU_REG_FETCH (cpu) = mn10300_reg_fetch; + CPU_REG_STORE (cpu) = mn10300_reg_store; CPU_PC_FETCH (cpu) = mn10300_pc_get; CPU_PC_STORE (cpu) = mn10300_pc_set; } @@ -338,11 +343,8 @@ sim_create_inferior (SIM_DESC sd, /* FIXME These would more efficient to use than load_mem/store_mem, but need to be changed to use the memory map. */ -int -sim_fetch_register (SIM_DESC sd, - int rn, - unsigned char *memory, - int length) +static int +mn10300_reg_fetch (SIM_CPU *cpu, int rn, unsigned char *memory, int length) { reg_t reg = State.regs[rn]; uint8 *a = memory; @@ -353,11 +355,8 @@ sim_fetch_register (SIM_DESC sd, return length; } -int -sim_store_register (SIM_DESC sd, - int rn, - unsigned char *memory, - int length) +static int +mn10300_reg_store (SIM_CPU *cpu, int rn, unsigned char *memory, int length) { uint8 *a = memory; State.regs[rn] = (a[3] << 24) + (a[2] << 16) + (a[1] << 8) + a[0]; |