diff options
author | Mike Frysinger <vapier@gentoo.org> | 2015-04-17 02:16:10 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2015-04-17 02:22:16 -0400 |
commit | 27b97b40bca216097d16d53fa9408a70cd281479 (patch) | |
tree | b31d55346eb233bc7b163602fdc3339a417923b1 /sim/h8300/compile.c | |
parent | 0fdc66e16e44210dd7468eb78a9c658d6f0b2b65 (diff) | |
download | gdb-27b97b40bca216097d16d53fa9408a70cd281479.zip gdb-27b97b40bca216097d16d53fa9408a70cd281479.tar.gz gdb-27b97b40bca216097d16d53fa9408a70cd281479.tar.bz2 |
sim: arm/cr16/d10v/h8300/microblaze/sh: fill out sim-cpu pc fetch/store helpers
This makes the common sim-cpu logic work.
Diffstat (limited to 'sim/h8300/compile.c')
-rw-r--r-- | sim/h8300/compile.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sim/h8300/compile.c b/sim/h8300/compile.c index e14c3ab..d084b5d 100644 --- a/sim/h8300/compile.c +++ b/sim/h8300/compile.c @@ -4865,6 +4865,18 @@ set_h8300h (unsigned long machine) h8300_normal_mode = 1; } +static sim_cia +h8300_pc_get (sim_cpu *cpu) +{ + return cpu->pc; +} + +static void +h8300_pc_set (sim_cpu *cpu, sim_cia pc) +{ + cpu->pc = pc; +} + /* Cover function of sim_state_free to free the cpu buffers as well. */ static void @@ -4883,6 +4895,7 @@ sim_open (SIM_OPEN_KIND kind, struct bfd *abfd, char **argv) { + int i; SIM_DESC sd; sim_cpu *cpu; @@ -4947,6 +4960,15 @@ sim_open (SIM_OPEN_KIND kind, return 0; } + /* CPU specific initialization. */ + for (i = 0; i < MAX_NR_PROCESSORS; ++i) + { + SIM_CPU *cpu = STATE_CPU (sd, i); + + CPU_PC_FETCH (cpu) = h8300_pc_get; + CPU_PC_STORE (cpu) = h8300_pc_set; + } + /* sim_hw_configure (sd); */ /* FIXME: Much of the code in sim_load can be moved here. */ |