diff options
author | Mike Frysinger <vapier@gentoo.org> | 2016-08-13 00:37:34 +0800 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2022-12-21 00:00:00 -0500 |
commit | 778ef9bcbb268228bf6ad0171cf9f539979208c8 (patch) | |
tree | 805b36f5d290d48c59700d94ec150eec3f8c2e6e /sim/moxie/interp.c | |
parent | 1c867d708c253f0d0f599919691c92276641e5ae (diff) | |
download | gdb-778ef9bcbb268228bf6ad0171cf9f539979208c8.zip gdb-778ef9bcbb268228bf6ad0171cf9f539979208c8.tar.gz gdb-778ef9bcbb268228bf6ad0171cf9f539979208c8.tar.bz2 |
sim: moxie: invert sim_cpu storage
Diffstat (limited to 'sim/moxie/interp.c')
-rw-r--r-- | sim/moxie/interp.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sim/moxie/interp.c b/sim/moxie/interp.c index fec79aa..ea0a559 100644 --- a/sim/moxie/interp.c +++ b/sim/moxie/interp.c @@ -127,7 +127,7 @@ struct moxie_regset #define CC_GTU 1<<3 #define CC_LTU 1<<4 -/* TODO: This should be moved to sim-main.h:_sim_cpu. */ +/* TODO: This should be moved to sim-main.h:moxie_sim_cpu. */ union { struct moxie_regset asregs; @@ -1173,13 +1173,13 @@ moxie_reg_fetch (SIM_CPU *scpu, int rn, void *memory, int length) static sim_cia moxie_pc_get (sim_cpu *cpu) { - return cpu->registers[PCIDX]; + return MOXIE_SIM_CPU (cpu)->registers[PCIDX]; } static void moxie_pc_set (sim_cpu *cpu, sim_cia pc) { - cpu->registers[PCIDX] = pc; + MOXIE_SIM_CPU (cpu)->registers[PCIDX] = pc; } static void @@ -1203,7 +1203,8 @@ sim_open (SIM_OPEN_KIND kind, host_callback *cb, current_target_byte_order = BFD_ENDIAN_BIG; /* The cpu data is kept in a separately allocated chunk of memory. */ - if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK) + if (sim_cpu_alloc_all_extra (sd, 1, sizeof (struct moxie_sim_cpu)) + != SIM_RC_OK) { free_state (sd); return 0; |