]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* config/rs6000/tm-rs6000.h (FPLAST_REGNUM): Delete #definition.
authorJim Blandy <jimb@codesourcery.com>
Tue, 4 May 2004 17:43:52 +0000 (17:43 +0000)
committerJim Blandy <jimb@codesourcery.com>
Tue, 4 May 2004 17:43:52 +0000 (17:43 +0000)
* ppc-tdep.h (ppc_num_fprs): New enum constant.
* aix-thread.c (fetch_regs_kernel_thread, fill_fprs,
store_regs_kernel_thread): Use FP0_REGNUM + ppc_num_fprs, not
FPLAST_REGNUM.
* ppc-bdm.c (bdm_ppc_fetch_registers, bdm_ppc_store_registers):
Same.
* ppc-linux-nat.c (ppc_register_u_addr): Same.
* rs6000-nat.c (regmap, fetch_inferior_registers)
(store_inferior_registers): Same.

gdb/ChangeLog
gdb/aix-thread.c
gdb/config/rs6000/tm-rs6000.h
gdb/ppc-bdm.c
gdb/ppc-linux-nat.c
gdb/ppc-tdep.h
gdb/rs6000-nat.c

index 8b09fceee7cb2909c8b2078ffab13870a9ab7c0c..0352eed4f594bb3ec8e1fafa5d9f6973fecc052d 100644 (file)
@@ -1,5 +1,16 @@
 2004-05-04  Jim Blandy  <jimb@redhat.com>
 
+       * config/rs6000/tm-rs6000.h (FPLAST_REGNUM): Delete #definition.
+       * ppc-tdep.h (ppc_num_fprs): New enum constant.
+       * aix-thread.c (fetch_regs_kernel_thread, fill_fprs,
+       store_regs_kernel_thread): Use FP0_REGNUM + ppc_num_fprs, not
+       FPLAST_REGNUM.
+       * ppc-bdm.c (bdm_ppc_fetch_registers, bdm_ppc_store_registers):
+       Same.
+       * ppc-linux-nat.c (ppc_register_u_addr): Same.
+       * rs6000-nat.c (regmap, fetch_inferior_registers) 
+       (store_inferior_registers): Same.
+
        * aix-thread.c (fill_fprs): Fix off-by-one error comparing regno
        with FPLAST_REGNUM.
 
index 0ce285a6986d52bb9c16068fefb9abd055dc04ae..89a0755599840531977c4301e4500375c441ecce 100644 (file)
@@ -1175,7 +1175,9 @@ fetch_regs_kernel_thread (int regno, pthdb_tid_t tid)
 
   /* Floating-point registers.  */
 
-  if (regno == -1 || (regno >= FP0_REGNUM && regno <= FPLAST_REGNUM))
+  if (regno == -1
+      || (regno >= FP0_REGNUM
+          && regno < FP0_REGNUM + ppc_num_fprs))
     {
       if (!ptrace32 (PTT_READ_FPRS, tid, (int *) fprs, 0, NULL))
        memset (fprs, 0, sizeof (fprs));
@@ -1262,7 +1264,7 @@ fill_fprs (double *vals)
 {
   int regno;
 
-  for (regno = FP0_REGNUM; regno <= FPLAST_REGNUM; regno++)
+  for (regno = FP0_REGNUM; regno < FP0_REGNUM + ppc_num_fprs; regno++)
     if (register_cached (regno))
       regcache_collect (regno, vals + regno);
 }
@@ -1466,7 +1468,9 @@ store_regs_kernel_thread (int regno, pthdb_tid_t tid)
 
   /* Floating-point registers.  */
 
-  if (regno == -1 || (regno >= FP0_REGNUM && regno <= FPLAST_REGNUM))
+  if (regno == -1
+      || (regno >= FP0_REGNUM
+          && regno < FP0_REGNUM + ppc_num_fprs))
     {
       /* Pre-fetch: some regs may not be in the cache.  */
       ptrace32 (PTT_READ_FPRS, tid, (int *) fprs, 0, NULL);
index 4422fcbf3c8eaf25474c531f2cc84feba796e05a..e53a7b836a309932908e250d847061838231340f 100644 (file)
@@ -72,7 +72,6 @@ extern void aix_process_linenos (void);
    but do serve to get the desired values when passed to read_register.  */
 
 #define FP0_REGNUM 32          /* Floating point register 0 */
-#define FPLAST_REGNUM 63       /* Last floating point register */
 
 /* Notice when a new child process is started. */
 
index 2355b2c74ebb63cfed219cac1232f6b7df14656a..515cbdd6101c8d232f3a30d2b5cb82659861c71d 100644 (file)
@@ -162,7 +162,7 @@ bdm_ppc_fetch_registers (int regno)
   int reglen, beginreglen, endreglen;
 
 #if 1
-  for (i = 0; i < (FPLAST_REGNUM - FP0_REGNUM + 1); i++)
+  for (i = 0; i < ppc_num_fprs; i++)
     {
       midregs[i] = -1;
     }
@@ -202,7 +202,8 @@ bdm_ppc_fetch_registers (int regno)
       /* if asking for an invalid register */
       if ((first_regno == gdbarch_tdep (current_gdbarch)->ppc_mq_regnum)
           || (first_regno == gdbarch_tdep (current_gdbarch)->ppc_fpscr_regnum)
-         || ((first_regno >= FP0_REGNUM) && (first_regno <= FPLAST_REGNUM)))
+         || ((first_regno >= FP0_REGNUM)
+              && (first_regno < FP0_REGNUM + ppc_num_fprs)))
        {
 /*          printf("invalid reg request!\n"); */
          supply_register (first_regno, NULL);
@@ -221,7 +222,7 @@ bdm_ppc_fetch_registers (int regno)
       beginregs = ocd_read_bdm_registers (first_bdm_regno,
                                          FP0_REGNUM - 1, &beginreglen);
       endregs = (strcat (midregs,
-                        ocd_read_bdm_registers (FPLAST_REGNUM + 1,
+                        ocd_read_bdm_registers (FP0_REGNUM + ppc_num_fprs,
                                          last_bdm_regno - 1, &endreglen)));
       almostregs = (strcat (beginregs, endregs));
       regs = (strcat (almostregs, mqreg));
@@ -292,7 +293,7 @@ bdm_ppc_store_registers (int regno)
       /* (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)))
+          && ((i < FP0_REGNUM) || (i >= 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);
index b869ad0b2a2056838575330b9acb85edcff70a3d..a6ae600b8af062d5ac616b4e01c2ce1d1696e128 100644 (file)
@@ -138,7 +138,7 @@ ppc_register_u_addr (int regno)
   /* Floating point regs: eight bytes each in both 32- and 64-bit
      ptrace interfaces.  Thus, two slots each in 32-bit interface, one
      slot each in 64-bit interface.  */
-  if (regno >= FP0_REGNUM && regno <= FPLAST_REGNUM)
+  if (regno >= FP0_REGNUM && regno < FP0_REGNUM + ppc_num_fprs)
     u_addr = (PT_FPR0 * wordsize) + ((regno - FP0_REGNUM) * 8);
 
   /* UISA special purpose registers: 1 slot each */
index 70465530452073070be0c4cd305bd5514995ac62..c8b4100ef2d5a9a443ab10c40b2e42a4cc442db3 100644 (file)
@@ -162,4 +162,11 @@ struct gdbarch_tdep
                                    link register is saved.  */
 };
 
+
+/* Constants for register set sizes.  */
+enum
+  {
+    ppc_num_fprs = 32           /* 32 floating-point registers */
+  };
+
 #endif
index 02bb2e2d414438fb9aac63e059379dd59e9b0b84..3d66e98294b9de36596de07d428b04e9b9007ef4 100644 (file)
@@ -158,7 +158,7 @@ regmap (int regno, int *isfloat)
   *isfloat = 0;
   if (tdep->ppc_gp0_regnum <= regno && regno <= tdep->ppc_gplast_regnum)
     return regno;
-  else if (FP0_REGNUM <= regno && regno <= FPLAST_REGNUM)
+  else if (FP0_REGNUM <= regno && regno < FP0_REGNUM + ppc_num_fprs)
     {
       *isfloat = 1;
       return regno - FP0_REGNUM + FPR0;
@@ -357,7 +357,7 @@ fetch_inferior_registers (int regno)
        }
 
       /* Read general purpose floating point registers.  */
-      for (regno = FP0_REGNUM; regno <= FPLAST_REGNUM; regno++)
+      for (regno = FP0_REGNUM; regno < FP0_REGNUM + ppc_num_fprs; regno++)
        fetch_register (regno);
 
       /* Read special registers.  */
@@ -396,7 +396,7 @@ store_inferior_registers (int regno)
        }
 
       /* Write floating point registers.  */
-      for (regno = FP0_REGNUM; regno <= FPLAST_REGNUM; regno++)
+      for (regno = FP0_REGNUM; regno < FP0_REGNUM + ppc_num_fprs; regno ++)
        store_register (regno);
 
       /* Write special registers.  */