aboutsummaryrefslogtreecommitdiff
path: root/sim/d10v/interp.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>1997-10-22 05:26:27 +0000
committerAndrew Cagney <cagney@redhat.com>1997-10-22 05:26:27 +0000
commit9e03a68f136a021e7bfa9afb18ca4f170e949f80 (patch)
tree78c37915fae5528e6e3cba233bbecbd7c368fa39 /sim/d10v/interp.c
parent2328ef1c9815f27863ca176608f87cd4c2ba3665 (diff)
downloadgdb-9e03a68f136a021e7bfa9afb18ca4f170e949f80.zip
gdb-9e03a68f136a021e7bfa9afb18ca4f170e949f80.tar.gz
gdb-9e03a68f136a021e7bfa9afb18ca4f170e949f80.tar.bz2
Add LMA_P and DO_WRITE arguments to sim/common/sim-load.c:sim_load_file().
Update all simulators. Clarify behavour of sim_load in remote-sim.h
Diffstat (limited to 'sim/d10v/interp.c')
-rw-r--r--sim/d10v/interp.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/sim/d10v/interp.c b/sim/d10v/interp.c
index 5dfb100..76bb438 100644
--- a/sim/d10v/interp.c
+++ b/sim/d10v/interp.c
@@ -432,6 +432,16 @@ xfer_mem (addr, buffer, size, write)
}
+static int
+sim_write_phys (sd, addr, buffer, size)
+ SIM_DESC sd;
+ SIM_ADDR addr;
+ unsigned char *buffer;
+ int size;
+{
+ return xfer_mem( addr, buffer, size, 1);
+}
+
int
sim_write (sd, addr, buffer, size)
SIM_DESC sd;
@@ -439,6 +449,7 @@ sim_write (sd, addr, buffer, size)
unsigned char *buffer;
int size;
{
+ /* FIXME: this should be performing a virtual transfer */
return xfer_mem( addr, buffer, size, 1);
}
@@ -449,6 +460,7 @@ sim_read (sd, addr, buffer, size)
unsigned char *buffer;
int size;
{
+ /* FIXME: this should be performing a virtual transfer */
return xfer_mem( addr, buffer, size, 0);
}
@@ -600,6 +612,9 @@ pc_addr()
return 0;
}
+ /* Discard upper bit(s) of PC in case IMAP1 selects unified memory. */
+ pc &= (1 << UMEM_SIZE) - 1;
+
return State.umem[imap & 0xff] + pc;
}
@@ -664,7 +679,10 @@ sim_resume (sd, step, siggnal)
{
RPT_C -= 1;
if (RPT_C == 0)
- State.RP = 0;
+ {
+ State.RP = 0;
+ PC++;
+ }
else
PC = RPT_S;
}
@@ -926,7 +944,8 @@ sim_load (sd, prog, abfd, from_tty)
if (prog_bfd != NULL && prog_bfd_was_opened_p)
bfd_close (prog_bfd);
prog_bfd = sim_load_file (sd, myname, d10v_callback, prog, abfd,
- sim_kind == SIM_OPEN_DEBUG);
+ sim_kind == SIM_OPEN_DEBUG,
+ 0, sim_write_phys);
if (prog_bfd == NULL)
return SIM_RC_FAIL;
prog_bfd_was_opened_p = abfd == NULL;