diff options
author | Marcel Moolenaar <marcel@FreeBSD.org> | 2007-05-01 18:28:08 +0000 |
---|---|---|
committer | Marcel Moolenaar <marcel@FreeBSD.org> | 2007-05-01 18:28:08 +0000 |
commit | 85999a0155e389415cc476110fd5614baf543a55 (patch) | |
tree | 1e6acdf8d74f93b1b40a618c11842b2fd1a84924 /lib/libthread_db/arch/powerpc/libpthread_md.c | |
parent | 1e7d5fbfb00bcd1963d7a5f5bceab1d93849cfdb (diff) |
Roughly implement libpthread support.
Notes
Notes:
svn path=/head/; revision=169187
Diffstat (limited to 'lib/libthread_db/arch/powerpc/libpthread_md.c')
-rw-r--r-- | lib/libthread_db/arch/powerpc/libpthread_md.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/libthread_db/arch/powerpc/libpthread_md.c b/lib/libthread_db/arch/powerpc/libpthread_md.c index 0789182c3c3b..a8a95bd7aa48 100644 --- a/lib/libthread_db/arch/powerpc/libpthread_md.c +++ b/lib/libthread_db/arch/powerpc/libpthread_md.c @@ -37,21 +37,37 @@ __FBSDID("$FreeBSD$"); void pt_reg_to_ucontext(const struct reg *r, ucontext_t *uc) { + mcontext_t *mc = &uc->uc_mcontext; + + memcpy(mc->mc_frame, r, MIN(sizeof(mc->mc_frame), sizeof(*r))); } void pt_ucontext_to_reg(const ucontext_t *uc, struct reg *r) { + const mcontext_t *mc = &uc->uc_mcontext; + + memcpy(r, mc->mc_frame, MIN(sizeof(mc->mc_frame), sizeof(*r))); } void -pt_fpreg_to_ucontext(const struct fpreg* r, ucontext_t *uc) +pt_fpreg_to_ucontext(const struct fpreg *r, ucontext_t *uc) { + mcontext_t *mc = &uc->uc_mcontext; + + memcpy(mc->mc_fpreg, r, MIN(sizeof(mc->mc_fpreg), sizeof(*r))); + mc->mc_flags |= _MC_FP_VALID; } void pt_ucontext_to_fpreg(const ucontext_t *uc, struct fpreg *r) { + const mcontext_t *mc = &uc->uc_mcontext; + + if (mc->mc_flags & _MC_FP_VALID) + memcpy(r, mc->mc_fpreg, MIN(sizeof(mc->mc_fpreg), sizeof(*r))); + else + memset(r, 0, sizeof(*r)); } void @@ -62,4 +78,6 @@ pt_md_init(void) int pt_reg_sstep(struct reg *reg, int step) { + + /* XXX */ } |