void
supply_fpregset (struct regcache *regcache, const elf_fpregset_t *fpregsetp)
{
  struct gdbarch *gdbarch = get_regcache_arch (regcache);
  int regi;

  for (regi = gdbarch_fp0_regnum (gdbarch);
       regi < gdbarch_fp0_regnum (gdbarch) + 8; regi++)
    regcache_raw_supply (regcache, regi,
			 FPREG_ADDR (fpregsetp,
				     regi - gdbarch_fp0_regnum (gdbarch)));
  regcache_raw_supply (regcache, M68K_FPC_REGNUM, &fpregsetp->fpcntl[0]);
  regcache_raw_supply (regcache, M68K_FPS_REGNUM, &fpregsetp->fpcntl[1]);
  regcache_raw_supply (regcache, M68K_FPI_REGNUM, &fpregsetp->fpcntl[2]);
}
void
supply_fpregset (elf_fpregset_t *fpregsetp)
{
  int regi;

  for (regi = FP0_REGNUM; regi < FP0_REGNUM + 8; regi++)
    regcache_raw_supply (current_regcache, regi,
			 FPREG_ADDR (fpregsetp, regi - FP0_REGNUM));
  regcache_raw_supply (current_regcache, M68K_FPC_REGNUM,
		       (char *) &fpregsetp->fpcntl[0]);
  regcache_raw_supply (current_regcache, M68K_FPS_REGNUM,
		       (char *) &fpregsetp->fpcntl[1]);
  regcache_raw_supply (current_regcache, M68K_FPI_REGNUM,
		       (char *) &fpregsetp->fpcntl[2]);
}
void
fill_fpregset (elf_fpregset_t *fpregsetp, int regno)
{
  int i;

  /* Fill in the floating-point registers.  */
  for (i = FP0_REGNUM; i < FP0_REGNUM + 8; i++)
    if (regno == -1 || regno == i)
      regcache_raw_collect (current_regcache, i,
			    FPREG_ADDR (fpregsetp, i - FP0_REGNUM));

  /* Fill in the floating-point control registers.  */
  for (i = M68K_FPC_REGNUM; i <= M68K_FPI_REGNUM; i++)
    if (regno == -1 || regno == i)
      regcache_raw_collect (current_regcache, i,
			    (char *) &fpregsetp->fpcntl[i - M68K_FPC_REGNUM]);
}
void
fill_fpregset (const struct regcache *regcache,
	       elf_fpregset_t *fpregsetp, int regno)
{
  struct gdbarch *gdbarch = get_regcache_arch (regcache);
  int i;

  /* Fill in the floating-point registers.  */
  for (i = gdbarch_fp0_regnum (gdbarch);
       i < gdbarch_fp0_regnum (gdbarch) + 8; i++)
    if (regno == -1 || regno == i)
      regcache_raw_collect (regcache, i,
			    FPREG_ADDR (fpregsetp,
				        i - gdbarch_fp0_regnum (gdbarch)));

  /* Fill in the floating-point control registers.  */
  for (i = M68K_FPC_REGNUM; i <= M68K_FPI_REGNUM; i++)
    if (regno == -1 || regno == i)
      regcache_raw_collect (regcache, i,
			    &fpregsetp->fpcntl[i - M68K_FPC_REGNUM]);
}