diff options
Diffstat (limited to 'sim/cr16/interp.c')
-rw-r--r-- | sim/cr16/interp.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/sim/cr16/interp.c b/sim/cr16/interp.c index 86fd280..6e31e1a 100644 --- a/sim/cr16/interp.c +++ b/sim/cr16/interp.c @@ -737,6 +737,18 @@ sim_read (SIM_DESC sd, SIM_ADDR addr, unsigned char *buffer, int size) return xfer_mem (sd, addr, buffer, size, 0); } +static sim_cia +cr16_pc_get (sim_cpu *cpu) +{ + return PC; +} + +static void +cr16_pc_set (sim_cpu *cpu, sim_cia pc) +{ + SET_PC (pc); +} + static void free_state (SIM_DESC sd) { @@ -807,6 +819,15 @@ sim_open (SIM_OPEN_KIND kind, struct host_callback_struct *cb, struct bfd *abfd, return 0; } + /* CPU specific initialization. */ + for (i = 0; i < MAX_NR_PROCESSORS; ++i) + { + SIM_CPU *cpu = STATE_CPU (sd, i); + + CPU_PC_FETCH (cpu) = cr16_pc_get; + CPU_PC_STORE (cpu) = cr16_pc_set; + } + trace_sd = sd; cr16_callback = cb; |