} mess_lsys_krn_sys_getinfo;
_ASSERT_MSG_SIZE(mess_lsys_krn_sys_getinfo);
+typedef struct {
+ endpoint_t endpt;
+ vir_bytes ctx_ptr;
+
+ uint8_t padding[48];
+} mess_lsys_krn_sys_getmcontext;
+_ASSERT_MSG_SIZE(mess_lsys_krn_sys_getmcontext);
+
typedef struct {
endpoint_t endpt;
int privflags;
} mess_lsys_krn_sys_setgrant;
_ASSERT_MSG_SIZE(mess_lsys_krn_sys_setgrant);
+typedef struct {
+ endpoint_t endpt;
+ vir_bytes ctx_ptr;
+
+ uint8_t padding[48];
+} mess_lsys_krn_sys_setmcontext;
+_ASSERT_MSG_SIZE(mess_lsys_krn_sys_setmcontext);
+
typedef struct {
int request;
mess_lsys_krn_sys_abort m_lsys_krn_sys_abort;
mess_lsys_krn_sys_copy m_lsys_krn_sys_copy;
mess_lsys_krn_sys_getinfo m_lsys_krn_sys_getinfo;
+ mess_lsys_krn_sys_getmcontext m_lsys_krn_sys_getmcontext;
mess_lsys_krn_sys_iopenable m_lsys_krn_sys_iopenable;
mess_lsys_krn_sys_irqctl m_lsys_krn_sys_irqctl;
mess_lsys_krn_sys_memset m_lsys_krn_sys_memset;
mess_lsys_krn_sys_sdevio m_lsys_krn_sys_sdevio;
mess_lsys_krn_sys_setalarm m_lsys_krn_sys_setalarm;
mess_lsys_krn_sys_setgrant m_lsys_krn_sys_setgrant;
+ mess_lsys_krn_sys_setmcontext m_lsys_krn_sys_setmcontext;
mess_lsys_krn_sys_statectl m_lsys_krn_sys_statectl;
mess_lsys_krn_sys_stime m_lsys_krn_sys_stime;
mess_lsys_krn_sys_settime m_lsys_krn_sys_settime;
* m_type: SYS_SETMCONTEXT
* m_type: SYS_GETMCONTEXT
*
- * The parameters for these kernel calls are:
- * m1_i1: PR_ENDPT # proc endpoint doing call
- * m1_p1: PR_MEM_PTR # pointer to mcontext structure
+ * The parameters for SYS_SETMCONTEXT kernel call are:
+ * m_lsys_krn_sys_setmcontext.endpt # proc endpoint doing call
+ * m_lsys_krn_sys_setmcontext.ctx_ptr # pointer to mcontext structure
*
+ * The parameters for SYS_GETMCONTEXT kernel call are:
+ * m_lsys_krn_sys_getmcontext.endpt # proc endpoint doing call
+ * m_lsys_krn_sys_getmcontext.ctx_ptr # pointer to mcontext structure
*/
#include "kernel/system.h"
int proc_nr, r;
mcontext_t mc;
- if (! isokendpt(m_ptr->PR_ENDPT, &proc_nr)) return(EINVAL);
+ if (!isokendpt(m_ptr->m_lsys_krn_sys_getmcontext.endpt, &proc_nr))
+ return(EINVAL);
if (iskerneln(proc_nr)) return(EPERM);
rp = proc_addr(proc_nr);
#endif
/* Get the mcontext structure into our address space. */
- if ((r = data_copy(m_ptr->PR_ENDPT, (vir_bytes) m_ptr->PR_CTX_PTR, KERNEL,
+ if ((r = data_copy(m_ptr->m_lsys_krn_sys_getmcontext.endpt,
+ m_ptr->m_lsys_krn_sys_getmcontext.ctx_ptr, KERNEL,
(vir_bytes) &mc, (phys_bytes) sizeof(mcontext_t))) != OK)
return(r);
/* Copy the mcontext structure to the user's address space. */
- if ((r = data_copy(KERNEL, (vir_bytes) &mc, m_ptr->PR_ENDPT,
- (vir_bytes) m_ptr->PR_CTX_PTR,
+ if ((r = data_copy(KERNEL, (vir_bytes) &mc,
+ m_ptr->m_lsys_krn_sys_getmcontext.endpt,
+ m_ptr->m_lsys_krn_sys_getmcontext.ctx_ptr,
(phys_bytes) sizeof(mcontext_t))) != OK)
return(r);
int proc_nr, r;
mcontext_t mc;
- if (!isokendpt(m_ptr->PR_ENDPT, &proc_nr)) return(EINVAL);
+ if (!isokendpt(m_ptr->m_lsys_krn_sys_setmcontext.endpt, &proc_nr)) return(EINVAL);
rp = proc_addr(proc_nr);
/* Get the mcontext structure into our address space. */
- if ((r = data_copy(m_ptr->PR_ENDPT, (vir_bytes) m_ptr->PR_CTX_PTR, KERNEL,
+ if ((r = data_copy(m_ptr->m_lsys_krn_sys_setmcontext.endpt,
+ m_ptr->m_lsys_krn_sys_setmcontext.ctx_ptr, KERNEL,
(vir_bytes) &mc, (phys_bytes) sizeof(mcontext_t))) != OK)
return(r);
message m;
int r;
- m.PR_ENDPT = proc;
- m.PR_CTX_PTR = (char *) mcp;
+ m.m_lsys_krn_sys_getmcontext.endpt = proc;
+ m.m_lsys_krn_sys_getmcontext.ctx_ptr = mcp;
r = _kernel_call(SYS_GETMCONTEXT, &m);
return r;
}
message m;
int r;
- m.PR_ENDPT = proc;
- m.PR_CTX_PTR = (char *) mcp;
+ m.m_lsys_krn_sys_setmcontext.endpt = proc;
+ m.m_lsys_krn_sys_setmcontext.ctx_ptr = mcp;
r = _kernel_call(SYS_SETMCONTEXT, &m);
return r;
}