aboutsummaryrefslogtreecommitdiff
path: root/gdb/ppc-linux-nat.c
diff options
context:
space:
mode:
authorKevin Buettner <kevinb@redhat.com>2000-09-18 01:08:24 +0000
committerKevin Buettner <kevinb@redhat.com>2000-09-18 01:08:24 +0000
commitfdb28ac40143fc026508662a4df94a2582e6bf99 (patch)
treef20f8ca483a6e96883b00c0b6f119446dd4beca7 /gdb/ppc-linux-nat.c
parentafd64b4e2d76f981f6828f9f55fcc03784d6915b (diff)
downloadgdb-fdb28ac40143fc026508662a4df94a2582e6bf99.zip
gdb-fdb28ac40143fc026508662a4df94a2582e6bf99.tar.gz
gdb-fdb28ac40143fc026508662a4df94a2582e6bf99.tar.bz2
Enable Mark Kettenis' linux thread support for Linux/PPC.
Diffstat (limited to 'gdb/ppc-linux-nat.c')
-rw-r--r--gdb/ppc-linux-nat.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
index e37aef9..7388254 100644
--- a/gdb/ppc-linux-nat.c
+++ b/gdb/ppc-linux-nat.c
@@ -71,6 +71,28 @@ supply_gregset (gregset_t * gregsetp)
}
void
+fill_gregset (gregset_t *gregsetp, int regno)
+{
+ int regi;
+ greg_t *regp = (greg_t *) gregsetp;
+
+#define COPY_REG(_idx_,_regi_) \
+ if ((regno == -1) || regno == _regi_) \
+ memcpy (regp + _idx_, &registers[REGISTER_BYTE (_regi_)], \
+ REGISTER_RAW_SIZE (_regi_))
+
+ for (regi = 0; regi < 32; regi++)
+ {
+ COPY_REG (regmap[regi], regi);
+ }
+
+ for (regi = FIRST_UISA_SP_REGNUM; regi <= LAST_UISA_SP_REGNUM; regi++)
+ {
+ COPY_REG (regmap[regi], regi);
+ }
+}
+
+void
supply_fpregset (fpregset_t * fpregsetp)
{
int regi;
@@ -79,3 +101,26 @@ supply_fpregset (fpregset_t * fpregsetp)
supply_register (FP0_REGNUM + regi, (char *) (*fpregsetp + regi));
}
}
+
+/* Given a pointer to a floating point register set in /proc format
+ (fpregset_t *), update the register specified by REGNO from gdb's idea
+ of the current floating point register set. If REGNO is -1, update
+ them all. */
+
+void
+fill_fpregset (fpregset_t *fpregsetp, int regno)
+{
+ int regi;
+ char *to;
+ char *from;
+
+ for (regi = 0; regi < 32; regi++)
+ {
+ if ((regno == -1) || (regno == FP0_REGNUM + regi))
+ {
+ from = (char *) &registers[REGISTER_BYTE (FP0_REGNUM + regi)];
+ to = (char *) (*fpregsetp + regi);
+ memcpy (to, from, REGISTER_RAW_SIZE (FP0_REGNUM + regi));
+ }
+ }
+}