minix/lib/libsys/sys_mcontext.c
Thomas Veerman bef0e3eb63 - Add support for the ucontext system calls (getcontext, setcontext,
swapcontext, and makecontext).
- Fix VM to not erroneously think the stack segment and data segment have
  collided when a user-space thread invokes brk().
- Add test51 to test ucontext functionality.
- Add man pages for ucontext system calls.
2010-03-12 15:58:41 +00:00

32 lines
668 B
C

#include "syslib.h"
PUBLIC int sys_getmcontext(proc, mcp)
endpoint_t proc; /* process retrieving context */
mcontext_t *mcp; /* where to store context */
{
/* 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;
}
PUBLIC int sys_setmcontext(proc, mcp)
endpoint_t proc; /* process setting context */
mcontext_t *mcp; /* where to get context from */
{
/* 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;
}