'ppc_gplast_regnum' member.
(ppc_num_gprs): New enum constant.
* ppc-linux-nat.c (ppc_register_u_addr): Use tdep->ppc_gp0_regnum
and ppc_num_gprs instead of tdep->ppc_gplast_regnum.
* rs6000-nat.c (regmap, fetch_inferior_registers,
store_inferior_registers): Same.
* rs6000-tdep.c (e500_pseudo_register_read)
(e500_pseudo_register_write): Same.
(rs6000_gdbarch_init): Don't initialize tdep->ppc_gplast_regnum.
2004-05-04 Jim Blandy <jimb@redhat.com>
+ * config/ppc-tdep.h (struct gdbarch_tdep): Delete
+ 'ppc_gplast_regnum' member.
+ (ppc_num_gprs): New enum constant.
+ * ppc-linux-nat.c (ppc_register_u_addr): Use tdep->ppc_gp0_regnum
+ and ppc_num_gprs instead of tdep->ppc_gplast_regnum.
+ * rs6000-nat.c (regmap, fetch_inferior_registers,
+ store_inferior_registers): Same.
+ * rs6000-tdep.c (e500_pseudo_register_read)
+ (e500_pseudo_register_write): Same.
+ (rs6000_gdbarch_init): Don't initialize tdep->ppc_gplast_regnum.
+
* 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,
int wordsize = sizeof (PTRACE_XFER_TYPE);
/* General purpose registers occupy 1 slot each in the buffer */
- if (regno >= tdep->ppc_gp0_regnum && regno <= tdep->ppc_gplast_regnum )
+ if (regno >= tdep->ppc_gp0_regnum
+ && regno < tdep->ppc_gp0_regnum + ppc_num_gprs)
u_addr = ((regno - tdep->ppc_gp0_regnum + PT_R0) * wordsize);
/* Floating point regs: eight bytes each in both 32- and 64-bit
int *regoff; /* byte offsets in register arrays */
const struct reg *regs; /* from current variant */
int ppc_gp0_regnum; /* GPR register 0 */
- int ppc_gplast_regnum; /* GPR register 31 */
int ppc_toc_regnum; /* TOC register */
int ppc_ps_regnum; /* Processor (or machine) status (%msr) */
int ppc_cr_regnum; /* Condition register */
/* Constants for register set sizes. */
enum
{
+ ppc_num_gprs = 32, /* 32 general-purpose registers */
ppc_num_fprs = 32 /* 32 floating-point registers */
};
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
*isfloat = 0;
- if (tdep->ppc_gp0_regnum <= regno && regno <= tdep->ppc_gplast_regnum)
+ if (tdep->ppc_gp0_regnum <= regno
+ && regno < tdep->ppc_gp0_regnum + ppc_num_gprs)
return regno;
else if (FP0_REGNUM <= regno && regno < FP0_REGNUM + ppc_num_fprs)
{
/* Read 32 general purpose registers. */
for (regno = tdep->ppc_gp0_regnum;
- regno <= tdep->ppc_gplast_regnum;
+ regno < tdep->ppc_gp0_regnum + ppc_num_gprs;
regno++)
{
fetch_register (regno);
/* Write general purpose registers first. */
for (regno = tdep->ppc_gp0_regnum;
- regno <= tdep->ppc_gplast_regnum;
+ regno < tdep->ppc_gp0_regnum + ppc_num_gprs;
regno++)
{
store_register (regno);
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (reg_nr >= tdep->ppc_gp0_regnum
- && reg_nr <= tdep->ppc_gplast_regnum)
+ && reg_nr < tdep->ppc_gp0_regnum + ppc_num_gprs)
{
base_regnum = reg_nr - tdep->ppc_gp0_regnum + tdep->ppc_ev0_regnum;
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (reg_nr >= tdep->ppc_gp0_regnum
- && reg_nr <= tdep->ppc_gplast_regnum)
+ && reg_nr < tdep->ppc_gp0_regnum + ppc_num_gprs)
{
base_regnum = reg_nr - tdep->ppc_gp0_regnum + tdep->ppc_ev0_regnum;
/* reg_nr is 32 bit here, and base_regnum is 64 bits. */
tdep->regs = v->regs;
tdep->ppc_gp0_regnum = 0;
- tdep->ppc_gplast_regnum = 31;
tdep->ppc_toc_regnum = 2;
tdep->ppc_ps_regnum = 65;
tdep->ppc_cr_regnum = 66;
break;
case bfd_mach_ppc_e500:
tdep->ppc_gp0_regnum = 41;
- tdep->ppc_gplast_regnum = tdep->ppc_gp0_regnum + 32 - 1;
tdep->ppc_toc_regnum = -1;
tdep->ppc_ps_regnum = 1;
tdep->ppc_cr_regnum = 2;