things accordingly. */
static void
-mips_xfer_register (struct regcache *regcache, int reg_num, int length,
+mips_xfer_register (struct gdbarch *gdbarch, struct regcache *regcache,
+ int reg_num, int length,
enum bfd_endian endian, gdb_byte *in,
const gdb_byte *out, int buf_offset)
{
int reg_offset = 0;
- struct gdbarch *gdbarch = get_regcache_arch (regcache);
gdb_assert (reg_num >= gdbarch_num_regs (gdbarch));
/* Need to transfer the left or right part of the register, based on
eight bytes with the lower memory address are in $f0. */
if (mips_debug)
fprintf_unfiltered (gdb_stderr, "Return float in $f0 and $f2\n");
- mips_xfer_register (regcache,
+ mips_xfer_register (gdbarch, regcache,
gdbarch_num_regs (gdbarch)
+ mips_regnum (gdbarch)->fp0,
8, gdbarch_byte_order (gdbarch),
readbuf, writebuf, 0);
- mips_xfer_register (regcache,
+ mips_xfer_register (gdbarch, regcache,
gdbarch_num_regs (gdbarch)
+ mips_regnum (gdbarch)->fp0 + 2,
8, gdbarch_byte_order (gdbarch),
/* A single or double floating-point value that fits in FP0. */
if (mips_debug)
fprintf_unfiltered (gdb_stderr, "Return float in $fp0\n");
- mips_xfer_register (regcache,
+ mips_xfer_register (gdbarch, regcache,
gdbarch_num_regs (gdbarch)
+ mips_regnum (gdbarch)->fp0,
TYPE_LENGTH (type),
if (mips_debug)
fprintf_unfiltered (gdb_stderr, "Return float struct+%d\n",
offset);
- mips_xfer_register (regcache, gdbarch_num_regs (gdbarch)
- + regnum,
+ mips_xfer_register (gdbarch, regcache,
+ gdbarch_num_regs (gdbarch) + regnum,
TYPE_LENGTH (TYPE_FIELD_TYPE (type, field)),
gdbarch_byte_order (gdbarch),
readbuf, writebuf, offset);
if (mips_debug)
fprintf_unfiltered (gdb_stderr, "Return struct+%d:%d in $%d\n",
offset, xfer, regnum);
- mips_xfer_register (regcache, gdbarch_num_regs (gdbarch) + regnum,
+ mips_xfer_register (gdbarch, regcache,
+ gdbarch_num_regs (gdbarch) + regnum,
xfer, BFD_ENDIAN_UNKNOWN, readbuf, writebuf,
offset);
}
if (mips_debug)
fprintf_unfiltered (gdb_stderr, "Return scalar+%d:%d in $%d\n",
offset, xfer, regnum);
- mips_xfer_register (regcache, gdbarch_num_regs (gdbarch) + regnum,
+ mips_xfer_register (gdbarch, regcache,
+ gdbarch_num_regs (gdbarch) + regnum,
xfer, gdbarch_byte_order (gdbarch),
readbuf, writebuf, offset);
}
least significant part of FP0. */
if (mips_debug)
fprintf_unfiltered (gdb_stderr, "Return float in $fp0\n");
- mips_xfer_register (regcache,
+ mips_xfer_register (gdbarch, regcache,
gdbarch_num_regs (gdbarch)
+ mips_regnum (gdbarch)->fp0,
TYPE_LENGTH (type),
switch (gdbarch_byte_order (gdbarch))
{
case BFD_ENDIAN_LITTLE:
- mips_xfer_register (regcache,
+ mips_xfer_register (gdbarch, regcache,
gdbarch_num_regs (gdbarch)
+ mips_regnum (gdbarch)->fp0 +
0, 4, gdbarch_byte_order (gdbarch),
readbuf, writebuf, 0);
- mips_xfer_register (regcache,
+ mips_xfer_register (gdbarch, regcache,
gdbarch_num_regs (gdbarch)
+ mips_regnum (gdbarch)->fp0 + 1,
4, gdbarch_byte_order (gdbarch),
readbuf, writebuf, 4);
break;
case BFD_ENDIAN_BIG:
- mips_xfer_register (regcache,
+ mips_xfer_register (gdbarch, regcache,
gdbarch_num_regs (gdbarch)
+ mips_regnum (gdbarch)->fp0 + 1,
4, gdbarch_byte_order (gdbarch),
readbuf, writebuf, 0);
- mips_xfer_register (regcache,
+ mips_xfer_register (gdbarch, regcache,
gdbarch_num_regs (gdbarch)
+ mips_regnum (gdbarch)->fp0 + 0,
4, gdbarch_byte_order (gdbarch),
if (mips_debug)
fprintf_unfiltered (gdb_stderr, "Return float struct+%d\n",
offset);
- mips_xfer_register (regcache, gdbarch_num_regs (gdbarch)
- + regnum,
+ mips_xfer_register (gdbarch, regcache,
+ gdbarch_num_regs (gdbarch) + regnum,
TYPE_LENGTH (TYPE_FIELD_TYPE (type, field)),
gdbarch_byte_order (gdbarch),
readbuf, writebuf, offset);
if (mips_debug)
fprintf_unfiltered (gdb_stderr, "Return struct+%d:%d in $%d\n",
offset, xfer, regnum);
- mips_xfer_register (regcache, gdbarch_num_regs (gdbarch)
- + regnum, xfer,
+ mips_xfer_register (gdbarch, regcache,
+ gdbarch_num_regs (gdbarch) + regnum, xfer,
BFD_ENDIAN_UNKNOWN, readbuf, writebuf, offset);
}
return RETURN_VALUE_REGISTER_CONVENTION;
if (mips_debug)
fprintf_unfiltered (gdb_stderr, "Return scalar+%d:%d in $%d\n",
offset, xfer, regnum);
- mips_xfer_register (regcache, gdbarch_num_regs (gdbarch)
- + regnum, xfer,
+ mips_xfer_register (gdbarch, regcache,
+ gdbarch_num_regs (gdbarch) + regnum, xfer,
gdbarch_byte_order (gdbarch),
readbuf, writebuf, offset);
}
part of FP0. */
if (mips_debug)
fprintf_unfiltered (gdb_stderr, "Return float in $fp0\n");
- mips_xfer_register (regcache,
+ mips_xfer_register (gdbarch, regcache,
gdbarch_num_regs (gdbarch)
+ mips_regnum (gdbarch)->fp0,
TYPE_LENGTH (type),
if (mips_debug)
fprintf_unfiltered (gdb_stderr, "Return scalar+%d:%d in $%d\n",
offset, xfer, regnum);
- mips_xfer_register (regcache, gdbarch_num_regs (gdbarch) + regnum,
+ mips_xfer_register (gdbarch, regcache,
+ gdbarch_num_regs (gdbarch) + regnum,
xfer, gdbarch_byte_order (gdbarch),
readbuf, writebuf, offset);
}