]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
sim: replace CIA_{GET,SET} with CPU_PC_{GET,SET}
authorMike Frysinger <vapier@gentoo.org>
Thu, 16 Apr 2015 06:11:12 +0000 (02:11 -0400)
committerMike Frysinger <vapier@gentoo.org>
Fri, 17 Apr 2015 06:44:30 +0000 (02:44 -0400)
The CIA_{GET,SET} macros serve the same function as CPU_PC_{GET,SET}
except the latter adds a layer of indirection via the sim state.  This
lets models set up different functions at runtime and doesn't reach so
directly into the arch-specific cpu state.

It also doesn't make sense to have two sets of macros that do exactly
the same thing, so lets standardize on the one that gets us more.

64 files changed:
sim/arm/ChangeLog
sim/arm/sim-main.h
sim/avr/ChangeLog
sim/avr/sim-main.h
sim/bfin/ChangeLog
sim/bfin/sim-main.h
sim/common/ChangeLog
sim/common/cgen-utils.c
sim/common/sim-core.c
sim/common/sim-engine.h
sim/common/sim-run.c
sim/cr16/ChangeLog
sim/cr16/sim-main.h
sim/cris/ChangeLog
sim/cris/crisv10f.c
sim/cris/crisv32f.c
sim/cris/sim-main.h
sim/d10v/ChangeLog
sim/d10v/sim-main.h
sim/frv/ChangeLog
sim/frv/sim-main.h
sim/frv/traps.c
sim/ft32/ChangeLog
sim/ft32/interp.c
sim/ft32/sim-main.h
sim/h8300/ChangeLog
sim/h8300/sim-main.h
sim/igen/ChangeLog
sim/igen/gen-engine.c
sim/iq2000/ChangeLog
sim/iq2000/sim-main.h
sim/lm32/ChangeLog
sim/lm32/dv-lm32cpu.c
sim/lm32/sim-main.h
sim/lm32/traps.c
sim/m32r/ChangeLog
sim/m32r/sim-main.h
sim/m68hc11/ChangeLog
sim/m68hc11/sim-main.h
sim/mcore/ChangeLog
sim/mcore/interp.c
sim/mcore/sim-main.h
sim/microblaze/ChangeLog
sim/microblaze/sim-main.h
sim/mips/ChangeLog
sim/mips/dv-tx3904cpu.c
sim/mips/interp.c
sim/mips/m16run.c
sim/mips/sim-main.h
sim/mn10300/ChangeLog
sim/mn10300/dv-mn103cpu.c
sim/mn10300/interp.c
sim/mn10300/sim-main.h
sim/moxie/ChangeLog
sim/moxie/interp.c
sim/moxie/sim-main.h
sim/msp430/ChangeLog
sim/msp430/sim-main.h
sim/sh/ChangeLog
sim/sh/sim-main.h
sim/sh64/ChangeLog
sim/sh64/sim-main.h
sim/v850/ChangeLog
sim/v850/sim-main.h

index 01105f868799e8df11a6db506750d7ff974f1d79..fbb78ecb256fae3594f649048151ad123d55f1f4 100644 (file)
@@ -1,3 +1,7 @@
+2015-04-17  Mike Frysinger  <vapier@gentoo.org>
+
+       * sim-main.h (CIA_GET, CIA_SET): Delete.
+
 2015-04-17  Mike Frysinger  <vapier@gentoo.org>
 
        * wrapper.c (arm_pc_get, arm_pc_set): New functions.
index 8b64287a22b7df0d3d94d670219f538255d6eb6f..087ddd51e5ebfa816fd189490c6469738eb4cd13 100644 (file)
@@ -33,9 +33,6 @@ typedef struct _sim_cpu SIM_CPU;
 
 extern struct ARMul_State *state;
 
-#define CIA_GET(cpu)     PC
-#define CIA_SET(cpu,val) ARMul_SetPC (state, (val))
-
 struct _sim_cpu {
 
   sim_cpu_base base;
index 2d8ddf21b26d1c09c8e9fd24ae172bb034e1796a..81bab3b7abee36804e78efc046ffe33ce67fbbfa 100644 (file)
@@ -1,3 +1,7 @@
+2015-04-17  Mike Frysinger  <vapier@gentoo.org>
+
+       * sim-main.h (CIA_GET, CIA_SET): Delete.
+
 2015-04-16  Mike Frysinger  <vapier@gentoo.org>
 
        * interp.c (avr_pc_get, avr_pc_set): New functions.
index fc30e1173767e4ef82eac661ba0bb6c92f412fcd..6b49b8d43ea4c35bab745e96771aa7fe76416b7e 100644 (file)
@@ -24,9 +24,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 typedef address_word sim_cia;
 extern unsigned int pc;
 
-#define CIA_GET(cpu)     pc
-#define CIA_SET(cpu,val) (pc) = (val)
-
 typedef struct _sim_cpu SIM_CPU;
 
 #include "sim-base.h"
index db379c333dd75afcef4a9a6eb2b7a92f58d83607..c27ef32d1b80e2f3fdda2d68645accd49b75a226 100644 (file)
@@ -1,3 +1,7 @@
+2015-04-17  Mike Frysinger  <vapier@gentoo.org>
+
+       * sim-main.h (CIA_GET, CIA_SET): Delete.
+
 2015-04-15  Mike Frysinger  <vapier@gentoo.org>
 
        * Makefile.in (SIM_OBJS): Delete sim-cpu.o.
index f8c2ba2a3dca127728bd5dd6e12ab61591721f3c..614d1b6e5a58a91143a4aa7695e95a68c8bfab81 100644 (file)
@@ -26,9 +26,6 @@
 
 typedef unsigned32 sim_cia;
 
-#define CIA_GET(cpu)     CPU_PC_GET (cpu)
-#define CIA_SET(cpu,val) CPU_PC_SET ((cpu), (val))
-
 typedef struct _sim_cpu SIM_CPU;
 
 #include "bfin-sim.h"
index 316771d33115284a66a70f0cf0ad6a63d6834603..d5c965cf16f40111177072834e0d4b3ea35b5e5e 100644 (file)
@@ -1,3 +1,11 @@
+2015-04-17  Mike Frysinger  <vapier@gentoo.org>
+
+       * cgen-utils.c (cgen_rtx_error): Change CIA_GET to CPU_PC_GET.
+       * sim-core.c (sim_core_read_buffer, sim_core_write_buffer): Likewise.
+       * sim-engine.h (SIM_ENGINE_HALT_HOOK): Change CIA_SET to CPU_PC_SET.
+       * sim-run.c (sim_engine_run): Change CIA_GET to CPU_PC_GET and
+       CIA_SET to CPU_PC_SET.
+
 2015-04-15  Mike Frysinger  <vapier@gentoo.org>
 
        * Makefile.in (SIM_NEW_COMMON_OBJS): Add sim-cpu.o.
index e1138aff4d35d44c6f91076c7d232296f9a83505..717867728943c73eb380ec206b5a6bc89baac641 100644 (file)
@@ -434,5 +434,5 @@ cgen_rtx_error (SIM_CPU *cpu, const char * msg)
   sim_io_printf (sd, msg);
   sim_io_printf (sd, "\n");
 
-  sim_engine_halt (sd, cpu, NULL, CIA_GET (cpu), sim_stopped, SIM_SIGTRAP);
+  sim_engine_halt (sd, cpu, NULL, CPU_PC_GET (cpu), sim_stopped, SIM_SIGTRAP);
 }
index ccd2c02698a0119bab5b53aa8b851c8e68e3e632..43e9076950f04f5c505ebabcbb71706d77a7f56d 100644 (file)
@@ -531,7 +531,7 @@ sim_core_read_buffer (SIM_DESC sd,
     if (mapping->device != NULL)
       {
        int nr_bytes = len - count;
-       sim_cia cia = cpu ? CIA_GET (cpu) : NULL_CIA;
+       sim_cia cia = cpu ? CPU_PC_GET (cpu) : NULL_CIA;
        if (raddr + nr_bytes - 1> mapping->bound)
          nr_bytes = mapping->bound - raddr + 1;
        if (device_io_read_buffer (mapping->device,
@@ -598,7 +598,7 @@ sim_core_write_buffer (SIM_DESC sd,
          && mapping->device != NULL)
        {
          int nr_bytes = len - count;
-         sim_cia cia = cpu ? CIA_GET (cpu) : NULL_CIA;
+         sim_cia cia = cpu ? CPU_PC_GET (cpu) : NULL_CIA;
          if (raddr + nr_bytes - 1 > mapping->bound)
            nr_bytes = mapping->bound - raddr + 1;
          if (device_io_write_buffer (mapping->device,
index 3fd0a205e041e91c331b43bfaab913dec64d7303..73be1756215246c461694161b169281448577208 100644 (file)
@@ -69,7 +69,7 @@ extern void sim_engine_halt
 
 #if !defined (SIM_ENGINE_HALT_HOOK)
 #define SIM_ENGINE_HALT_HOOK(SD, LAST_CPU, CIA) \
-if ((LAST_CPU) != NULL) CIA_SET (LAST_CPU, CIA)
+if ((LAST_CPU) != NULL) CPU_PC_SET (LAST_CPU, CIA)
 #endif
 
 /* NB: If a port uses the SIM_CPU_EXCEPTION_* hooks, the default
index 6ab18b18b950902202a95dd44feb66c8bad9ceb3..0bf2e4ed88e4c72377496eb57030b95835f46dec 100644 (file)
@@ -35,7 +35,7 @@ sim_engine_run (SIM_DESC sd,
   sim_cpu *cpu;
   SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
   cpu = STATE_CPU (sd, 0);
-  cia = CIA_GET (cpu);
+  cia = CPU_PC_GET (cpu);
   while (1)
     {
       instruction_word insn = IMEM32 (cia);
@@ -43,7 +43,7 @@ sim_engine_run (SIM_DESC sd,
       /* process any events */
       if (sim_events_tick (sd))
        {
-         CIA_SET (cpu, cia);
+         CPU_PC_SET (cpu, cia);
          sim_events_process (sd);
        }
     }
index 1a6cd1457b2b5adb85aa496082d43db26d0263d0..260164f77061b06660522906eb72acacad035a77 100644 (file)
@@ -1,3 +1,7 @@
+2015-04-17  Mike Frysinger  <vapier@gentoo.org>
+
+       * sim-main.h (CIA_GET, CIA_SET): Delete.
+
 2015-04-17  Mike Frysinger  <vapier@gentoo.org>
 
        * interp.c (cr16_pc_get, cr16_pc_set): New functions.
index ec94a82920eafa92bac6151064896fd736856b21..96254f194135360b86572077b5a78f4cee389609 100644 (file)
@@ -32,9 +32,6 @@ typedef struct _sim_cpu SIM_CPU;
 
 #include "cr16_sim.h"
 
-#define CIA_GET(cpu)     PC
-#define CIA_SET(cpu,val) SET_PC (val)
-
 struct _sim_cpu {
 
   sim_cpu_base base;
index 89275296b3be71be97c48ab908cc570d7f77454d..b8b163129970adabbc1067e7ea3014f825753082 100644 (file)
@@ -1,3 +1,9 @@
+2015-04-17  Mike Frysinger  <vapier@gentoo.org>
+
+       * crisv10f.c (deliver_interrupt): Change CIA_GET to CPU_PC_GET.
+       * crisv32f.c (deliver_interrupt): Likewise.
+       * sim-main.h (CIA_GET, CIA_SET): Delete.
+
 2015-04-15  Mike Frysinger  <vapier@gentoo.org>
 
        * Makefile.in (SIM_OBJS): Delete sim-cpu.o.
index 562b4c902e84e5be16ba9f1173c8c0fea03457b4..906a32f5dba5765f416a9862c3f2467af6c7c233 100644 (file)
@@ -86,7 +86,7 @@ MY (deliver_interrupt) (SIM_CPU *current_cpu,
                            GET_H_SR (H_SR_PRE_V32_IBR) + vec * 4, 4) == 0)
     {
       /* Nothing to do actually; either abort or send a signal.  */
-      sim_core_signal (sd, current_cpu, CIA_GET (current_cpu), 0, 4,
+      sim_core_signal (sd, current_cpu, CPU_PC_GET (current_cpu), 0, 4,
                       GET_H_SR (H_SR_PRE_V32_IBR) + vec * 4,
                       read_transfer, sim_core_unmapped_signal);
       return 0;
index 3a0135d034dd10e04d73949bccbbffe68da5ae41..dabd8b382b4c63f677641be011b3d9d7245916cd 100644 (file)
@@ -615,7 +615,7 @@ MY (deliver_interrupt) (SIM_CPU *current_cpu,
                            GET_H_SR (H_SR_EBP) + vec * 4, 4) == 0)
     {
       /* Nothing to do actually; either abort or send a signal.  */
-      sim_core_signal (sd, current_cpu, CIA_GET (current_cpu), 0, 4,
+      sim_core_signal (sd, current_cpu, CPU_PC_GET (current_cpu), 0, 4,
                       GET_H_SR (H_SR_EBP) + vec * 4,
                       read_transfer, sim_core_unmapped_signal);
       return 0;
index df6c5cf81e8066212f8f8add02b13e45c923aae1..5985308fa8dac1de04ad0566bb7ac8a1f1d43c8f 100644 (file)
@@ -39,9 +39,6 @@ typedef struct _sim_cpu SIM_CPU;
 /* These must be defined before sim-base.h.  */
 typedef USI sim_cia;
 
-#define CIA_GET(cpu)     CPU_PC_GET (cpu)
-#define CIA_SET(cpu,val) CPU_PC_SET ((cpu), (val))
-
 #define SIM_ENGINE_HALT_HOOK(sd, cpu, cia) \
 do { \
   if (cpu) /* Null if ctrl-c.  */ \
index 0cf06d7b6d0066e51bd56145850fae224fe6835b..bac73a263efa484d321627a0769cdc06f7f169c5 100644 (file)
@@ -1,3 +1,7 @@
+2015-04-17  Mike Frysinger  <vapier@gentoo.org>
+
+       * sim-main.h (CIA_GET, CIA_SET): Delete.
+
 2015-04-17  Mike Frysinger  <vapier@gentoo.org>
 
        * interp.c (d10v_pc_get, d10v_pc_set): New functions.
index c83c78c8ed37a70827a95c8dfdc856d82421c36e..7eb0b90c4214c0d9eb340cc276b16aca116cf1d7 100644 (file)
@@ -32,9 +32,6 @@ typedef struct _sim_cpu SIM_CPU;
 
 #include "d10v_sim.h"
 
-#define CIA_GET(cpu)     PC
-#define CIA_SET(cpu,val) SET_PC (val)
-
 struct _sim_cpu {
 
   sim_cpu_base base;
index 05ae18a160f8e22cfc83828aa7f59f8fad3b7ea6..1724c35ebe07f067890ae8b29a551086c28813d3 100644 (file)
@@ -1,3 +1,8 @@
+2015-04-17  Mike Frysinger  <vapier@gentoo.org>
+
+       * sim-main.h (CIA_GET, CIA_SET): Delete.
+       * traps.c (frv_sim_engine_halt_hook): Change CIA_SET to CPU_PC_SET.
+
 2015-04-15  Mike Frysinger  <vapier@gentoo.org>
 
        * Makefile.in (SIM_OBJS): Delete sim-cpu.o.
index 1fd60b58cfe0c93af2e52171979efc5c52d417d0..275ac28f1b265a741e0b4a3d9175f1e3ffc2ba02 100644 (file)
@@ -43,9 +43,6 @@ typedef struct _sim_cpu SIM_CPU;
 /* These must be defined before sim-base.h.  */
 typedef USI sim_cia;
 
-#define CIA_GET(cpu)     CPU_PC_GET (cpu)
-#define CIA_SET(cpu,val) CPU_PC_SET ((cpu), (val))
-
 void frv_sim_engine_halt_hook (SIM_DESC, SIM_CPU *, sim_cia);
 #define SIM_ENGINE_HALT_HOOK(SD, LAST_CPU, CIA) \
   frv_sim_engine_halt_hook ((SD), (LAST_CPU), (CIA))
index 1f116b27412bfcbff512b29286a31f07fddf66b2..12636835a42911368564fb0dee4b9cec3fbffda6 100644 (file)
@@ -65,7 +65,7 @@ frv_sim_engine_halt_hook (SIM_DESC sd, SIM_CPU *current_cpu, sim_cia cia)
 {
   int i;
   if (current_cpu != NULL)
-    CIA_SET (current_cpu, cia);
+    CPU_PC_SET (current_cpu, cia);
 
   /* Invalidate the insn and data caches of all cpus.  */
   for (i = 0; i < MAX_NR_PROCESSORS; ++i)
index 07fb6a6860a553c4cbd5397498fd08d0118f62aa..a3911083832e5d5caee7b30e43c95457353db7c7 100644 (file)
@@ -1,3 +1,10 @@
+2015-04-17  Mike Frysinger  <vapier@gentoo.org>
+
+       * interp.c (ft32_read_item): Change CIA_GET to CPU_PC_GET.
+       (ft32_write_item): Likewise.
+       (step_once): Likewise.
+       * sim-main.h (CIA_GET, CIA_SET): Delete.
+
 2015-04-15  Mike Frysinger  <vapier@gentoo.org>
 
        * Makefile.in (SIM_OBJS): Delete sim-cpu.o.
index 8306a757e7b331fcdfadc05fae459e3b9583c64c..404683da77889bddb87b2e8c42bf9dfc2e14a616 100644 (file)
@@ -110,7 +110,7 @@ static uint32_t
 ft32_read_item (SIM_DESC sd, int dw, uint32_t ea)
 {
   sim_cpu *cpu = STATE_CPU (sd, 0);
-  address_word cia = CIA_GET (cpu);
+  address_word cia = CPU_PC_GET (cpu);
   uint8_t byte[4];
   uint32_t r;
 
@@ -133,7 +133,7 @@ static void
 ft32_write_item (SIM_DESC sd, int dw, uint32_t ea, uint32_t v)
 {
   sim_cpu *cpu = STATE_CPU (sd, 0);
-  address_word cia = CIA_GET (cpu);
+  address_word cia = CPU_PC_GET (cpu);
   uint8_t byte[4];
 
   ea = ft32_align (dw, ea);
@@ -311,7 +311,7 @@ static void
 step_once (SIM_DESC sd)
 {
   sim_cpu *cpu = STATE_CPU (sd, 0);
-  address_word cia = CIA_GET (cpu);
+  address_word cia = CPU_PC_GET (cpu);
   uint32_t inst;
   uint32_t dw;
   uint32_t cb;
index 1aa4248dc30e673658e886428b78a82fa178a03d..a4f5f6dcef03629e700acde9ca42f12d9809f479 100644 (file)
@@ -35,8 +35,6 @@ typedef struct _sim_cpu SIM_CPU;
 struct _sim_cpu {
 
   /* The following are internal simulator state variables: */
-#define CIA_GET(CPU) ((CPU)->state.pc + 0)
-#define CIA_SET(CPU,CIA) ((CPU)->state.pc = (CIA))
 
   struct ft32_cpu_state state;
 
index f414847a8b819e357280714d3b8c7993bc07423e..1cc28f5c7a7203ef6a705789f1ea2df3c744cc8e 100644 (file)
@@ -1,3 +1,7 @@
+2015-04-17  Mike Frysinger  <vapier@gentoo.org>
+
+       * sim-main.h (CIA_GET, CIA_SET): Delete.
+
 2015-04-17  Mike Frysinger  <vapier@gentoo.org>
 
        * compile.c (h8300_pc_get, h8300_pc_set): New functions.
index e428d804532fbb778011a9894b95fc217444b375..450f8ca72829f5fe42b00f877e9aff1b4eac9dd2 100644 (file)
@@ -155,8 +155,6 @@ struct sim_state {
 
 /* The current state of the processor; registers, memory, etc.  */
 
-#define CIA_GET(CPU)           (cpu_get_pc (CPU))
-#define CIA_SET(CPU, VAL)      (cpu_set_pc ((CPU), (VAL)))
 #define cpu_set_pc(CPU, VAL)   (((CPU)->pc)  = (VAL))
 #define cpu_get_pc(CPU)                (((CPU)->pc))
 
index 0553434ed079e1aaa74ed937630fab56f6cbd4f5..92d7db9b3449d8769915f1b11a68a319353a9bdd 100644 (file)
@@ -1,3 +1,8 @@
+2015-04-17  Mike Frysinger  <vapier@gentoo.org>
+
+       * gen-engine.c (print_run_body): Change CIA_GET to CPU_PC_GET and
+       CIA_SET to CPU_PC_SET.
+
 2015-03-31  Mike Frysinger  <vapier@gentoo.org>
 
        * configure: Regenerate.
index 232e50d421373db28aecd44fe51b8c1148c5704d..c081049a0dc69376753188c8d279345ce77f5702 100644 (file)
@@ -116,7 +116,7 @@ cache. */\n\
       lf_putstr (file, "/* prime the main loop */\n");
       lf_putstr (file, "SIM_ASSERT (current_cpu == 0);\n");
       lf_putstr (file, "SIM_ASSERT (nr_cpus == 1);\n");
-      lf_putstr (file, "cia = CIA_GET (CPU);\n");
+      lf_putstr (file, "cia = CPU_PC_GET (CPU);\n");
 
       lf_putstr (file, "\n");
       lf_putstr (file, "while (1)\n");
@@ -202,9 +202,9 @@ cache. */\n\
       lf_putstr (file, "/* process any events */\n");
       lf_putstr (file, "if (sim_events_tick (sd))\n");
       lf_putstr (file, "  {\n");
-      lf_putstr (file, "    CIA_SET (CPU, cia);\n");
+      lf_putstr (file, "    CPU_PC_SET (CPU, cia);\n");
       lf_putstr (file, "    sim_events_process (sd);\n");
-      lf_putstr (file, "    cia = CIA_GET (CPU);\n");
+      lf_putstr (file, "    cia = CPU_PC_GET (CPU);\n");
       lf_putstr (file, "  }\n");
 
       lf_indent (file, -4);
@@ -236,7 +236,7 @@ after all the other CPU's and the event queue have been processed */\n\
       lf_putstr (file, "  {\n");
       lf_indent (file, +4);
       lf_putstr (file, "sim_cpu *cpu = STATE_CPU (sd, current_cpu);\n");
-      lf_putstr (file, "instruction_address cia = CIA_GET (cpu);\n");
+      lf_putstr (file, "instruction_address cia = CPU_PC_GET (cpu);\n");
       lf_putstr (file, "\n");
 
       if (!options.gen.icache)
@@ -245,7 +245,7 @@ after all the other CPU's and the event queue have been processed */\n\
                     options.insn_bit_size);
          print_engine_issue_prefix_hook (file);
          print_idecode_body (file, table, "cia =");
-         lf_putstr (file, "CIA_SET (cpu, cia);\n");
+         lf_putstr (file, "CPU_PC_SET (cpu, cia);\n");
          print_engine_issue_postfix_hook (file);
        }
 
index 4278ae6f63ee6bb139cd64f86c197026e1714a13..44e50028e0f84b903f4b2563392b8d5d83d60e30 100644 (file)
@@ -1,3 +1,7 @@
+2015-04-17  Mike Frysinger  <vapier@gentoo.org>
+
+       * sim-main.h (CIA_GET, CIA_SET): Delete.
+
 2015-04-15  Mike Frysinger  <vapier@gentoo.org>
 
        * Makefile.in (SIM_OBJS): Delete sim-cpu.o.
index 1498eb4b1f14ea749a0a1af8fdb8e4cab23f8efb..29d4b6292ec7e2552b624d1eff7f8c774e363d40 100644 (file)
@@ -26,9 +26,6 @@ typedef struct _sim_cpu SIM_CPU;
 /* These must be defined before sim-base.h.  */
 typedef USI sim_cia;
 
-#define CIA_GET(cpu)     CPU_PC_GET (cpu)
-#define CIA_SET(cpu,val) CPU_PC_SET ((cpu), (val))
-
 #include "sim-base.h"
 #include "cgen-sim.h"
 #include "iq2000-sim.h"
index 6464b772b2c3b7f31ec1bc12c4a21dae77c898a7..e536d314094dd0fc05a0054d10f7d1bdc4a2a56e 100644 (file)
@@ -1,3 +1,11 @@
+2015-04-17  Mike Frysinger  <vapier@gentoo.org>
+
+       * dv-lm32cpu.c (deliver_lm32cpu_interrupt): Change CIA_GET to
+       CPU_PC_GET.
+       (lm32cpu_port_event): Likewise.
+       * sim-main.h (CIA_GET, CIA_SET): Delete.
+       * traps.c (lm32_core_signal): Change CIA_SET to CPU_PC_SET.
+
 2015-04-15  Mike Frysinger  <vapier@gentoo.org>
 
        * Makefile.in (SIM_OBJS): Delete sim-cpu.o.
index 7087f0b133f1b4feb9eb15614950d4371e1f7551..bdd64f3699974242edc4fd9a499d5a2e56633112 100644 (file)
@@ -137,7 +137,7 @@ deliver_lm32cpu_interrupt (struct hw *me, void *data)
   struct lm32cpu *controller = hw_data (me);
   SIM_DESC sd = hw_system (me);
   sim_cpu *cpu = STATE_CPU (sd, 0);    /* NB: fix CPU 0.  */
-  address_word cia = CIA_GET (cpu);
+  address_word cia = CPU_PC_GET (cpu);
   int interrupt = (int) data;
 
 
@@ -192,7 +192,7 @@ lm32cpu_port_event (struct hw *me,
   struct lm32cpu *controller = hw_data (me);
   SIM_DESC sd = hw_system (me);
   sim_cpu *cpu = STATE_CPU (sd, 0);    /* NB: fix CPU 0.  */
-  address_word cia = CIA_GET (cpu);
+  address_word cia = CPU_PC_GET (cpu);
 
 
   HW_TRACE ((me, "interrupt event on port %d, level %d", my_port, level));
index dcb5ac099d0c65e5caad72c63dfe00e13f382faa..52122d2f4341ff41f193d1d9947457a69b0f2237 100644 (file)
@@ -38,9 +38,6 @@ typedef struct _sim_cpu SIM_CPU;
 /* These must be defined before sim-base.h.  */
 typedef USI sim_cia;
 
-#define CIA_GET(cpu)     CPU_PC_GET (cpu)
-#define CIA_SET(cpu,val) CPU_PC_SET ((cpu), (val))
-
 #define SIM_ENGINE_HALT_HOOK(sd, cpu, cia) \
 do { \
   if (cpu) /* null if ctrl-c */ \
index 30703235521af36c4d55e5f4132489ff3fae48e8..777e7b582f5a0af5248100b60ba4d4103bd7ed62 100644 (file)
@@ -245,7 +245,7 @@ lm32_core_signal (SIM_DESC sd,
       SET_H_GR (30, ip);
       /* Save and clear interrupt enable.  */
       SET_H_CSR (LM32_CSR_IE, (GET_H_CSR (LM32_CSR_IE) & 1) << 1);
-      CIA_SET (cpu, GET_H_CSR (LM32_CSR_EBA) + LM32_EID_DATA_BUS_ERROR * 32);
+      CPU_PC_SET (cpu, GET_H_CSR (LM32_CSR_EBA) + LM32_EID_DATA_BUS_ERROR * 32);
       sim_engine_halt (sd, cpu, NULL, LM32_EID_DATA_BUS_ERROR * 32,
                       sim_stopped, SIM_SIGSEGV);
       break;
@@ -257,7 +257,7 @@ lm32_core_signal (SIM_DESC sd,
       SET_H_GR (30, ip);
       /* Save and clear interrupt enable.  */
       SET_H_CSR (LM32_CSR_IE, (GET_H_CSR (LM32_CSR_IE) & 1) << 1);
-      CIA_SET (cpu, GET_H_CSR (LM32_CSR_EBA) + LM32_EID_DATA_BUS_ERROR * 32);
+      CPU_PC_SET (cpu, GET_H_CSR (LM32_CSR_EBA) + LM32_EID_DATA_BUS_ERROR * 32);
       sim_engine_halt (sd, cpu, NULL, LM32_EID_DATA_BUS_ERROR * 32,
                       sim_stopped, SIM_SIGBUS);
       break;
index ab156178c9829d340811d25121791c071e5d13c7..d47cdfb0addf3b3abf8565e9bd0a298dc64d552f 100644 (file)
@@ -1,3 +1,7 @@
+2015-04-17  Mike Frysinger  <vapier@gentoo.org>
+
+       * sim-main.h (CIA_GET, CIA_SET): Delete.
+
 2015-04-15  Mike Frysinger  <vapier@gentoo.org>
 
        * Makefile.in (SIM_OBJS): Delete sim-cpu.o.
index 9f859e2b6ca20cd9ce73c89a29be140b73ac187b..661d9cf9e3abf112b962e1199b1427da98ed340d 100644 (file)
@@ -18,9 +18,6 @@ typedef struct _sim_cpu SIM_CPU;
 /* These must be defined before sim-base.h.  */
 typedef USI sim_cia;
 
-#define CIA_GET(cpu)     CPU_PC_GET (cpu)
-#define CIA_SET(cpu,val) CPU_PC_SET ((cpu), (val))
-
 #define SIM_ENGINE_HALT_HOOK(sd, cpu, cia) \
 do { \
   if (cpu) /* null if ctrl-c */ \
index 64cb223dd811296d993bd73e910dc8a4ff243796..714c000a02c4493de18f730174ad1bec8d732025 100644 (file)
@@ -1,3 +1,7 @@
+2015-04-17  Mike Frysinger  <vapier@gentoo.org>
+
+       * sim-main.h (CIA_GET, CIA_SET): Delete.
+
 2015-04-15  Mike Frysinger  <vapier@gentoo.org>
 
        * Makefile.in (SIM_OBJS): Delete sim-cpu.o.
index 9c0a1ed00fc2e16005376f535498d8e38b894860..ac57f989bd730d08d85b6e9727e93a4946e51e2b 100644 (file)
@@ -574,9 +574,6 @@ extern void m68hc11cpu_set_port (struct hw *me, sim_cpu *cpu,
 
 /* The current state of the processor; registers, memory, etc.  */
 
-#define CIA_GET(CPU)      (cpu_get_pc (CPU))
-#define CIA_SET(CPU,VAL)  (cpu_set_pc ((CPU), (VAL)))
-
 struct sim_state {
   sim_cpu        *cpu[MAX_NR_PROCESSORS];
   device         *devices;
index a00954ceb94c76b7f57f4b282c7b23887e7f6d68..89f17d8a37e8dcccb28bdd3581ff55404dc85bd4 100644 (file)
@@ -1,3 +1,11 @@
+2015-04-17  Mike Frysinger  <vapier@gentoo.org>
+
+       * interp.c (set_initial_gprs): Change CIA_SET to CPU_PC_SET.
+       (sim_resume): Change CIA_GET to CPU_PC_GET and CIA_SET to
+       CPU_PC_SET.
+       (sim_create_inferior): Change CIA_SET to CPU_PC_SET.
+       * sim-main.h (CIA_GET, CIA_SET): Delete.
+
 2015-04-16  Mike Frysinger  <vapier@gentoo.org>
 
        * interp.c (mcore_pc_get, mcore_pc_set): New functions.
index fc1131bdda85c6e3ef960baebbf2eb26c3cb2c5b..54d628c27dab5803e7aaad9fe25176b5c55fbd55 100644 (file)
@@ -397,7 +397,7 @@ set_initial_gprs (SIM_CPU *scpu)
   init_pointers ();
 
   /* Set up machine just out of reset.  */
-  CIA_SET (scpu, 0);
+  CPU_PC_SET (scpu, 0);
   cpu.sr = 0;
 
   memsize = cpu.asregs.msize / (1024 * 1024);
@@ -716,7 +716,7 @@ sim_resume (SIM_DESC sd, int step, int siggnal)
   word WLhash;
 
   cpu.asregs.exception = step ? SIGTRAP: 0;
-  pc = CIA_GET (scpu);
+  pc = CPU_PC_GET (scpu);
 
   /* Fetch the initial instructions that we'll decode. */
   ibuf = rlat (pc & 0xFFFFFFFC);
@@ -1648,7 +1648,7 @@ sim_resume (SIM_DESC sd, int step, int siggnal)
   while (!cpu.asregs.exception);
 
   /* Hide away the things we've cached while executing.  */
-  CIA_SET (scpu, pc);
+  CPU_PC_SET (scpu, pc);
   cpu.asregs.insts += insts;           /* instructions done ... */
   cpu.asregs.cycles += insts;          /* and each takes a cycle */
   cpu.asregs.cycles += bonus_cycles;   /* and extra cycles for branches */
@@ -1905,7 +1905,7 @@ sim_create_inferior (SIM_DESC sd, struct bfd *prog_bfd, char **argv, char **env)
   issue_messages = l;
 
   hi_stack = cpu.asregs.msize - 4;
-  CIA_SET (scpu, bfd_get_start_address (prog_bfd));
+  CPU_PC_SET (scpu, bfd_get_start_address (prog_bfd));
 
   /* Calculate the argument and environment strings.  */
   s_length = 0;
index 80b467a11722e446bf2a9366fcc80a0edb3faa27..f7000593fe9dda8f0ebf17702340400d03c5e7cc 100644 (file)
@@ -30,9 +30,6 @@ typedef struct _sim_cpu SIM_CPU;
 #include "sim-base.h"
 #include "bfd.h"
 
-#define CIA_GET(cpu)     (cpu)->pc
-#define CIA_SET(cpu,val) (cpu)->pc = (val)
-
 struct _sim_cpu {
 
   word pc;
index 42233017c7692f4f4df1c8adcce2140ca31b9431..8ac3a262a6eba97735264b151a365955fc3f0679 100644 (file)
@@ -1,3 +1,7 @@
+2015-04-17  Mike Frysinger  <vapier@gentoo.org>
+
+       * sim-main.h (CIA_GET, CIA_SET): Delete.
+
 2015-04-17  Mike Frysinger  <vapier@gentoo.org>
 
        * interp.c (microblaze_pc_get, microblaze_pc_set): New functions.
index 68f8223857aea9037cdc5e3bf14c63b21aa05577..1b34f3a017601e46779a1d95e67eb5853adbfdc0 100644 (file)
@@ -23,9 +23,6 @@
 
 typedef address_word sim_cia;
 
-#define CIA_GET(cpu) (cpu)->microblaze_cpu.spregs[0]
-#define CIA_SET(cpu,val) (cpu)->microblaze_cpu.spregs[0] = (val)
-
 typedef struct _sim_cpu SIM_CPU;
 
 #include "sim-base.h"
index 249e8c57386514965af7f6afc021c5da3c22fd4f..00f7871e05ff05e95b4ba9320a2d00a74dbd3979 100644 (file)
@@ -1,3 +1,13 @@
+2015-04-17  Mike Frysinger  <vapier@gentoo.org>
+
+       * dv-tx3904cpu.c (deliver_tx3904cpu_interrupt): Change CIA_GET to
+       PU_PC_GET.
+       * interp.c (interrupt_event): Change CIA_GET to CPU_PC_GET.
+       (sim_create_inferior): Change CIA_SET to CPU_PC_SET.
+       * m16run.c (sim_engine_run): Change CIA_GET to CPU_PC_GET and
+       CIA_SET to CPU_PC_SET.
+       * sim-main.h (CIA_GET, CIA_SET): Delete.
+
 2015-04-15  Mike Frysinger  <vapier@gentoo.org>
 
        * Makefile.in (SIM_OBJS): Delete sim-cpu.o.
index 56b33862a43f1d29fadc01d8a25f2617f6e28458..cf9399a1d77579ac29022ca032349df3e871644b 100644 (file)
@@ -141,7 +141,7 @@ deliver_tx3904cpu_interrupt (struct hw *me,
   struct tx3904cpu *controller = hw_data (me);
   SIM_DESC sd = hw_system (me);
   sim_cpu *cpu = STATE_CPU (sd, 0); /* NB: fix CPU 0. */
-  address_word cia = CIA_GET (cpu);
+  address_word cia = CPU_PC_GET (cpu);
 
 #define CPU cpu
 #define SD current_state
@@ -149,20 +149,20 @@ deliver_tx3904cpu_interrupt (struct hw *me,
   if (controller->pending_reset)
     {
       controller->pending_reset = 0;
-      HW_TRACE ((me, "reset pc=0x%08lx", (long) CIA_GET (cpu)));
+      HW_TRACE ((me, "reset pc=0x%08lx", (long) CPU_PC_GET (cpu)));
       SignalExceptionNMIReset();
     }
   else if (controller->pending_nmi)
     {
       controller->pending_nmi = 0;
-      HW_TRACE ((me, "nmi pc=0x%08lx", (long) CIA_GET (cpu)));
+      HW_TRACE ((me, "nmi pc=0x%08lx", (long) CPU_PC_GET (cpu)));
       SignalExceptionNMIReset();
     }
   else if (controller->pending_level)
     {
       HW_TRACE ((me, "interrupt level=%d pc=0x%08lx sr=0x%08lx",
                 controller->pending_level,
-                (long) CIA_GET (cpu), (long) SR));
+                (long) CPU_PC_GET (cpu), (long) SR));
 
       /* Clear CAUSE register.  It may stay this way if the interrupt
         was cleared with a negative pending_level. */
index d6136ab2ca01d74f4fdf23a90eed7153783a3689..38f25247c711711274e864eacc03e1d5c2b1550b 100644 (file)
@@ -311,7 +311,7 @@ void
 interrupt_event (SIM_DESC sd, void *data)
 {
   sim_cpu *cpu = STATE_CPU (sd, 0); /* FIXME */
-  address_word cia = CIA_GET (cpu);
+  address_word cia = CPU_PC_GET (cpu);
   if (SR & status_IE)
     {
       interrupt_pending = 0;
@@ -1112,7 +1112,7 @@ sim_create_inferior (SIM_DESC sd, struct bfd *abfd, char **argv, char **env)
       for (cpu_nr = 0; cpu_nr < sim_engine_nr_cpus (sd); cpu_nr++)
        {
          sim_cpu *cpu = STATE_CPU (sd, cpu_nr);
-         CIA_SET (cpu, (unsigned64) bfd_get_start_address (abfd));
+         CPU_PC_SET (cpu, (unsigned64) bfd_get_start_address (abfd));
        }
     }
 
index 0f5fec11ac6c4020f431796ed8a6ca8336207494..44fb9e4538cacaf72f1697ce6ec955ee277c2dad 100644 (file)
@@ -33,7 +33,7 @@ sim_engine_run (SIM_DESC sd,
                int siggnal) /* ignore */
 {
   sim_cpu *cpu = STATE_CPU (sd, next_cpu_nr);
-  address_word cia = CIA_GET (cpu);
+  address_word cia = CPU_PC_GET (cpu);
 
   while (1)
     {
@@ -64,9 +64,9 @@ sim_engine_run (SIM_DESC sd,
       /* process any events */
       if (sim_events_tick (sd))
         {
-          CIA_SET (CPU, cia);
+          CPU_PC_SET (CPU, cia);
           sim_events_process (sd);
-         cia = CIA_GET (CPU);
+         cia = CPU_PC_GET (CPU);
         }
 
     }
index a04450402049e41af67f81ddd38b342eb584fe8d..7a58bd30f506b6f5c2832159a195f14c75ef681d 100644 (file)
@@ -257,8 +257,6 @@ struct _sim_cpu {
 
 
   /* The following are internal simulator state variables: */
-#define CIA_GET(CPU) ((CPU)->registers[PCIDX] + 0)
-#define CIA_SET(CPU,CIA) ((CPU)->registers[PCIDX] = (CIA))
   address_word dspc;  /* delay-slot PC */
 #define DSPC ((CPU)->dspc)
 
index eca9946adce8ed04ed42611743e053b553accd44..91aa17963dce60d5d11fde1be863fe2655f2f0c8 100644 (file)
@@ -1,3 +1,15 @@
+2015-04-17  Mike Frysinger  <vapier@gentoo.org>
+
+       * dv-mn103cpu.c (deliver_mn103cpu_interrupt): Change CIA_GET to
+       CPU_PC_GET and CIA_SET to CPU_PC_SET.
+       * interp.c (sim_create_inferior): Change CIA_SET to CPU_PC_SET.
+       (program_interrupt): Change CIA_GET to CPU_PC_GET and CIA_SET to
+       CPU_PC_SET.
+       (mn10300_cpu_exception_trigger): Change CIA_SET to CPU_PC_SET.
+       (mn10300_cpu_exception_suspend): Likewise.
+       (mn10300_cpu_exception_resume): Likewise.
+       * sim-main.h (CIA_GET, CIA_SET): Delete.
+
 2015-04-15  Mike Frysinger  <vapier@gentoo.org>
 
        * Makefile.in (MN10300_OBJS): Delete sim-cpu.o.
index e5540eeafebb1a52533b5505eb41c19f4ff7e73b..e9dd2f65191d8c77c57ec66ede8331b556a0a3af 100644 (file)
@@ -227,31 +227,31 @@ deliver_mn103cpu_interrupt (struct hw *me,
   else if (controller->pending_nmi)
     {
       controller->pending_nmi = 0;
-      store_word (SP - 4, CIA_GET (cpu));
+      store_word (SP - 4, CPU_PC_GET (cpu));
       store_half (SP - 8, PSW);
       PSW &= ~PSW_IE;
       SP = SP - 8;
-      CIA_SET (cpu, 0x40000008);
+      CPU_PC_SET (cpu, 0x40000008);
       HW_TRACE ((me, "nmi pc=0x%08lx psw=0x%04x sp=0x%08lx",
-                (long) CIA_GET (cpu), (unsigned) PSW, (long) SP));
+                (long) CPU_PC_GET (cpu), (unsigned) PSW, (long) SP));
     }
   else if ((controller->pending_level < EXTRACT_PSW_LM)
           && (PSW & PSW_IE))
     {
       /* Don't clear pending level.  Request continues to be pending
          until the interrupt controller clears/changes it */
-      store_word (SP - 4, CIA_GET (cpu));
+      store_word (SP - 4, CPU_PC_GET (cpu));
       store_half (SP - 8, PSW);
       PSW &= ~PSW_IE;
       PSW &= ~PSW_LM;
       PSW |= INSERT_PSW_LM (controller->pending_level);
       SP = SP - 8;
-      CIA_SET (cpu, 0x40000000 + controller->interrupt_vector[controller->pending_level]);
+      CPU_PC_SET (cpu, 0x40000000 + controller->interrupt_vector[controller->pending_level]);
       HW_TRACE ((me, "port-out ack %d", controller->pending_level));
       hw_port_event (me, ACK_PORT, controller->pending_level);
       HW_TRACE ((me, "int level=%d pc=0x%08lx psw=0x%04x sp=0x%08lx",
                 controller->pending_level,
-                (long) CIA_GET (cpu), (unsigned) PSW, (long) SP));
+                (long) CPU_PC_GET (cpu), (unsigned) PSW, (long) SP));
     }
 
   if (controller->pending_level < 7) /* FIXME */
index 850f05767278f8b1a43d10df561fe809b6307150..4439ac8c481d728bd4910431fa857281d0522a72 100644 (file)
@@ -346,7 +346,7 @@ sim_create_inferior (SIM_DESC sd,
   } else {
     PC = 0;
   }
-  CIA_SET (STATE_CPU (sd, 0), (unsigned64) PC);
+  CPU_PC_SET (STATE_CPU (sd, 0), (unsigned64) PC);
 
   if (STATE_ARCHITECTURE (sd)->mach == bfd_mach_am33_2)
     PSW |= PSW_FE;
@@ -482,7 +482,7 @@ program_interrupt (SIM_DESC sd,
     {
       in_interrupt = 1;
       /* copy NMI handler code from dv-mn103cpu.c */
-      store_word (SP - 4, CIA_GET (cpu));
+      store_word (SP - 4, CPU_PC_GET (cpu));
       store_half (SP - 8, PSW);
 
       /* Set the SYSEF flag in NMICR by backdoor method.  See
@@ -496,7 +496,7 @@ program_interrupt (SIM_DESC sd,
 
   PSW &= ~PSW_IE;
   SP = SP - 8;
-  CIA_SET (cpu, 0x40000008);
+  CPU_PC_SET (cpu, 0x40000008);
 
   in_interrupt = 0;
   sim_engine_halt(sd, cpu, NULL, cia, sim_stopped, sig);
@@ -511,7 +511,7 @@ mn10300_cpu_exception_trigger(SIM_DESC sd, sim_cpu* cpu, address_word cia)
   if(State.exc_suspended > 0)
     sim_io_eprintf(sd, "Warning, nested exception triggered (%d)\n", State.exc_suspended); 
 
-  CIA_SET (cpu, cia);
+  CPU_PC_SET (cpu, cia);
   memcpy(State.exc_trigger_regs, State.regs, sizeof(State.exc_trigger_regs));
   State.exc_suspended = 0;
 }
@@ -527,7 +527,7 @@ mn10300_cpu_exception_suspend(SIM_DESC sd, sim_cpu* cpu, int exception)
 
   memcpy(State.exc_suspend_regs, State.regs, sizeof(State.exc_suspend_regs));
   memcpy(State.regs, State.exc_trigger_regs, sizeof(State.regs));
-  CIA_SET (cpu, PC); /* copy PC back from new State.regs */
+  CPU_PC_SET (cpu, PC); /* copy PC back from new State.regs */
   State.exc_suspended = exception;
 }
 
@@ -549,7 +549,7 @@ mn10300_cpu_exception_resume(SIM_DESC sd, sim_cpu* cpu, int exception)
                       State.exc_suspended, exception); 
       
       memcpy(State.regs, State.exc_suspend_regs, sizeof(State.regs)); 
-      CIA_SET (cpu, PC); /* copy PC back from new State.regs */
+      CPU_PC_SET (cpu, PC); /* copy PC back from new State.regs */
     }
   else if(exception != 0 && State.exc_suspended == 0)
     {
index 47c017e57689b206f06fcfdd8ceabaa86146d570..3781da0ee112c3e06ca0db8e8774eb0b8eb50791 100644 (file)
@@ -71,9 +71,6 @@ mn10300_core_signal ((SD), (CPU), (CIA), (MAP), (NR_BYTES), (ADDR), (TRANSFER),
 /* FIXME: For moment, save/restore PC value found in struct State.
    Struct State will one day go away, being placed in the sim_cpu
    state. */
-#define CIA_GET(CPU) ((PC) + 0)
-#define CIA_SET(CPU,VAL) ((CPU)->cia = (VAL), PC = (VAL))
-
 
 struct _sim_cpu {
   sim_event *pending_nmi;
index 6f7e55b7e36b7e33ce5ecf6dfb5fa073efcaa446..6bdad25bccecc1fcfc1f069c10765a14122a91e2 100644 (file)
@@ -1,3 +1,9 @@
+2015-04-17  Mike Frysinger  <vapier@gentoo.org>
+
+       * interp.c (wbat, wsat, wlat, rsat, rbat, rlat, sim_engine_run):
+       Change CIA_GET to CPU_PC_GET.
+       * sim-main.h (CIA_GET, CIA_SET): Delete.
+
 2015-04-16  Mike Frysinger  <vapier@gentoo.org>
 
        * interp.c (moxie_pc_get, moxie_pc_set): New functions.
index fce6d81787934b89686a223e172d0f3fd7c3cc48..0fbb850b042954f0a8249433c7115494ea1ac178 100644 (file)
@@ -151,7 +151,7 @@ set_initial_gprs (void)
 static INLINE void
 wbat (sim_cpu *scpu, word pc, word x, word v)
 {
-  address_word cia = CIA_GET (scpu);
+  address_word cia = CPU_PC_GET (scpu);
   
   sim_core_write_aligned_1 (scpu, cia, write_map, x, v);
 }
@@ -161,7 +161,7 @@ wbat (sim_cpu *scpu, word pc, word x, word v)
 static INLINE void
 wsat (sim_cpu *scpu, word pc, word x, word v)
 {
-  address_word cia = CIA_GET (scpu);
+  address_word cia = CPU_PC_GET (scpu);
   
   sim_core_write_aligned_2 (scpu, cia, write_map, x, v);
 }
@@ -171,7 +171,7 @@ wsat (sim_cpu *scpu, word pc, word x, word v)
 static INLINE void
 wlat (sim_cpu *scpu, word pc, word x, word v)
 {
-  address_word cia = CIA_GET (scpu);
+  address_word cia = CPU_PC_GET (scpu);
        
   sim_core_write_aligned_4 (scpu, cia, write_map, x, v);
 }
@@ -181,7 +181,7 @@ wlat (sim_cpu *scpu, word pc, word x, word v)
 static INLINE int
 rsat (sim_cpu *scpu, word pc, word x)
 {
-  address_word cia = CIA_GET (scpu);
+  address_word cia = CPU_PC_GET (scpu);
   
   return (sim_core_read_aligned_2 (scpu, cia, read_map, x));
 }
@@ -191,7 +191,7 @@ rsat (sim_cpu *scpu, word pc, word x)
 static INLINE int
 rbat (sim_cpu *scpu, word pc, word x)
 {
-  address_word cia = CIA_GET (scpu);
+  address_word cia = CPU_PC_GET (scpu);
   
   return (sim_core_read_aligned_1 (scpu, cia, read_map, x));
 }
@@ -201,7 +201,7 @@ rbat (sim_cpu *scpu, word pc, word x)
 static INLINE int
 rlat (sim_cpu *scpu, word pc, word x)
 {
-  address_word cia = CIA_GET (scpu);
+  address_word cia = CPU_PC_GET (scpu);
   
   return (sim_core_read_aligned_4 (scpu, cia, read_map, x));
 }
@@ -243,7 +243,7 @@ sim_engine_run (SIM_DESC sd,
   word pc, opc;
   unsigned short inst;
   sim_cpu *scpu = STATE_CPU (sd, 0); /* FIXME */
-  address_word cia = CIA_GET (scpu);
+  address_word cia = CPU_PC_GET (scpu);
 
   pc = cpu.asregs.regs[PC_REGNO];
 
index 6a2174bc124205a295609228772bb20a1b45dbef..3dd53fffc77f641bb8c6b9ff004632afa81f9aae 100644 (file)
@@ -34,8 +34,6 @@ typedef struct _sim_cpu SIM_CPU;
 struct _sim_cpu {
 
   /* The following are internal simulator state variables: */
-#define CIA_GET(CPU) ((CPU)->registers[PCIDX] + 0)
-#define CIA_SET(CPU,CIA) ((CPU)->registers[PCIDX] = (CIA))
 
 /* To keep this default simulator simple, and fast, we use a direct
    vector of registers. The internal simulator engine then uses
@@ -54,4 +52,3 @@ struct sim_state {
 };
 
 #endif
-
index 37204f2f960f2016462cd42abb414041bf10ea78..4567039b7c55c7452f473528524c2fb14e88f2eb 100644 (file)
@@ -1,3 +1,7 @@
+2015-04-17  Mike Frysinger  <vapier@gentoo.org>
+
+       * sim-main.h (CIA_GET, CIA_SET): Delete.
+
 2015-04-15  Mike Frysinger  <vapier@gentoo.org>
 
        * Makefile.in (SIM_OBJS): Delete sim-cpu.o.
index d71217e928ad8f6328867dd5071f57eb29b192b2..73f468000408f934af608a3b1f9d30cba846380d 100644 (file)
@@ -54,9 +54,6 @@ struct sim_state
 #define MSP430_CPU(sd)       (STATE_CPU ((sd), 0))
 #define MSP430_CPU_STATE(sd) (MSP430_CPU ((sd)->state))
 
-#define CIA_GET(CPU)     ((CPU)->state.regs[0] + 0)
-#define CIA_SET(CPU,VAL) ((CPU)->state.regs[0] = (VAL))
-
 #include "sim-config.h"
 #include "sim-types.h"
 #include "sim-engine.h"
index fc359ed7c7fb84c76da26f7a361d8ff61435611e..472597e85213ff28393fc5c49d0710f014756472 100644 (file)
@@ -1,3 +1,7 @@
+2015-04-17  Mike Frysinger  <vapier@gentoo.org>
+
+       * sim-main.h (CIA_GET, CIA_SET): Delete.
+
 2015-04-17  Mike Frysinger  <vapier@gentoo.org>
 
        * interp.c (sh_pc_get, sh_pc_set): New functions.
index 3ae5f0fef940c8205be3f815b34ed0a58a9cb2ea..405f1cb951e4347de568091bd6801513aaddaa30 100644 (file)
@@ -23,9 +23,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 typedef address_word sim_cia;
 
-#define CIA_GET(cpu)     saved_state.asregs.pc
-#define CIA_SET(cpu,val) saved_state.asregs.pc = (val)
-
 typedef struct _sim_cpu SIM_CPU;
 
 #include "sim-base.h"
index 7146868906ecd94a5821debea6a1218164469d72..45b8d3f54f87359ce6ecc6a597370cc3c6846fe3 100644 (file)
@@ -1,3 +1,7 @@
+2015-04-17  Mike Frysinger  <vapier@gentoo.org>
+
+       * sim-main.h (CIA_GET, CIA_SET): Delete.
+
 2015-04-15  Mike Frysinger  <vapier@gentoo.org>
 
        * Makefile.in (SIM_OBJS): Delete sim-cpu.o.
index b988e8eff6241ac33fe160c3ddd9e962fc9ef75b..99f0406342f175bef2a2951511eb5ad6c65d11c8 100644 (file)
@@ -22,9 +22,6 @@ typedef struct _sim_cpu SIM_CPU;
 /* These must be defined before sim-base.h.  */
 typedef UDI sim_cia;
 
-#define CIA_GET(cpu)     CPU_PC_GET (cpu)
-#define CIA_SET(cpu,val) CPU_PC_SET ((cpu), (val) | (sh64_h_ism_get (cpu)))
-
 #include "sim-base.h"
 #include "cgen-sim.h"
 #include "sh64-sim.h"
index bcc9bd5a8fbd8ba8c38346e2c231625118e98188..dc3f38f23eef61f49aab9b8f8054e230f68549f3 100644 (file)
@@ -1,3 +1,7 @@
+2015-04-17  Mike Frysinger  <vapier@gentoo.org>
+
+       * sim-main.h (CIA_GET, CIA_SET): Delete.
+
 2015-04-15  Mike Frysinger  <vapier@gentoo.org>
 
        * Makefile.in (SIM_OBJS): Delete sim-cpu.o.
index 0a025651803d0c7ac475363c2953a48f0f526633..acdf1d77861e140a140e809265774b14dccaa9a3 100644 (file)
@@ -61,9 +61,6 @@ struct _sim_cpu
   sim_cpu_base base;
 };
 
-#define CIA_GET(CPU) ((CPU)->reg.pc + 0)
-#define CIA_SET(CPU,VAL) ((CPU)->reg.pc = (VAL))
-
 struct sim_state {
   sim_cpu *cpu[MAX_NR_PROCESSORS];
 #if 0