xref: /minix3/minix/lib/libsys/sys_mcontext.c (revision 433d6423c39e34ec4b79c950597bb2d236f886be)
1*433d6423SLionel Sambuc #include "syslib.h"
2*433d6423SLionel Sambuc 
sys_getmcontext(proc,mcp)3*433d6423SLionel Sambuc int sys_getmcontext(proc, mcp)
4*433d6423SLionel Sambuc endpoint_t proc;		/* process retrieving context */
5*433d6423SLionel Sambuc vir_bytes mcp;			/* where to store context */
6*433d6423SLionel Sambuc {
7*433d6423SLionel Sambuc /* A process wants to store its context in mcp. */
8*433d6423SLionel Sambuc 
9*433d6423SLionel Sambuc   message m;
10*433d6423SLionel Sambuc   int r;
11*433d6423SLionel Sambuc 
12*433d6423SLionel Sambuc   m.m_lsys_krn_sys_getmcontext.endpt = proc;
13*433d6423SLionel Sambuc   m.m_lsys_krn_sys_getmcontext.ctx_ptr = mcp;
14*433d6423SLionel Sambuc   r = _kernel_call(SYS_GETMCONTEXT, &m);
15*433d6423SLionel Sambuc   return r;
16*433d6423SLionel Sambuc }
17*433d6423SLionel Sambuc 
sys_setmcontext(proc,mcp)18*433d6423SLionel Sambuc int sys_setmcontext(proc, mcp)
19*433d6423SLionel Sambuc endpoint_t proc;		/* process setting context */
20*433d6423SLionel Sambuc vir_bytes mcp;			/* where to get context from */
21*433d6423SLionel Sambuc {
22*433d6423SLionel Sambuc /* A process wants to restore context stored in ucp. */
23*433d6423SLionel Sambuc 
24*433d6423SLionel Sambuc   message m;
25*433d6423SLionel Sambuc   int r;
26*433d6423SLionel Sambuc 
27*433d6423SLionel Sambuc   m.m_lsys_krn_sys_setmcontext.endpt = proc;
28*433d6423SLionel Sambuc   m.m_lsys_krn_sys_setmcontext.ctx_ptr = mcp;
29*433d6423SLionel Sambuc   r = _kernel_call(SYS_SETMCONTEXT, &m);
30*433d6423SLionel Sambuc   return r;
31*433d6423SLionel Sambuc }
32*433d6423SLionel Sambuc 
33