Ejemplo n.º 1
0
static void
bdm_ppc_store_registers (int regno)
{
  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
  int i;
  int first_regno, last_regno;
  int first_bdm_regno, last_bdm_regno;

  if (regno == -1)
    {
      first_regno = 0;
      last_regno = NUM_REGS - 1;

      first_bdm_regno = 0;
      last_bdm_regno = BDM_NUM_REGS - 1;
    }
  else
    {
      first_regno = regno;
      last_regno = regno;

      first_bdm_regno = bdm_regmap[regno];
      last_bdm_regno = bdm_regmap[regno];
    }

  if (first_bdm_regno == -1)
    return;			/* Unsupported register */

  /* FIXME: jimb/2004-05-04: I'm not sure how to adapt this code to
     processors that lack floating point registers, and I don't have
     have the equipment to test it.  So we'll leave that case for the
     next person who encounters it.  */
  gdb_assert (ppc_floating_point_unit_p (current_gdbarch));

  for (i = first_regno; i <= last_regno; i++)
    {
      int bdm_regno;

      bdm_regno = bdm_regmap[i];

      /* only attempt to write if it's a valid ppc 8xx register */
      /* (need to avoid FP regs and MQ reg) */
      if ((i != gdbarch_tdep (current_gdbarch)->ppc_mq_regnum) 
          && (i != gdbarch_tdep (current_gdbarch)->ppc_fpscr_regnum) 
          && ((i < tdep->ppc_fp0_regnum)
              || (i >= tdep->ppc_fp0_regnum + ppc_num_fprs)))
	{
/*          printf("write valid reg %d\n", bdm_regno); */
	  ocd_write_bdm_registers (bdm_regno, deprecated_registers + DEPRECATED_REGISTER_BYTE (i), 4);
	}
/*
   else if (i == gdbarch_tdep (current_gdbarch)->ppc_mq_regnum)
   printf("don't write invalid reg %d (PPC_MQ_REGNUM)\n", bdm_regno);
   else
   printf("don't write invalid reg %d\n", bdm_regno);
 */
    }
}
Ejemplo n.º 2
0
static void
bdm_ppc_store_registers (int regno)
{
  int i;
  int first_regno, last_regno;
  int first_bdm_regno, last_bdm_regno;

  if (regno == -1)
    {
      first_regno = 0;
      last_regno = NUM_REGS - 1;

      first_bdm_regno = 0;
      last_bdm_regno = BDM_NUM_REGS - 1;
    }
  else
    {
      first_regno = regno;
      last_regno = regno;

      first_bdm_regno = bdm_regmap[regno];
      last_bdm_regno = bdm_regmap[regno];
    }

  if (first_bdm_regno == -1)
    return;			/* Unsupported register */

  for (i = first_regno; i <= last_regno; i++)
    {
      int bdm_regno;

      bdm_regno = bdm_regmap[i];

      /* only attempt to write if it's a valid ppc 8xx register */
      /* (need to avoid FP regs and MQ reg) */
      if ((i != gdbarch_tdep (current_gdbarch)->ppc_mq_regnum) 
          && (i != gdbarch_tdep (current_gdbarch)->ppc_fpscr_regnum) 
          && ((i < FP0_REGNUM) || (i > FPLAST_REGNUM)))
	{
/*          printf("write valid reg %d\n", bdm_regno); */
	  ocd_write_bdm_registers (bdm_regno, deprecated_registers + DEPRECATED_REGISTER_BYTE (i), 4);
	}
/*
   else if (i == gdbarch_tdep (current_gdbarch)->ppc_mq_regnum)
   printf("don't write invalid reg %d (PPC_MQ_REGNUM)\n", bdm_regno);
   else
   printf("don't write invalid reg %d\n", bdm_regno);
 */
    }
}