aboutsummaryrefslogtreecommitdiff
path: root/sim/m32r/m32r.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-12-07 16:13:06 +0000
committerAndrew Cagney <cagney@redhat.com>2003-12-07 16:13:06 +0000
commit0b2e03b491aa6793bbeb5775e483dfefd1679e92 (patch)
treed88dc590bffb94a1997038310a9b2b8e0664d204 /sim/m32r/m32r.c
parentcd886a95bfd21de111e87f1788a977d4c0ce885d (diff)
downloadgdb-0b2e03b491aa6793bbeb5775e483dfefd1679e92.zip
gdb-0b2e03b491aa6793bbeb5775e483dfefd1679e92.tar.gz
gdb-0b2e03b491aa6793bbeb5775e483dfefd1679e92.tar.bz2
More reversion of incomplete m32r changes. Should be back to normal.
Diffstat (limited to 'sim/m32r/m32r.c')
-rw-r--r--sim/m32r/m32r.c124
1 files changed, 8 insertions, 116 deletions
diff --git a/sim/m32r/m32r.c b/sim/m32r/m32r.c
index 3e5e4aa..13e71e6 100644
--- a/sim/m32r/m32r.c
+++ b/sim/m32r/m32r.c
@@ -48,8 +48,6 @@ m32r_decode_gdb_ctrl_regnum (int gdb_regnum)
int
m32rbf_fetch_register (SIM_CPU *current_cpu, int rn, unsigned char *buf, int len)
{
- int mach = MACH_NUM (CPU_MACH (current_cpu));
-
if (rn < 16)
SETTWI (buf, a_m32r_h_gr_get (current_cpu, rn));
else
@@ -66,22 +64,13 @@ m32rbf_fetch_register (SIM_CPU *current_cpu, int rn, unsigned char *buf, int len
m32r_decode_gdb_ctrl_regnum (rn)));
break;
case PC_REGNUM :
- if (mach == MACH_M32R)
- SETTWI (buf, m32rbf_h_pc_get (current_cpu));
- else
- SETTWI (buf, m32rxf_h_pc_get (current_cpu));
+ SETTWI (buf, a_m32r_h_pc_get (current_cpu));
break;
case ACCL_REGNUM :
- if (mach == MACH_M32R)
- SETTWI (buf, GETLODI (m32rbf_h_accum_get (current_cpu)));
- else
- SETTWI (buf, GETLODI (m32rxf_h_accum_get (current_cpu)));
+ SETTWI (buf, GETLODI (a_m32r_h_accum_get (current_cpu)));
break;
case ACCH_REGNUM :
- if (mach == MACH_M32R)
- SETTWI (buf, GETHIDI (m32rbf_h_accum_get (current_cpu)));
- else
- SETTWI (buf, GETHIDI (m32rxf_h_accum_get (current_cpu)));
+ SETTWI (buf, GETHIDI (a_m32r_h_accum_get (current_cpu)));
break;
default :
return 0;
@@ -95,8 +84,6 @@ m32rbf_fetch_register (SIM_CPU *current_cpu, int rn, unsigned char *buf, int len
int
m32rbf_store_register (SIM_CPU *current_cpu, int rn, unsigned char *buf, int len)
{
- int mach = MACH_NUM (CPU_MACH (current_cpu));
-
if (rn < 16)
a_m32r_h_gr_set (current_cpu, rn, GETTWI (buf));
else
@@ -114,37 +101,20 @@ m32rbf_store_register (SIM_CPU *current_cpu, int rn, unsigned char *buf, int len
GETTWI (buf));
break;
case PC_REGNUM :
- if (mach == MACH_M32R)
- m32rbf_h_pc_set (current_cpu, GETTWI (buf));
- else
- m32rxf_h_pc_set (current_cpu, GETTWI (buf));
+ a_m32r_h_pc_set (current_cpu, GETTWI (buf));
break;
case ACCL_REGNUM :
{
- DI val;
- if (mach == MACH_M32R)
- val = m32rbf_h_accum_get (current_cpu);
- else
- val = m32rxf_h_accum_get (current_cpu);
+ DI val = a_m32r_h_accum_get (current_cpu);
SETLODI (val, GETTWI (buf));
- if (mach == MACH_M32R)
- m32rbf_h_accum_set (current_cpu, val);
- else
- m32rxf_h_accum_set (current_cpu, val);
+ a_m32r_h_accum_set (current_cpu, val);
break;
}
case ACCH_REGNUM :
{
- DI val;
- if (mach == MACH_M32R)
- val = m32rbf_h_accum_get (current_cpu);
- else
- val = m32rxf_h_accum_get (current_cpu);
+ DI val = a_m32r_h_accum_get (current_cpu);
SETHIDI (val, GETTWI (buf));
- if (mach == MACH_M32R)
- m32rbf_h_accum_set (current_cpu, val);
- else
- m32rxf_h_accum_set (current_cpu, val);
+ a_m32r_h_accum_set (current_cpu, val);
break;
}
default :
@@ -154,84 +124,6 @@ m32rbf_store_register (SIM_CPU *current_cpu, int rn, unsigned char *buf, int len
return -1; /*FIXME*/
}
-/* Cover fns for mach independent register accesses. */
-
-SI
-a_m32r_h_gr_get (SIM_CPU *current_cpu, UINT regno)
-{
- switch (MACH_NUM (CPU_MACH (current_cpu)))
- {
-#ifdef HAVE_CPU_M32RBF
- case MACH_M32R :
- return m32rbf_h_gr_get (current_cpu, regno);
-#endif
-#ifdef HAVE_CPU_M32RXF
- case MACH_M32RX :
- return m32rxf_h_gr_get (current_cpu, regno);
-#endif
- default :
- abort ();
- }
-}
-
-void
-a_m32r_h_gr_set (SIM_CPU *current_cpu, UINT regno, SI newval)
-{
- switch (MACH_NUM (CPU_MACH (current_cpu)))
- {
-#ifdef HAVE_CPU_M32RBF
- case MACH_M32R :
- m32rbf_h_gr_set (current_cpu, regno, newval);
- break;
-#endif
-#ifdef HAVE_CPU_M32RXF
- case MACH_M32RX :
- m32rxf_h_gr_set (current_cpu, regno, newval);
- break;
-#endif
- default :
- abort ();
- }
-}
-
-USI
-a_m32r_h_cr_get (SIM_CPU *current_cpu, UINT regno)
-{
- switch (MACH_NUM (CPU_MACH (current_cpu)))
- {
-#ifdef HAVE_CPU_M32RBF
- case MACH_M32R :
- return m32rbf_h_cr_get (current_cpu, regno);
-#endif
-#ifdef HAVE_CPU_M32RXF
- case MACH_M32RX :
- return m32rxf_h_cr_get (current_cpu, regno);
-#endif
- default :
- abort ();
- }
-}
-
-void
-a_m32r_h_cr_set (SIM_CPU *current_cpu, UINT regno, USI newval)
-{
- switch (MACH_NUM (CPU_MACH (current_cpu)))
- {
-#ifdef HAVE_CPU_M32RBF
- case MACH_M32R :
- m32rbf_h_cr_set (current_cpu, regno, newval);
- break;
-#endif
-#ifdef HAVE_CPU_M32RXF
- case MACH_M32RX :
- m32rxf_h_cr_set (current_cpu, regno, newval);
- break;
-#endif
- default :
- abort ();
- }
-}
-
USI
m32rbf_h_cr_get_handler (SIM_CPU *current_cpu, UINT cr)
{