aboutsummaryrefslogtreecommitdiff
path: root/sim/d10v/interp.c
diff options
context:
space:
mode:
Diffstat (limited to 'sim/d10v/interp.c')
-rw-r--r--sim/d10v/interp.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/sim/d10v/interp.c b/sim/d10v/interp.c
index 7fc0745..b975561 100644
--- a/sim/d10v/interp.c
+++ b/sim/d10v/interp.c
@@ -722,6 +722,18 @@ sim_read (SIM_DESC sd, SIM_ADDR addr, unsigned char *buffer, int size)
return xfer_mem( addr, buffer, size, 0);
}
+static sim_cia
+d10v_pc_get (sim_cpu *cpu)
+{
+ return PC;
+}
+
+static void
+d10v_pc_set (sim_cpu *cpu, sim_cia pc)
+{
+ SET_PC (pc);
+}
+
static void
free_state (SIM_DESC sd)
{
@@ -740,6 +752,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *cb, struct bfd *abfd, char **argv)
struct hash_entry *h;
static int init_p = 0;
char **p;
+ int i;
SIM_DESC sd = sim_state_alloc (kind, cb);
SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
@@ -791,6 +804,15 @@ sim_open (SIM_OPEN_KIND kind, host_callback *cb, struct bfd *abfd, char **argv)
return 0;
}
+ /* CPU specific initialization. */
+ for (i = 0; i < MAX_NR_PROCESSORS; ++i)
+ {
+ SIM_CPU *cpu = STATE_CPU (sd, i);
+
+ CPU_PC_FETCH (cpu) = d10v_pc_get;
+ CPU_PC_STORE (cpu) = d10v_pc_set;
+ }
+
trace_sd = sd;
d10v_callback = cb;
old_segment_mapping = 0;