This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RFA: RS6000: remove FPLAST_REGNUM


2004-05-03  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.

Index: gdb/config/rs6000/tm-rs6000.h
===================================================================
RCS file: /cvs/src/src/gdb/config/rs6000/tm-rs6000.h,v
retrieving revision 1.30
diff -c -r1.30 tm-rs6000.h
*** gdb/config/rs6000/tm-rs6000.h	1 Mar 2004 00:50:56 -0000	1.30
--- gdb/config/rs6000/tm-rs6000.h	3 May 2004 21:08:45 -0000
***************
*** 72,78 ****
     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. */
  
--- 72,77 ----
Index: gdb/ppc-tdep.h
===================================================================
RCS file: /cvs/src/src/gdb/ppc-tdep.h,v
retrieving revision 1.28
diff -c -r1.28 ppc-tdep.h
*** gdb/ppc-tdep.h	22 Apr 2004 21:13:06 -0000	1.28
--- gdb/ppc-tdep.h	3 May 2004 21:08:44 -0000
***************
*** 162,165 ****
--- 162,172 ----
                                     link register is saved.  */
  };
  
+ 
+ /* Constants for register set sizes.  */
+ enum
+   {
+     ppc_num_fprs = 32           /* 32 floating-point registers */
+   };
+ 
  #endif
Index: gdb/aix-thread.c
===================================================================
RCS file: /cvs/src/src/gdb/aix-thread.c,v
retrieving revision 1.16
diff -c -r1.16 aix-thread.c
*** gdb/aix-thread.c	21 Apr 2004 23:52:19 -0000	1.16
--- gdb/aix-thread.c	3 May 2004 21:08:38 -0000
***************
*** 1175,1181 ****
  
    /* Floating-point registers.  */
  
!   if (regno == -1 || (regno >= FP0_REGNUM && regno <= FPLAST_REGNUM))
      {
        if (!ptrace32 (PTT_READ_FPRS, tid, (int *) fprs, 0, NULL))
  	memset (fprs, 0, sizeof (fprs));
--- 1175,1183 ----
  
    /* Floating-point registers.  */
  
!   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,1268 ****
  {
    int regno;
  
!   for (regno = FP0_REGNUM; regno < FPLAST_REGNUM; regno++)
      if (register_cached (regno))
        regcache_collect (regno, vals + regno);
  }
--- 1264,1270 ----
  {
    int regno;
  
!   for (regno = FP0_REGNUM; regno < FP0_REGNUM + ppc_num_fprs; regno++)
      if (register_cached (regno))
        regcache_collect (regno, vals + regno);
  }
***************
*** 1466,1472 ****
  
    /* Floating-point registers.  */
  
!   if (regno == -1 || (regno >= FP0_REGNUM && regno <= FPLAST_REGNUM))
      {
        /* Pre-fetch: some regs may not be in the cache.  */
        ptrace32 (PTT_READ_FPRS, tid, (int *) fprs, 0, NULL);
--- 1468,1476 ----
  
    /* Floating-point registers.  */
  
!   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: gdb/ppc-bdm.c
===================================================================
RCS file: /cvs/src/src/gdb/ppc-bdm.c,v
retrieving revision 1.18
diff -c -r1.18 ppc-bdm.c
*** gdb/ppc-bdm.c	17 Sep 2003 14:24:30 -0000	1.18
--- gdb/ppc-bdm.c	3 May 2004 21:08:43 -0000
***************
*** 162,168 ****
    int reglen, beginreglen, endreglen;
  
  #if 1
!   for (i = 0; i < (FPLAST_REGNUM - FP0_REGNUM + 1); i++)
      {
        midregs[i] = -1;
      }
--- 162,168 ----
    int reglen, beginreglen, endreglen;
  
  #if 1
!   for (i = 0; i < ppc_num_fprs; i++)
      {
        midregs[i] = -1;
      }
***************
*** 202,208 ****
        /* 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)))
  	{
  /*          printf("invalid reg request!\n"); */
  	  supply_register (first_regno, NULL);
--- 202,209 ----
        /* 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 < FP0_REGNUM + ppc_num_fprs)))
  	{
  /*          printf("invalid reg request!\n"); */
  	  supply_register (first_regno, NULL);
***************
*** 221,227 ****
        beginregs = ocd_read_bdm_registers (first_bdm_regno,
  					  FP0_REGNUM - 1, &beginreglen);
        endregs = (strcat (midregs,
! 			 ocd_read_bdm_registers (FPLAST_REGNUM + 1,
  					  last_bdm_regno - 1, &endreglen)));
        almostregs = (strcat (beginregs, endregs));
        regs = (strcat (almostregs, mqreg));
--- 222,228 ----
        beginregs = ocd_read_bdm_registers (first_bdm_regno,
  					  FP0_REGNUM - 1, &beginreglen);
        endregs = (strcat (midregs,
! 			 ocd_read_bdm_registers (FP0_REGNUM + ppc_num_fprs,
  					  last_bdm_regno - 1, &endreglen)));
        almostregs = (strcat (beginregs, endregs));
        regs = (strcat (almostregs, mqreg));
***************
*** 292,298 ****
        /* (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);
--- 293,299 ----
        /* (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 >= 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: gdb/ppc-linux-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/ppc-linux-nat.c,v
retrieving revision 1.30
diff -c -r1.30 ppc-linux-nat.c
*** gdb/ppc-linux-nat.c	22 Apr 2004 08:37:06 -0000	1.30
--- gdb/ppc-linux-nat.c	3 May 2004 21:08:44 -0000
***************
*** 138,144 ****
    /* 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)
      u_addr = (PT_FPR0 * wordsize) + ((regno - FP0_REGNUM) * 8);
  
    /* UISA special purpose registers: 1 slot each */
--- 138,144 ----
    /* 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 < FP0_REGNUM + ppc_num_fprs)
      u_addr = (PT_FPR0 * wordsize) + ((regno - FP0_REGNUM) * 8);
  
    /* UISA special purpose registers: 1 slot each */
Index: gdb/rs6000-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-nat.c,v
retrieving revision 1.40
diff -c -r1.40 rs6000-nat.c
*** gdb/rs6000-nat.c	21 Apr 2004 23:52:20 -0000	1.40
--- gdb/rs6000-nat.c	3 May 2004 21:08:45 -0000
***************
*** 158,164 ****
    *isfloat = 0;
    if (tdep->ppc_gp0_regnum <= regno && regno <= tdep->ppc_gplast_regnum)
      return regno;
!   else if (FP0_REGNUM <= regno && regno <= FPLAST_REGNUM)
      {
        *isfloat = 1;
        return regno - FP0_REGNUM + FPR0;
--- 158,164 ----
    *isfloat = 0;
    if (tdep->ppc_gp0_regnum <= regno && regno <= tdep->ppc_gplast_regnum)
      return regno;
!   else if (FP0_REGNUM <= regno && regno < FP0_REGNUM + ppc_num_fprs)
      {
        *isfloat = 1;
        return regno - FP0_REGNUM + FPR0;
***************
*** 357,363 ****
  	}
  
        /* Read general purpose floating point registers.  */
!       for (regno = FP0_REGNUM; regno <= FPLAST_REGNUM; regno++)
  	fetch_register (regno);
  
        /* Read special registers.  */
--- 357,363 ----
  	}
  
        /* Read general purpose floating point registers.  */
!       for (regno = FP0_REGNUM; regno < FP0_REGNUM + ppc_num_fprs; regno++)
  	fetch_register (regno);
  
        /* Read special registers.  */
***************
*** 396,402 ****
  	}
  
        /* Write floating point registers.  */
!       for (regno = FP0_REGNUM; regno <= FPLAST_REGNUM; regno++)
  	store_register (regno);
  
        /* Write special registers.  */
--- 396,402 ----
  	}
  
        /* Write floating point registers.  */
!       for (regno = FP0_REGNUM; regno < FP0_REGNUM + ppc_num_fprs; regno ++)
  	store_register (regno);
  
        /* Write special registers.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]