Remove building with NOCRYPTO option
[minix.git] / minix / kernel / system / do_statectl.c
blobe2cdc85dcdd8475b872be1c2d1967de50d0ac98c
1 /* The kernel call implemented in this file:
2 * m_type: SYS_STATECTL
4 * The parameters for this kernel call are:
5 * m_lsys_krn_sys_statectl.request (state control request)
6 */
8 #include "kernel/system.h"
10 #if USE_STATECTL
12 /*===========================================================================*
13 * do_statectl *
14 *===========================================================================*/
15 int do_statectl(struct proc * caller, message * m_ptr)
17 /* Handle sys_statectl(). A process has issued a state control request. */
19 switch(m_ptr->m_lsys_krn_sys_statectl.request)
21 case SYS_STATE_CLEAR_IPC_REFS:
22 /* Clear IPC references for all the processes communicating
23 * with the caller.
25 clear_ipc_refs(caller, EDEADSRCDST);
26 return(OK);
27 case SYS_STATE_SET_STATE_TABLE:
28 /* Set state table for the caller. */
29 priv(caller)->s_state_table = (vir_bytes) m_ptr->m_lsys_krn_sys_statectl.address;
30 priv(caller)->s_state_entries = m_ptr->m_lsys_krn_sys_statectl.length;
31 return(OK);
32 case SYS_STATE_ADD_IPC_BL_FILTER:
33 /* Add an IPC blacklist filter for the caller. */
34 return add_ipc_filter(caller, IPCF_BLACKLIST,
35 (vir_bytes) m_ptr->m_lsys_krn_sys_statectl.address,
36 m_ptr->m_lsys_krn_sys_statectl.length);
37 case SYS_STATE_ADD_IPC_WL_FILTER:
38 /* Add an IPC whitelist filter for the caller. */
39 return add_ipc_filter(caller, IPCF_WHITELIST,
40 (vir_bytes) m_ptr->m_lsys_krn_sys_statectl.address,
41 m_ptr->m_lsys_krn_sys_statectl.length);
42 case SYS_STATE_CLEAR_IPC_FILTERS:
43 /* Clear any IPC filter for the caller. */
44 clear_ipc_filters(caller);
45 return OK;
46 default:
47 printf("do_statectl: bad request %d\n",
48 m_ptr->m_lsys_krn_sys_statectl.request);
49 return EINVAL;
53 #endif /* USE_STATECTL */