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));
|
2014-05-13 16:21:04 +02:00
|
|
|
m.m_lc_pm_mcontext.ctx = (vir_bytes)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));
|
2014-05-13 16:21:04 +02:00
|
|
|
m.m_lc_pm_mcontext.ctx = (vir_bytes)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
|
|
|
}
|
|
|
|
|