Date: Thu, 29 May 2003 21:31:15 -0700 (PDT) From: Marcel Moolenaar <marcel@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 32092 for review Message-ID: <200305300431.h4U4VFv3098966@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=32092 Change 32092 by marcel@marcel_nfs on 2003/05/29 21:31:15 Rough (ie untested) implementation of get_mcontext() and set_mcontext(). The clear_ret parameter is ignored because return registers are scratch registers and they are not saved in the context. Affected files ... .. //depot/projects/ia64/sys/ia64/ia64/machdep.c#74 edit .. //depot/projects/ia64/sys/ia64/include/_regset.h#5 edit Differences ... ==== //depot/projects/ia64/sys/ia64/ia64/machdep.c#74 (text+ko) ==== @@ -1011,17 +1011,27 @@ #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); } /* ==== //depot/projects/ia64/sys/ia64/include/_regset.h#5 (text+ko) ==== @@ -169,9 +169,9 @@ }; #ifdef _KERNEL -void restore_callee_saved(struct _callee_saved *); -void restore_callee_saved_fp(struct _callee_saved_fp *); -void restore_high_fp(struct _high_fp *); +void restore_callee_saved(const struct _callee_saved *); +void restore_callee_saved_fp(const struct _callee_saved_fp *); +void restore_high_fp(const struct _high_fp *); void save_callee_saved(struct _callee_saved *); void save_callee_saved_fp(struct _callee_saved_fp *); void save_high_fp(struct _high_fp *);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200305300431.h4U4VFv3098966>