mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 21:05:08 +00:00
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.
This commit is contained in:
parent
9d52656a5a
commit
a5ba2b5cc4
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=122480
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue