diff options
author | marcel <marcel@FreeBSD.org> | 2003-06-01 23:22:56 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2003-06-01 23:22:56 +0000 |
commit | 6f0fa0f8a5db2321a200026af15a3113cd978c0a (patch) | |
tree | 8415441d5cd47655a09368c2548a11d796da3de7 | |
parent | 617972a65888aa53fdd1cd737ddf1f4a28c80abd (diff) | |
download | FreeBSD-src-6f0fa0f8a5db2321a200026af15a3113cd978c0a.zip FreeBSD-src-6f0fa0f8a5db2321a200026af15a3113cd978c0a.tar.gz |
Improve set_mcontext:
o Don't copy psr verbatim from the user supplied context. Only allow
userland to change the processor settings that are part of the user
mask.
-rw-r--r-- | sys/ia64/ia64/machdep.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/ia64/ia64/machdep.c b/sys/ia64/ia64/machdep.c index 982f746..49015b5 100644 --- a/sys/ia64/ia64/machdep.c +++ b/sys/ia64/ia64/machdep.c @@ -1023,9 +1023,14 @@ int set_mcontext(struct thread *td, const mcontext_t *mc) { struct trapframe *tf; + uint64_t psr; tf = td->td_frame; + /* Only copy the user mask from the new context. */ + psr = tf->tf_special.psr & ~0x1f; + psr |= mc->mc_special.psr & 0x1f; tf->tf_special = mc->mc_special; + tf->tf_special.psr = psr; restore_callee_saved(&mc->mc_preserved); restore_callee_saved_fp(&mc->mc_preserved_fp); return (0); |