PERFORCE change 32092 for review
Marcel Moolenaar
marcel at FreeBSD.org
Thu May 29 21:31:18 PDT 2003
http://perforce.freebsd.org/chv.cgi?CH=32092
Change 32092 by marcel at 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 *);
More information about the p4-projects
mailing list