For sim_fetch_register / sim_store_register: Add LENGTH parameter,

return actual size of register, 0 if not applicable, -1 of legacy
implementation.
This commit is contained in:
Andrew Cagney
1998-02-17 04:06:38 +00:00
parent c5efcf3c85
commit fbb8b6b9ab
10 changed files with 256 additions and 146 deletions

View File

@@ -1,3 +1,10 @@
Tue Feb 17 12:52:24 1998 Andrew Cagney <cagney@b1.cygnus.com>
* run.c (main): Pass length into sim_fetch_register.
* interp.c (sim_store_register, sim_fetch_register): Pass in
length parameter. Return -1.
Tue Aug 26 10:43:11 1997 Andrew Cagney <cagney@b1.cygnus.com>
* interp.c (sim_kill): Delete.

View File

@@ -233,10 +233,11 @@ rinfo[] =
0
};
void
sim_store_register (rn, value)
int
sim_store_register (rn, value, length)
int rn;
unsigned char *value;
int length;
{
unsigned int val;
int i;
@@ -247,12 +248,14 @@ sim_store_register (rn, value)
}
*(rinfo[rn].ptr) = val;
return -1;
}
void
sim_fetch_register (rn, buf)
int
sim_fetch_register (rn, buf, length)
int rn;
unsigned char *buf;
int length;
{
unsigned int val = *(rinfo[rn].ptr);
int i;
@@ -262,6 +265,7 @@ sim_fetch_register (rn, buf)
*buf++ = val;
val = val >> 8;
}
return -1;
}

View File

@@ -113,7 +113,7 @@ main (ac, av)
/* Find out what was in r0 and return that */
{
unsigned char b[4];
sim_fetch_register(0, b);
sim_fetch_register(0, b, 4);
return b[3];
}