+ E_A1_REGNUM = 9,
+ E_FP_REGNUM = 14, /* Contains address of executing stack frame */
+ E_SP_REGNUM = 15, /* Contains address of top of stack */
+ E_PS_REGNUM = 16, /* Contains processor status */
+ E_PC_REGNUM = 17, /* Contains program counter */
+ E_FP0_REGNUM = 18, /* Floating point register 0 */
+ E_FPC_REGNUM = 26, /* 68881 control register */
+ E_FPS_REGNUM = 27, /* 68881 status register */
+ E_FPI_REGNUM = 28
+};
+
+#define REGISTER_BYTES_FP (16*4 + 8 + 8*12 + 3*4)
+#define REGISTER_BYTES_NOFP (16*4 + 8)
+
+#define NUM_FREGS (NUM_REGS-24)
+
+/* Offset from SP to first arg on stack at first instruction of a function */
+
+#define SP_ARG0 (1 * 4)
+
+/* This was determined by experimentation on hp300 BSD 4.3. Perhaps
+ it corresponds to some offset in /usr/include/sys/user.h or
+ something like that. Using some system include file would
+ have the advantage of probably being more robust in the face
+ of OS upgrades, but the disadvantage of being wrong for
+ cross-debugging. */
+
+#define SIG_PC_FP_OFFSET 530
+
+#define TARGET_M68K
+
+
+#if !defined (BPT_VECTOR)
+#define BPT_VECTOR 0xf
+#endif
+
+#if !defined (REMOTE_BPT_VECTOR)
+#define REMOTE_BPT_VECTOR 1
+#endif
+
+
+void m68k_frame_init_saved_regs (struct frame_info *frame_info);
+
+
+/* gdbarch_breakpoint_from_pc is set to m68k_local_breakpoint_from_pc
+ so m68k_remote_breakpoint_from_pc is currently not used. */
+
+const static unsigned char *
+m68k_remote_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
+{
+ static unsigned char break_insn[] = {0x4e, (0x40 | REMOTE_BPT_VECTOR)};
+ *lenptr = sizeof (break_insn);
+ return break_insn;
+}
+
+const static unsigned char *
+m68k_local_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
+{
+ static unsigned char break_insn[] = {0x4e, (0x40 | BPT_VECTOR)};
+ *lenptr = sizeof (break_insn);
+ return break_insn;
+}
+
+
+static int
+m68k_register_bytes_ok (long numbytes)
+{
+ return ((numbytes == REGISTER_BYTES_FP)
+ || (numbytes == REGISTER_BYTES_NOFP));
+}
+
+/* Number of bytes of storage in the actual machine representation
+ for register regnum. On the 68000, all regs are 4 bytes
+ except the floating point regs which are 12 bytes. */
+/* Note that the unsigned cast here forces the result of the
+ subtraction to very high positive values if regnum < FP0_REGNUM */
+
+static int
+m68k_register_raw_size (int regnum)
+{
+ return (((unsigned) (regnum) - FP0_REGNUM) < 8 ? 12 : 4);
+}
+
+/* Number of bytes of storage in the program's representation
+ for register regnum. On the 68000, all regs are 4 bytes
+ except the floating point regs which are 12-byte long doubles. */
+
+static int
+m68k_register_virtual_size (int regnum)
+{
+ return (((unsigned) (regnum) - FP0_REGNUM) < 8 ? 12 : 4);
+}
+
+/* Return the GDB type object for the "standard" data type of data
+ in register N. This should be int for D0-D7, long double for FP0-FP7,
+ and void pointer for all others (A0-A7, PC, SR, FPCONTROL etc).
+ Note, for registers which contain addresses return pointer to void,
+ not pointer to char, because we don't want to attempt to print
+ the string after printing the address. */
+
+static struct type *
+m68k_register_virtual_type (int regnum)
+{
+ if ((unsigned) regnum >= E_FPC_REGNUM)
+ return lookup_pointer_type (builtin_type_void);
+ else if ((unsigned) regnum >= FP0_REGNUM)
+ return builtin_type_long_double;
+ else if ((unsigned) regnum >= A0_REGNUM)
+ return lookup_pointer_type (builtin_type_void);
+ else
+ return builtin_type_int;
+}
+
+/* Function: m68k_register_name
+ Returns the name of the standard m68k register regnum. */
+
+static const char *
+m68k_register_name (int regnum)
+{
+ static char *register_names[] = {
+ "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7",
+ "a0", "a1", "a2", "a3", "a4", "a5", "fp", "sp",
+ "ps", "pc",
+ "fp0", "fp1", "fp2", "fp3", "fp4", "fp5", "fp6", "fp7",
+ "fpcontrol", "fpstatus", "fpiaddr", "fpcode", "fpflags"
+ };
+
+ if (regnum < 0 ||
+ regnum >= sizeof (register_names) / sizeof (register_names[0]))
+ internal_error (__FILE__, __LINE__,
+ "m68k_register_name: illegal register number %d", regnum);
+ else
+ return register_names[regnum];
+}
+
+/* Stack must be kept short aligned when doing function calls. */
+
+static CORE_ADDR
+m68k_stack_align (CORE_ADDR addr)
+{
+ return ((addr + 1) & ~1);
+}
+
+/* Index within `registers' of the first byte of the space for
+ register regnum. */
+
+static int
+m68k_register_byte (int regnum)
+{
+ if (regnum >= E_FPC_REGNUM)
+ return (((regnum - E_FPC_REGNUM) * 4) + 168);
+ else if (regnum >= FP0_REGNUM)
+ return (((regnum - FP0_REGNUM) * 12) + 72);
+ else
+ return (regnum * 4);
+}
+
+/* Store the address of the place in which to copy the structure the
+ subroutine will return. This is called from call_function. */
+
+static void
+m68k_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
+{
+ write_register (E_A1_REGNUM, addr);
+}
+
+/* Extract from an array regbuf containing the (raw) register state
+ a function return value of type type, and copy that, in virtual format,
+ into valbuf. This is assuming that floating point values are returned
+ as doubles in d0/d1. */
+
+static void
+m68k_deprecated_extract_return_value (struct type *type, char *regbuf,
+ char *valbuf)
+{
+ int offset = 0;
+ int typeLength = TYPE_LENGTH (type);
+
+ if (typeLength < 4)
+ offset = 4 - typeLength;
+
+ memcpy (valbuf, regbuf + offset, typeLength);
+}
+
+static CORE_ADDR
+m68k_deprecated_extract_struct_value_address (char *regbuf)
+{
+ return (*(CORE_ADDR *) (regbuf));