(ns32k_register_name_32082): New function.
(ns32k_register_name_32382): Ditto.
* config/ns32k/tm-nbsd.h (REGISTER_NAMES): Remove.
(REGISTER_NAME): Define as ns32k_register_name_32382.
* config/ns32k/tm-umax.h (REGISTER_NAMES): Remove.
(REGISTER_NAME): Define as ns32k_register_name_32082.
+2002-05-26 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * ns32k-tdep.c: Update copyright years.
+ (ns32k_register_name_32082): New function.
+ (ns32k_register_name_32382): Ditto.
+ * config/ns32k/tm-nbsd.h (REGISTER_NAMES): Remove.
+ (REGISTER_NAME): Define as ns32k_register_name_32382.
+ * config/ns32k/tm-umax.h (REGISTER_NAMES): Remove.
+ (REGISTER_NAME): Define as ns32k_register_name_32082.
+
2002-05-24 Jim Blandy <jimb@redhat.com>
* dwarf2read.c (free_line_header): Use xfree, not free.
/* tm-umax.h assumes a 32082 fpu. We have a 32382 fpu. */
-#undef REGISTER_NAMES
-#undef NUM_REGS
-#undef REGISTER_BYTES
-#undef REGISTER_BYTE
-/* Initializer for an array of names of registers.
- There should be NUM_REGS strings in this initializer. */
-#define REGISTER_NAMES {"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
- "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \
- "sp", "fp", "pc", "ps", \
- "fsr", \
- "l0", "l1", "l2", "l3", "l4", "l5", "l6", "l7", "xx", \
- }
+#undef REGISTER_NAME
+#define REGISTER_NAME(REGNUM) ns32k_register_name_32382(REGNUM)
+#undef NUM_REGS
#define NUM_REGS 29
/* Total amount of space needed to store our copies of the machine's
register state, the array `registers'. */
+#undef REGISTER_BYTES
#define REGISTER_BYTES \
((NUM_REGS - 4) * REGISTER_RAW_SIZE(R0_REGNUM) \
+ 8 * REGISTER_RAW_SIZE(LP0_REGNUM))
registers are at the end. Doing it this way is compatable for both
32081 and 32381 equiped machines. */
+#undef REGISTER_BYTE
#define REGISTER_BYTE(N) (((N) < LP0_REGNUM? (N)\
: ((N) - LP0_REGNUM) & 1? (N) - 1 \
: ((N) - LP0_REGNUM + FP0_REGNUM)) * 4)
#define NUM_GENERAL_REGS 8
-/* Initializer for an array of names of registers.
- There should be NUM_REGS strings in this initializer. */
-
-#define REGISTER_NAMES {"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
- "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \
- "sp", "fp", "pc", "ps", \
- "fsr", \
- "l0", "l1", "l2", "l3", "xx", \
- }
+extern char *ns32k_register_name_32082 (int);
+extern char *ns32k_register_name_32382 (int);
+
+#define REGISTER_NAME(REGNUM) ns32k_register_name_32082(REGNUM)
/* Register numbers of various important registers.
Note that some of these values are "real" register numbers,
/* Print NS 32000 instructions for GDB, the GNU debugger.
- Copyright 1986, 1988, 1991, 1992, 1994, 1995, 1998, 1999, 2000, 2001
- Free Software Foundation, Inc.
+ Copyright 1986, 1988, 1991, 1992, 1994, 1995, 1998, 1999, 2000, 2001,
+ 2002 Free Software Foundation, Inc.
This file is part of GDB.
static int sign_extend (int value, int bits);
-void
-_initialize_ns32k_tdep (void)
+char *
+ns32k_register_name_32082 (int regno)
{
- tm_print_insn = print_insn_ns32k;
+ static char *register_names[] =
+ {
+ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
+ "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7",
+ "sp", "fp", "pc", "ps",
+ "l0", "l1", "l2", "l3", "xx",
+ };
+
+ if (regno < 0)
+ return NULL;
+ if (regno >= sizeof (register_names) / sizeof (*register_names))
+ return NULL;
+
+ return (register_names[regno]);
+}
+
+char *
+ns32k_register_name_32382 (int regno)
+{
+ static char *register_names[] =
+ {
+ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
+ "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7",
+ "sp", "fp", "pc", "ps",
+ "fsr",
+ "l0", "l1", "l2", "l3", "l4", "l5", "l6", "l7", "xx",
+ };
+
+ if (regno < 0)
+ return NULL;
+ if (regno >= sizeof (register_names) / sizeof (*register_names))
+ return NULL;
+
+ return (register_names[regno]);
}
/* Advance PC across any function entry prologue instructions
return enter_addr; /* pc is between enter and exit */
}
+
+void
+_initialize_ns32k_tdep (void)
+{
+ tm_print_insn = print_insn_ns32k;
+}