2011-02-17 18:11:09 +01:00
|
|
|
/*
|
|
|
|
* mcontext.c
|
|
|
|
*/
|
|
|
|
#include <sys/cdefs.h>
|
|
|
|
#include <lib.h>
|
|
|
|
#include <namespace.h>
|
|
|
|
|
2013-11-04 22:48:08 +01:00
|
|
|
#include <string.h>
|
2011-02-17 18:11:09 +01:00
|
|
|
#include <ucontext.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
2012-03-25 20:25:53 +02:00
|
|
|
int setmcontext(const mcontext_t *mcp)
|
2011-02-17 18:11:09 +01:00
|
|
|
{
|
|
|
|
message m;
|
|
|
|
|
2013-11-04 22:48:08 +01:00
|
|
|
memset(&m, 0, sizeof(m));
|
|
|
|
m.PM_MCONTEXT_CTX = (char *) __UNCONST(mcp);
|
2011-02-17 18:11:09 +01:00
|
|
|
|
2013-11-04 22:48:08 +01:00
|
|
|
return(_syscall(PM_PROC_NR, PM_SETMCONTEXT, &m));
|
2011-02-17 18:11:09 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-03-25 20:25:53 +02:00
|
|
|
int getmcontext(mcontext_t *mcp)
|
2011-02-17 18:11:09 +01:00
|
|
|
{
|
|
|
|
message m;
|
|
|
|
|
2013-11-04 22:48:08 +01:00
|
|
|
memset(&m, 0, sizeof(m));
|
|
|
|
m.PM_MCONTEXT_CTX = (char *) mcp;
|
2011-02-17 18:11:09 +01:00
|
|
|
|
2013-11-04 22:48:08 +01:00
|
|
|
return(_syscall(PM_PROC_NR, PM_GETMCONTEXT, &m));
|
2011-02-17 18:11:09 +01:00
|
|
|
}
|
|
|
|
|