[RFC] sim: Update sim_{fetch,store}_register for sh and mn10300

Kevin Buettner
2012-02-16T00:13:42Z

The patch below updates sim_fetch_register for both mn10300 and sh
to return the length of the value being fetched instead of -1. For
sh, sim_store_register() is changed in a like fashion.

This change is necessary due to past changes to remote-sim.c which do
more stringent checks of the return value.

Comments?

sim/mn10300/ChangeLog:

* interp.c (sim_fetch_register): Return length, not -1.

sim/ChangeLog:

* sh/interp.c (sim_store_register, sim_fetch_register): Return
length, not -1.

Index: sim/mn10300/interp.c
===================================================================
RCS file: /cvs/src/src/sim/mn10300/interp.c,v
retrieving revision 1.7
diff -u -p -r1.7 interp.c
--- sim/mn10300/interp.c 5 Jul 2011 19:06:38 -0000 1.7
+++ sim/mn10300/interp.c 15 Feb 2012 23:59:49 -0000
@@ -383,7 +383,7 @@ sim_fetch_register (SIM_DESC sd,
int length)
{
put_word (memory, State.regs[rn]);
- return -1;
+ return length;
}

int
Index: sim/sh/interp.c
===================================================================
RCS file: /cvs/src/src/sim/sh/interp.c,v
retrieving revision 1.23
diff -u -p -r1.23 interp.c
--- sim/sh/interp.c 16 Apr 2011 18:16:36 -0000 1.23
+++ sim/sh/interp.c 15 Feb 2012 23:59:49 -0000
@@ -2356,7 +2356,7 @@ sim_store_register (sd, rn, memory, leng
default:
return 0;
}
- return -1;
+ return length;
}

int
@@ -2531,7 +2531,7 @@ sim_fetch_register (sd, rn, memory, leng
return 0;
}
* (int *) memory = swap (val);
- return -1;
+ return length;
}

int