diff options
author | Mike Frysinger <vapier@gentoo.org> | 2016-08-16 19:50:25 -0700 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2022-12-21 00:00:01 -0500 |
commit | 3fbdc6f90847a1943a6b20b0ffc9b27952df6621 (patch) | |
tree | 842442ceb8a0ebe40f01361312b2bc7ac2c47643 /sim/h8300/sim-main.h | |
parent | 79d784aef987bacd6e8072f5819ae07a078558da (diff) | |
download | fsf-binutils-gdb-3fbdc6f90847a1943a6b20b0ffc9b27952df6621.zip fsf-binutils-gdb-3fbdc6f90847a1943a6b20b0ffc9b27952df6621.tar.gz fsf-binutils-gdb-3fbdc6f90847a1943a6b20b0ffc9b27952df6621.tar.bz2 |
sim: h8300: invert sim_cpu storage
Diffstat (limited to 'sim/h8300/sim-main.h')
-rw-r--r-- | sim/h8300/sim-main.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sim/h8300/sim-main.h b/sim/h8300/sim-main.h index f27ba68..d0a04f5 100644 --- a/sim/h8300/sim-main.h +++ b/sim/h8300/sim-main.h @@ -5,6 +5,8 @@ #ifndef SIM_MAIN_H #define SIM_MAIN_H +#define SIM_HAVE_COMMON_SIM_CPU + #define DEBUG /* These define the size of main memory for the simulator. @@ -114,7 +116,7 @@ typedef struct #endif } decoded_inst; -struct _sim_cpu { +struct h8300_sim_cpu { unsigned int regs[20]; /* 8 GR's plus ZERO, SBR, and VBR. */ unsigned int pc; @@ -128,9 +130,8 @@ struct _sim_cpu { unsigned char *memory; int mask; - - sim_cpu_base base; }; +#define H8300_SIM_CPU(sd) ((struct h8300_sim_cpu *) CPU_ARCH_DATA (sd)) struct h8300_sim_state { unsigned long memory_size; @@ -142,8 +143,8 @@ struct h8300_sim_state { /* The current state of the processor; registers, memory, etc. */ -#define cpu_set_pc(CPU, VAL) (((CPU)->pc) = (VAL)) -#define cpu_get_pc(CPU) (((CPU)->pc)) +#define cpu_set_pc(cpu, val) (H8300_SIM_CPU (cpu)->pc = (val)) +#define cpu_get_pc(cpu) (H8300_SIM_CPU (cpu)->pc) /* Magic numbers used to distinguish an exit from a breakpoint. */ #define LIBC_EXIT_MAGIC1 0xdead |