This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit] rx: Add acc register and revise register order and names


I've committed the patch below.  As noted in the subject and ChangeLog
entries below, it adds the "acc" register, changes the name of one of
the registers, and changes the order of several of the registers.

Kevin

gdb/ChangeLog:

	* rx-tdep.c (RX_ACC_REGNUM): Define.
	(RX_NUM_REGS): Redefine to 26.
	(rx_register_name): Add register "acc".  Change order of several
	registers.  Change name of "vct" register to "fintv" to match RX
	documentation.
	(rx_register_type): Add case for RX_ACC_REGNUM.

include/gdb/ChangeLog:

	* sim-rx.h (sim_rx_regnum): Add sim_rx_acc_regnum.  Adjust
	register order.

sim/rx/ChangeLog:

	* gdb-if.c (trace.h): Include.
	(reg_size, sim_fetch_register): Add cases for sim_rx_acc_regnum.

Index: gdb/rx-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/rx-tdep.c,v
retrieving revision 1.2
diff -u -p -r1.2 rx-tdep.c
--- gdb/rx-tdep.c	1 Jan 2010 07:31:41 -0000	1.2
+++ gdb/rx-tdep.c	24 Jun 2010 18:54:15 -0000
@@ -46,7 +46,8 @@ enum
   RX_FP_REGNUM = 6,
   RX_R15_REGNUM = 15,
   RX_PC_REGNUM = 19,
-  RX_NUM_REGS = 25
+  RX_ACC_REGNUM = 25,
+  RX_NUM_REGS = 26
 };
 
 /* Architecture specific data.  */
@@ -111,15 +112,16 @@ rx_register_name (struct gdbarch *gdbarc
     "r13",
     "r14",
     "r15",
-    "isp",
     "usp",
-    "intb",
-    "pc",
+    "isp",
     "psw",
-    "bpc",
+    "pc",
+    "intb",
     "bpsw",
-    "vct",
-    "fpsw"
+    "bpc",
+    "fintv",
+    "fpsw",
+    "acc"
   };
 
   return reg_names[regnr];
@@ -131,6 +133,8 @@ rx_register_type (struct gdbarch *gdbarc
 {
   if (reg_nr == RX_PC_REGNUM)
     return builtin_type (gdbarch)->builtin_func_ptr;
+  else if (reg_nr == RX_ACC_REGNUM)
+    return builtin_type (gdbarch)->builtin_unsigned_long_long;
   else
     return builtin_type (gdbarch)->builtin_unsigned_long;
 }
Index: include/gdb/sim-rx.h
===================================================================
RCS file: /cvs/src/src/include/gdb/sim-rx.h,v
retrieving revision 1.2
diff -u -p -r1.2 sim-rx.h
--- include/gdb/sim-rx.h	1 Jan 2010 10:03:25 -0000	1.2
+++ include/gdb/sim-rx.h	24 Jun 2010 18:54:15 -0000
@@ -40,15 +40,16 @@ enum sim_rx_regnum
     sim_rx_r13_regnum,
     sim_rx_r14_regnum,
     sim_rx_r15_regnum,
-    sim_rx_isp_regnum,
     sim_rx_usp_regnum,
-    sim_rx_intb_regnum,
-    sim_rx_pc_regnum,
+    sim_rx_isp_regnum,
     sim_rx_ps_regnum,
-    sim_rx_bpc_regnum,
+    sim_rx_pc_regnum,
+    sim_rx_intb_regnum,
     sim_rx_bpsw_regnum,
+    sim_rx_bpc_regnum,
     sim_rx_fintv_regnum,
     sim_rx_fpsw_regnum,
+    sim_rx_acc_regnum,
     sim_rx_num_regs
   };
 
Index: sim/rx/gdb-if.c
===================================================================
RCS file: /cvs/src/src/sim/rx/gdb-if.c,v
retrieving revision 1.5
diff -u -p -r1.5 gdb-if.c
--- sim/rx/gdb-if.c	28 May 2010 17:21:40 -0000	1.5
+++ sim/rx/gdb-if.c	24 Jun 2010 18:54:15 -0000
@@ -36,6 +36,7 @@ along with this program.  If not, see <h
 #include "load.h"
 #include "syscalls.h"
 #include "err.h"
+#include "trace.h"
 
 /* Ideally, we'd wrap up all the minisim's data structures in an
    object and pass that around.  However, neither GDB nor run needs
@@ -403,6 +404,9 @@ reg_size (enum sim_rx_regnum regno)
     case sim_rx_fpsw_regnum:
       size = sizeof (regs.r_fpsw);
       break;
+    case sim_rx_acc_regnum:
+      size = sizeof (regs.r_acc);
+      break;
     default:
       size = 0;
       break;
@@ -503,6 +507,9 @@ sim_fetch_register (SIM_DESC sd, int reg
     case sim_rx_fpsw_regnum:
       val = get_reg (fpsw);
       break;
+    case sim_rx_acc_regnum:
+      val = ((DI) get_reg (acchi) << 32) | get_reg (acclo);
+      break;
     default:
       fprintf (stderr, "rx minisim: unrecognized register number: %d\n",
 	       regno);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]