diff options
author | Jim Blandy <jimb@codesourcery.com> | 2004-05-05 01:46:55 +0000 |
---|---|---|
committer | Jim Blandy <jimb@codesourcery.com> | 2004-05-05 01:46:55 +0000 |
commit | 366f009f23b0e5fc1668d1f728b4cda533df5cb5 (patch) | |
tree | 6a4f33eea5a1504c1169b4f9e7d0f7bff0dca852 /gdb/aix-thread.c | |
parent | e792b4ce88267ea6d1fc66defae56f8dc8d4c05d (diff) | |
download | gdb-366f009f23b0e5fc1668d1f728b4cda533df5cb5.zip gdb-366f009f23b0e5fc1668d1f728b4cda533df5cb5.tar.gz gdb-366f009f23b0e5fc1668d1f728b4cda533df5cb5.tar.bz2 |
* 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/aix-thread.c')
-rw-r--r-- | gdb/aix-thread.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c index 89a0755..36174b4 100644 --- a/gdb/aix-thread.c +++ b/gdb/aix-thread.c @@ -1020,10 +1020,11 @@ supply_reg32 (int regno, uint32_t val) static void supply_fprs (double *vals) { + struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); int regno; for (regno = 0; regno < 32; regno++) - supply_register (regno + FP0_REGNUM, (char *) (vals + regno)); + supply_register (regno + tdep->ppc_fp0_regnum, (char *) (vals + regno)); } /* Predicate to test whether given register number is a "special" register. */ @@ -1142,6 +1143,7 @@ fetch_regs_user_thread (pthdb_pthread_t pdtid) static void fetch_regs_kernel_thread (int regno, pthdb_tid_t tid) { + struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); uint64_t gprs64[32]; uint32_t gprs32[32]; double fprs[32]; @@ -1155,7 +1157,7 @@ fetch_regs_kernel_thread (int regno, pthdb_tid_t tid) (long) tid, regno, arch64); /* General-purpose registers. */ - if (regno == -1 || regno < FP0_REGNUM) + if (regno == -1 || regno < tdep->ppc_fp0_regnum) { if (arch64) { @@ -1176,8 +1178,8 @@ fetch_regs_kernel_thread (int regno, pthdb_tid_t tid) /* Floating-point registers. */ if (regno == -1 - || (regno >= FP0_REGNUM - && regno < FP0_REGNUM + ppc_num_fprs)) + || (regno >= tdep->ppc_fp0_regnum + && regno < tdep->ppc_fp0_regnum + ppc_num_fprs)) { if (!ptrace32 (PTT_READ_FPRS, tid, (int *) fprs, 0, NULL)) memset (fprs, 0, sizeof (fprs)); @@ -1241,9 +1243,10 @@ aix_thread_fetch_registers (int regno) static void fill_gprs64 (uint64_t *vals) { + struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); int regno; - for (regno = 0; regno < FP0_REGNUM; regno++) + for (regno = 0; regno < tdep->ppc_fp0_regnum; regno++) if (register_cached (regno)) regcache_collect (regno, vals + regno); } @@ -1251,9 +1254,10 @@ fill_gprs64 (uint64_t *vals) static void fill_gprs32 (uint32_t *vals) { + struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); int regno; - for (regno = 0; regno < FP0_REGNUM; regno++) + for (regno = 0; regno < tdep->ppc_fp0_regnum; regno++) if (register_cached (regno)) regcache_collect (regno, vals + regno); } @@ -1262,9 +1266,12 @@ fill_gprs32 (uint32_t *vals) static void fill_fprs (double *vals) { + struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); int regno; - for (regno = FP0_REGNUM; regno < FP0_REGNUM + ppc_num_fprs; regno++) + for (regno = tdep->ppc_fp0_regnum; + regno < tdep->ppc_fp0_regnum + ppc_num_fprs; + regno++) if (register_cached (regno)) regcache_collect (regno, vals + regno); } @@ -1434,6 +1441,7 @@ store_regs_user_thread (pthdb_pthread_t pdtid) static void store_regs_kernel_thread (int regno, pthdb_tid_t tid) { + struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); uint64_t gprs64[32]; uint32_t gprs32[32]; double fprs[32]; @@ -1448,7 +1456,7 @@ store_regs_kernel_thread (int regno, pthdb_tid_t tid) (long) tid, regno); /* General-purpose registers. */ - if (regno == -1 || regno < FP0_REGNUM) + if (regno == -1 || regno < tdep->ppc_fp0_regnum) { if (arch64) { @@ -1469,8 +1477,8 @@ store_regs_kernel_thread (int regno, pthdb_tid_t tid) /* Floating-point registers. */ if (regno == -1 - || (regno >= FP0_REGNUM - && regno < FP0_REGNUM + ppc_num_fprs)) + || (regno >= tdep->ppc_fp0_regnum + && regno < tdep->ppc_fp0_regnum + ppc_num_fprs)) { /* Pre-fetch: some regs may not be in the cache. */ ptrace32 (PTT_READ_FPRS, tid, (int *) fprs, 0, NULL); |