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/arm | |
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/arm')
-rw-r--r-- | sim/arm/ChangeLog | 6 | ||||
-rw-r--r-- | sim/arm/wrapper.c | 22 |
2 files changed, 28 insertions, 0 deletions
diff --git a/sim/arm/ChangeLog b/sim/arm/ChangeLog index c98903d..01105f8 100644 --- a/sim/arm/ChangeLog +++ b/sim/arm/ChangeLog @@ -1,3 +1,9 @@ +2015-04-17 Mike Frysinger <vapier@gentoo.org> + + * wrapper.c (arm_pc_get, arm_pc_set): New functions. + (sim_open): Declare new local var i. Call CPU_PC_FETCH & + CPU_PC_STORE for all cpus. + 2015-04-15 Mike Frysinger <vapier@gentoo.org> * Makefile.in (SIM_OBJS): Delete sim-cpu.o. diff --git a/sim/arm/wrapper.c b/sim/arm/wrapper.c index dd3cfe2..d69daa3 100644 --- a/sim/arm/wrapper.c +++ b/sim/arm/wrapper.c @@ -800,6 +800,18 @@ sim_target_parse_arg_array (char ** argv) sim_target_parse_command_line (i, argv); } +static sim_cia +arm_pc_get (sim_cpu *cpu) +{ + return PC; +} + +static void +arm_pc_set (sim_cpu *cpu, sim_cia pc) +{ + ARMul_SetPC (state, pc); +} + static void free_state (SIM_DESC sd) { @@ -815,6 +827,7 @@ sim_open (SIM_OPEN_KIND kind, struct bfd *abfd, char **argv) { + int i; SIM_DESC sd = sim_state_alloc (kind, cb); SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER); @@ -866,6 +879,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) = arm_pc_get; + CPU_PC_STORE (cpu) = arm_pc_set; + } + sim_callback = cb; sim_target_parse_arg_array (argv); |