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/h8300/ChangeLog | 8 ++++++++ sim/h8300/compile.c | 13 ++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) (limited to 'sim/h8300') diff --git a/sim/h8300/ChangeLog b/sim/h8300/ChangeLog index b293b29..67d3c66 100644 --- a/sim/h8300/ChangeLog +++ b/sim/h8300/ChangeLog @@ -1,5 +1,13 @@ 2015-12-30 Mike Frysinger + * wrapper.c (sim_store_register): Rename to ... + (h8300_reg_store): ... this. Declare sd. + (sim_fetch_register): Rename to ... + (h8300_reg_fetch): ... this. Declare sd. + (sim_open): Call CPU_REG_FETCH/CPU_REG_STORE. + +2015-12-30 Mike Frysinger + * compile.c (lreg): Delete. (init_pointers): Delete lreg assignments. diff --git a/sim/h8300/compile.c b/sim/h8300/compile.c index beb2ab6..4c55a37 100644 --- a/sim/h8300/compile.c +++ b/sim/h8300/compile.c @@ -4600,10 +4600,10 @@ sim_read (SIM_DESC sd, SIM_ADDR addr, unsigned char *buffer, int size) return size; } - -int -sim_store_register (SIM_DESC sd, int rn, unsigned char *value, int length) +static int +h8300_reg_store (SIM_CPU *cpu, int rn, unsigned char *value, int length) { + SIM_DESC sd = CPU_STATE (cpu); int longval; int shortval; int intval; @@ -4665,9 +4665,10 @@ sim_store_register (SIM_DESC sd, int rn, unsigned char *value, int length) return length; } -int -sim_fetch_register (SIM_DESC sd, int rn, unsigned char *buf, int length) +static int +h8300_reg_fetch (SIM_CPU *cpu, int rn, unsigned char *buf, int length) { + SIM_DESC sd = CPU_STATE (cpu); int v; int longreg = 0; @@ -4963,6 +4964,8 @@ sim_open (SIM_OPEN_KIND kind, { SIM_CPU *cpu = STATE_CPU (sd, i); + CPU_REG_FETCH (cpu) = h8300_reg_fetch; + CPU_REG_STORE (cpu) = h8300_reg_store; CPU_PC_FETCH (cpu) = h8300_pc_get; CPU_PC_STORE (cpu) = h8300_pc_set; } -- cgit v1.1