2010-03-12 16:58:41 +01:00
|
|
|
#include "syslib.h"
|
|
|
|
|
2012-03-25 20:25:53 +02:00
|
|
|
int sys_getmcontext(proc, mcp)
|
2010-03-12 16:58:41 +01:00
|
|
|
endpoint_t proc; /* process retrieving context */
|
2014-05-13 16:21:04 +02:00
|
|
|
vir_bytes mcp; /* where to store context */
|
2010-03-12 16:58:41 +01:00
|
|
|
{
|
|
|
|
/* A process wants to store its context in mcp. */
|
|
|
|
|
|
|
|
message m;
|
|
|
|
int r;
|
|
|
|
|
|
|
|
m.PR_ENDPT = proc;
|
|
|
|
m.PR_CTX_PTR = (char *) mcp;
|
|
|
|
r = _kernel_call(SYS_GETMCONTEXT, &m);
|
|
|
|
return r;
|
|
|
|
}
|
|
|
|
|
2012-03-25 20:25:53 +02:00
|
|
|
int sys_setmcontext(proc, mcp)
|
2010-03-12 16:58:41 +01:00
|
|
|
endpoint_t proc; /* process setting context */
|
2014-05-13 16:21:04 +02:00
|
|
|
vir_bytes mcp; /* where to get context from */
|
2010-03-12 16:58:41 +01:00
|
|
|
{
|
|
|
|
/* A process wants to restore context stored in ucp. */
|
|
|
|
|
|
|
|
message m;
|
|
|
|
int r;
|
|
|
|
|
|
|
|
m.PR_ENDPT = proc;
|
|
|
|
m.PR_CTX_PTR = (char *) mcp;
|
|
|
|
r = _kernel_call(SYS_SETMCONTEXT, &m);
|
|
|
|
return r;
|
|
|
|
}
|
|
|
|
|