+2002-05-26 Jason Thorpe <thorpej@wasabisystems.com>
+
+ * ns32k-tdep.c (ns32k_register_byte_32082,
+ ns32k_register_byte_32382, ns32k_register_raw_size,
+ ns32k_register_virtual_size, ns32k_register_virtual_type): New
+ functions.
+ * config/ns32k/tm-nbsd.h (REGISTER_BYTE): Define as
+ ns32k_register_byte_32382.
+ * config/ns32k/tm-umax.h: Update copyright years.
+ (REGISTER_BYTE): Define as ns32k_register_byte_32082.
+ (REGISTER_RAW_SIZE): Define as ns32k_register_raw_size.
+ (REGISTER_VIRTUAL_SIZE): Define as ns32k_register_virtual_size.
+ (REGISTER_VIRTUAL_TYPE): Define as ns32k_register_virtual_type.
+ (ns32k_get_enter_addr): Fix prototype.
+
2002-05-26 Jason Thorpe <thorpej@wasabisystems.com>
* ns32k-tdep.c: Update copyright years.
/* tm-umax.h assumes a 32082 fpu. We have a 32382 fpu. */
#undef REGISTER_NAME
-#define REGISTER_NAME(REGNUM) ns32k_register_name_32382(REGNUM)
+#define REGISTER_NAME(REGNUM) ns32k_register_name_32382((REGNUM))
#undef NUM_REGS
#define NUM_REGS 29
((NUM_REGS - 4) * REGISTER_RAW_SIZE(R0_REGNUM) \
+ 8 * REGISTER_RAW_SIZE(LP0_REGNUM))
-/* Index within `registers' of the first byte of the space for
- register N. */
-
-/* This is a bit yuck. The even numbered double precision floating
- point long registers occupy the same space as the even:odd numbered
- single precision floating point registers, but the extra 32381 fpu
- 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 REGISTER_BYTE(N) ns32k_register_byte_32382 ((N))
#endif /* TM_NBSD_H */
/* Definitions to make GDB run on an encore under umax 4.2
- Copyright 1987, 1989, 1991, 1993, 1994, 1998, 1999, 2000, 2001
+ Copyright 1987, 1989, 1991, 1993, 1994, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
This file is part of GDB.
/* Index within `registers' of the first byte of the space for
register N. */
+extern int ns32k_register_byte_32082 (int);
+extern int ns32k_register_byte_32382 (int);
+#define REGISTER_BYTE(N) ns32k_register_byte_32082 ((N))
-#define REGISTER_BYTE(N) ((N) >= LP0_REGNUM ? \
- LP0_REGNUM * 4 + ((N) - LP0_REGNUM) * 8 : (N) * 4)
+extern int ns32k_register_raw_size (int);
+#define REGISTER_RAW_SIZE(N) ns32k_register_raw_size ((N))
-/* Number of bytes of storage in the actual machine representation
- for register N. On the 32000, all regs are 4 bytes
- except for the doubled floating registers. */
-
-#define REGISTER_RAW_SIZE(N) ((N) >= LP0_REGNUM ? 8 : 4)
-
-/* Number of bytes of storage in the program's representation
- for register N. On the 32000, all regs are 4 bytes
- except for the doubled floating registers. */
-
-#define REGISTER_VIRTUAL_SIZE(N) ((N) >= LP0_REGNUM ? 8 : 4)
+extern int ns32k_register_virtual_size (int);
+#define REGISTER_VIRTUAL_SIZE(N) ns32k_register_virtual_size ((N))
/* Largest value REGISTER_RAW_SIZE can have. */
#define MAX_REGISTER_VIRTUAL_SIZE 8
-/* Return the GDB type object for the "standard" data type
- of data in register N. */
-
-#define REGISTER_VIRTUAL_TYPE(N) \
- (((N) < FP0_REGNUM) ? \
- builtin_type_int : \
- ((N) < FP0_REGNUM + 8) ? \
- builtin_type_float : \
- ((N) < LP0_REGNUM) ? \
- builtin_type_int : \
- builtin_type_double)
+struct type *ns32k_register_virtual_type (int);
+#define REGISTER_VIRTUAL_TYPE(N) ns32k_register_virtual_type ((N))
/* Store the address of the place in which to copy the structure the
subroutine will return. This is called from call_function.
Returns positive address > 1 if pc is between enter/exit,
1 if pc before enter or after exit, 0 otherwise. */
-extern CORE_ADDR ns32k_get_enter_addr ();
+extern CORE_ADDR ns32k_get_enter_addr (CORE_ADDR);
/* Return number of args passed to a frame.
Can return -1, meaning no way to tell. */
return (register_names[regno]);
}
+int
+ns32k_register_byte_32082 (int regno)
+{
+ if (regno >= LP0_REGNUM)
+ return (LP0_REGNUM * 4) + ((regno - LP0_REGNUM) * 8);
+
+ return (regno * 4);
+}
+
+int
+ns32k_register_byte_32382 (int regno)
+{
+ /* This is a bit yuk. The even numbered double precision floating
+ point long registers occupy the same space as the even:odd numbered
+ single precision floating point registers, but the extra 32381 FPU
+ registers are at the end. Doing it this way is compatible for both
+ 32081 and 32381 equipped machines. */
+
+ return ((regno < LP0_REGNUM ? regno
+ : (regno - LP0_REGNUM) & 1 ? regno - 1
+ : (regno - LP0_REGNUM + FP0_REGNUM)) * 4);
+}
+
+int
+ns32k_register_raw_size (int regno)
+{
+ /* All registers are 4 bytes, except for the doubled floating
+ registers. */
+
+ return ((regno >= LP0_REGNUM) ? 8 : 4);
+}
+
+int
+ns32k_register_virtual_size (int regno)
+{
+ return ((regno >= LP0_REGNUM) ? 8 : 4);
+}
+
+struct type *
+ns32k_register_virtual_type (int regno)
+{
+ if (regno < FP0_REGNUM)
+ return (builtin_type_int);
+
+ if (regno < FP0_REGNUM + 8)
+ return (builtin_type_float);
+
+ if (regno < LP0_REGNUM)
+ return (builtin_type_int);
+
+ return (builtin_type_double);
+}
+
/* Advance PC across any function entry prologue instructions
to reach some "real" code. */