diff options
author | marcel <marcel@FreeBSD.org> | 2003-11-11 09:53:37 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2003-11-11 09:53:37 +0000 |
commit | 12457aa8886ce520aa0a7ac0e9a18baba9f27059 (patch) | |
tree | dc1fa041cb5acbe45730641c4d05f48cbbd361c3 /sys/ia64 | |
parent | b097722b0b8b7526323295c61ff6c1b1c4d83b58 (diff) | |
download | FreeBSD-src-12457aa8886ce520aa0a7ac0e9a18baba9f27059.zip FreeBSD-src-12457aa8886ce520aa0a7ac0e9a18baba9f27059.tar.gz |
Save and restore the high FP registers in {g|s}_mcontext(). Note
that we currently do not keep track of whether the thread has
actually used the high FP registers before. If not, we should
not save them in the context which automaticly means that we
also would not restore them from the context. For now, do it
unconditionally so that we can reach functional completeness.
Diffstat (limited to 'sys/ia64')
-rw-r--r-- | sys/ia64/ia64/machdep.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/ia64/ia64/machdep.c b/sys/ia64/ia64/machdep.c index 9f6ef66..e17a02c 100644 --- a/sys/ia64/ia64/machdep.c +++ b/sys/ia64/ia64/machdep.c @@ -1085,7 +1085,13 @@ get_mcontext(struct thread *td, mcontext_t *mc, int flags) mc->mc_flags |= _MC_FLAGS_ASYNC_CONTEXT; mc->mc_scratch = tf->tf_scratch; mc->mc_scratch_fp = tf->tf_scratch_fp; - /* XXX High FP */ + /* + * XXX If the thread never used the high FP registers, we + * probably shouldn't waste time saving them. + */ + ia64_highfp_save(td); + mc->mc_flags |= _MC_FLAGS_HIGHFP_VALID; + mc->mc_high_fp = td->td_pcb->pcb_high_fp; } save_callee_saved(&mc->mc_preserved); save_callee_saved_fp(&mc->mc_preserved_fp); @@ -1126,7 +1132,8 @@ set_mcontext(struct thread *td, const mcontext_t *mc) KASSERT(tf->tf_scratch.gr15 == SYS_sigreturn, ("foo")); tf->tf_scratch = mc->mc_scratch; tf->tf_scratch_fp = mc->mc_scratch_fp; - /* XXX High FP */ + if (mc->mc_flags & _MC_FLAGS_HIGHFP_VALID) + td->td_pcb->pcb_high_fp = mc->mc_high_fp; } else { KASSERT((tf->tf_flags & FRAME_SYSCALL) != 0, ("foo")); if ((mc->mc_flags & _MC_FLAGS_SCRATCH_VALID) == 0) { |