41022be182
Change-Id: Ica37640f61513db9466dacf861a8148e3fb799d5
40 lines
1.1 KiB
C
40 lines
1.1 KiB
C
/* The kernel call implemented in this file:
|
|
* m_type: SYS_STATECTL
|
|
*
|
|
* The parameters for this kernel call are:
|
|
* m_lsys_krn_sys_statectl.request (state control request)
|
|
*/
|
|
|
|
#include "kernel/system.h"
|
|
|
|
#if USE_STATECTL
|
|
|
|
/*===========================================================================*
|
|
* do_statectl *
|
|
*===========================================================================*/
|
|
int do_statectl(struct proc * caller, message * m_ptr)
|
|
{
|
|
/* Handle sys_statectl(). A process has issued a state control request. */
|
|
|
|
switch(m_ptr->m_lsys_krn_sys_statectl.request)
|
|
{
|
|
case SYS_STATE_CLEAR_IPC_REFS:
|
|
/* Clear IPC references for all the processes communicating
|
|
* with the caller.
|
|
*/
|
|
clear_ipc_refs(caller, EDEADSRCDST);
|
|
return(OK);
|
|
case SYS_STATE_SET_STATE_TABLE:
|
|
/* Set state table for the caller. */
|
|
priv(caller)->s_state_table = (vir_bytes) m_ptr->m_lsys_krn_sys_statectl.address;
|
|
priv(caller)->s_state_entries = m_ptr->m_lsys_krn_sys_statectl.length;
|
|
return(OK);
|
|
default:
|
|
printf("do_statectl: bad request %d\n",
|
|
m_ptr->m_lsys_krn_sys_statectl.request);
|
|
return EINVAL;
|
|
}
|
|
}
|
|
|
|
#endif /* USE_STATECTL */
|