summaryrefslogtreecommitdiff
path: root/gdb/rs6000-tdep.c
diff options
context:
space:
mode:
authorJim Blandy <jimb@codesourcery.com>2004-05-05 01:46:55 +0000
committerJim Blandy <jimb@codesourcery.com>2004-05-05 01:46:55 +0000
commit85d7eb8bf0b82c4660c2a2b931841410878dd783 (patch)
treea61f1fb50e979d352711d888604edf447b7e3093 /gdb/rs6000-tdep.c
parentdde3424cec40ccb548ad1ddedf6f0eb77c1ebae3 (diff)
downloadgdb-85d7eb8bf0b82c4660c2a2b931841410878dd783.tar.gz
* config/rs6000/tm-rs6000.h (FP0_REGNUM): Document that this
should no longer be used in code specific to the RS6000 and its derivatives. * ppc-tdep.h (struct gdbarch_tdep): Add 'ppc_fp0_regnum' member. * rs6000-tdep.c (rs6000_gdbarch_init): Initialize tdep->ppc_fp0_regnum. (ppc_supply_fpregset, ppc_collect_fpregset) (rs6000_push_dummy_call, rs6000_extract_return_value) (rs6000_dwarf2_stab_reg_to_regnum, rs6000_store_return_value) (rs6000_frame_cache): Use tdep->ppc_fp0_regnum instead of FP0_REGNUM. * aix-thread.c (supply_fprs, fetch_regs_kernel_thread) (fill_gprs64, fill_gprs32, fill_fprs, store_regs_kernel_thread): Same. * ppc-bdm.c (bdm_ppc_fetch_registers, bdm_ppc_fetch_registers, bdm_ppc_store_registers): Same. * ppc-linux-nat.c (ppc_register_u_addr, fetch_register) (store_register, fill_fpregset): Same. * ppc-linux-tdep.c (ppc_linux_sigtramp_cache) (ppc_linux_supply_fpregset): Same. * ppcnbsd-nat.c (getfpregs_supplies): Same. * ppcnbsd-tdep.c (ppcnbsd_supply_fpreg, ppcnbsd_fill_fpreg): Same. * ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call, do_ppc_sysv_return_value, ppc64_sysv_abi_push_dummy_call, ppc64_sysv_abi_return_value): Same. * rs6000-nat.c (regmap, fetch_inferior_registers) (store_inferior_registers, fetch_core_registers): Same.
Diffstat (limited to 'gdb/rs6000-tdep.c')
-rw-r--r--gdb/rs6000-tdep.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index 8a78ff2ac60..bdc7e5e19ac 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -227,7 +227,9 @@ ppc_supply_fpregset (const struct regset *regset, struct regcache *regcache,
int i;
offset = offsets->f0_offset;
- for (i = FP0_REGNUM; i < FP0_REGNUM + 32; i++, offset += 4)
+ for (i = tdep->ppc_fp0_regnum;
+ i < tdep->ppc_fp0_regnum + ppc_num_fprs;
+ i++, offset += 4)
{
if (regnum == -1 || regnum == i)
ppc_supply_reg (regcache, i, fpregs, offset);
@@ -300,7 +302,9 @@ ppc_collect_fpregset (const struct regset *regset,
int i;
offset = offsets->f0_offset;
- for (i = FP0_REGNUM; i <= FP0_REGNUM + 32; i++, offset += 4)
+ for (i = tdep->ppc_fp0_regnum;
+ i <= tdep->ppc_fp0_regnum + ppc_num_fprs;
+ i++, offset += 4)
{
if (regnum == -1 || regnum == i)
ppc_collect_reg (regcache, regnum, fpregs, offset);
@@ -1239,7 +1243,8 @@ rs6000_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
printf_unfiltered (
"Fatal Error: a floating point parameter #%d with a size > 8 is found!\n", argno);
- memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM + 1 + f_argno)],
+ memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE
+ (tdep->ppc_fp0_regnum + 1 + f_argno)],
VALUE_CONTENTS (arg),
len);
++f_argno;
@@ -1352,7 +1357,9 @@ ran_out_of_registers_for_arguments:
printf_unfiltered (
"Fatal Error: a floating point parameter #%d with a size > 8 is found!\n", argno);
- memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM + 1 + f_argno)],
+ memcpy (&(deprecated_registers
+ [DEPRECATED_REGISTER_BYTE
+ (tdep->ppc_fp0_regnum + 1 + f_argno)]),
VALUE_CONTENTS (arg),
len);
++f_argno;
@@ -1417,7 +1424,7 @@ rs6000_extract_return_value (struct type *valtype, char *regbuf, char *valbuf)
necessary. */
convert_typed_floating (&regbuf[DEPRECATED_REGISTER_BYTE
- (FP0_REGNUM + 1)],
+ (tdep->ppc_fp0_regnum + 1)],
builtin_type_double,
valbuf,
valtype);
@@ -1720,7 +1727,7 @@ rs6000_dwarf2_stab_reg_to_regnum (int num)
if (0 <= num && num <= 31)
return tdep->ppc_gp0_regnum + num;
else if (32 <= num && num <= 63)
- return FP0_REGNUM + (num - 32);
+ return tdep->ppc_fp0_regnum + (num - 32);
else if (1200 <= num && num < 1200 + 32)
return tdep->ppc_ev0_regnum + (num - 1200);
else
@@ -1764,8 +1771,10 @@ rs6000_store_return_value (struct type *type, char *valbuf)
Say a double_double_double type could be returned in
FPR1/FPR2/FPR3 triple. */
- deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (FP0_REGNUM + 1), valbuf,
- TYPE_LENGTH (type));
+ deprecated_write_register_bytes
+ (DEPRECATED_REGISTER_BYTE (tdep->ppc_fp0_regnum + 1),
+ valbuf,
+ TYPE_LENGTH (type));
else if (TYPE_CODE (type) == TYPE_CODE_ARRAY)
{
if (TYPE_LENGTH (type) == 16
@@ -2438,7 +2447,7 @@ rs6000_frame_cache (struct frame_info *next_frame, void **this_cache)
CORE_ADDR fpr_addr = cache->base + fdata.fpr_offset;
for (i = fdata.saved_fpr; i < 32; i++)
{
- cache->saved_regs[FP0_REGNUM + i].addr = fpr_addr;
+ cache->saved_regs[tdep->ppc_fp0_regnum + i].addr = fpr_addr;
fpr_addr += 8;
}
}
@@ -2713,6 +2722,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
tdep->ppc_mq_regnum = 70;
else
tdep->ppc_mq_regnum = -1;
+ tdep->ppc_fp0_regnum = 32;
tdep->ppc_fpscr_regnum = power ? 71 : 70;
set_gdbarch_pc_regnum (gdbarch, 64);