From e1211e55062594679697d2175b7ea77dad173823 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 30 Dec 2015 03:28:45 -0500 Subject: sim: arm/d10v/h8300/m68hc11/microblaze/mips/mn10300/moxie/sh/v850: convert to common sim_{fetch,store}_register --- sim/microblaze/ChangeLog | 8 ++++++++ sim/microblaze/interp.c | 13 ++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) (limited to 'sim/microblaze') diff --git a/sim/microblaze/ChangeLog b/sim/microblaze/ChangeLog index 9e88371..9346778 100644 --- a/sim/microblaze/ChangeLog +++ b/sim/microblaze/ChangeLog @@ -1,3 +1,11 @@ +2015-12-30 Mike Frysinger + + * wrapper.c (sim_store_register): Rename to ... + (microblaze_reg_store): ... this. Delete local cpu var. + (sim_fetch_register): Rename to ... + (microblaze_reg_fetch): ... this. Delete local cpu var. + (sim_open): Call CPU_REG_FETCH/CPU_REG_STORE. + 2015-12-27 Mike Frysinger * Makefile.in (SIM_OBJS): Delete sim-hload.o. diff --git a/sim/microblaze/interp.c b/sim/microblaze/interp.c index 3ca5e1f..90dcd6f 100644 --- a/sim/microblaze/interp.c +++ b/sim/microblaze/interp.c @@ -304,11 +304,9 @@ sim_engine_run (SIM_DESC sd, CPU.cycles += memops; /* and memop cycle delays */ } -int -sim_store_register (SIM_DESC sd, int rn, unsigned char *memory, int length) +static int +microblaze_reg_store (SIM_CPU *cpu, int rn, unsigned char *memory, int length) { - SIM_CPU *cpu = STATE_CPU (sd, 0); - if (rn < NUM_REGS + NUM_SPECIAL && rn >= 0) { if (length == 4) @@ -328,10 +326,9 @@ sim_store_register (SIM_DESC sd, int rn, unsigned char *memory, int length) return 0; } -int -sim_fetch_register (SIM_DESC sd, int rn, unsigned char *memory, int length) +static int +microblaze_reg_fetch (SIM_CPU *cpu, int rn, unsigned char *memory, int length) { - SIM_CPU *cpu = STATE_CPU (sd, 0); long ival; if (rn < NUM_REGS + NUM_SPECIAL && rn >= 0) @@ -447,6 +444,8 @@ sim_open (SIM_OPEN_KIND kind, host_callback *cb, struct bfd *abfd, char **argv) { SIM_CPU *cpu = STATE_CPU (sd, i); + CPU_REG_FETCH (cpu) = microblaze_reg_fetch; + CPU_REG_STORE (cpu) = microblaze_reg_store; CPU_PC_FETCH (cpu) = microblaze_pc_get; CPU_PC_STORE (cpu) = microblaze_pc_set; -- cgit v1.1