diff options
author | marcel <marcel@FreeBSD.org> | 2003-05-31 21:07:08 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2003-05-31 21:07:08 +0000 |
commit | bf7c437f6811262c6b3b3ef4262a57b3c29f9fc8 (patch) | |
tree | 1a69b8b0850571ce78982f887548dfd41ab8efad | |
parent | b8e383ac78d433ff7d1ebfed1199723e6b20ba80 (diff) | |
download | FreeBSD-src-bf7c437f6811262c6b3b3ef4262a57b3c29f9fc8.zip FreeBSD-src-bf7c437f6811262c6b3b3ef4262a57b3c29f9fc8.tar.gz |
Implement set_mcontext() and get_mcontext(). Just as for sendsig() and
sigreturn(), we cheat and assume the preserved registers are still
on-chip and unmodified. This is actually the case, but more by accident
than by design. We need to use unwinding eventually or explicitly
compile the kernel in a way that the compiler steers clear from using
the preserved registers completely.
-rw-r--r-- | sys/ia64/ia64/machdep.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/sys/ia64/ia64/machdep.c b/sys/ia64/ia64/machdep.c index 9ff50d4..982f746 100644 --- a/sys/ia64/ia64/machdep.c +++ b/sys/ia64/ia64/machdep.c @@ -1008,17 +1008,27 @@ freebsd4_sigreturn(struct thread *td, struct freebsd4_sigreturn_args *uap) #endif int -get_mcontext(struct thread *td, mcontext_t *mcp, int clear_ret) +get_mcontext(struct thread *td, mcontext_t *mc, int clear_ret) { + struct trapframe *tf; - return (ENOSYS); + tf = td->td_frame; + mc->mc_special = tf->tf_special; + save_callee_saved(&mc->mc_preserved); + save_callee_saved_fp(&mc->mc_preserved_fp); + return (0); } int -set_mcontext(struct thread *td, const mcontext_t *mcp) +set_mcontext(struct thread *td, const mcontext_t *mc) { + struct trapframe *tf; - return (ENOSYS); + tf = td->td_frame; + tf->tf_special = mc->mc_special; + restore_callee_saved(&mc->mc_preserved); + restore_callee_saved_fp(&mc->mc_preserved_fp); + return (0); } /* |