/* Subfunctions for SYS_STATECTL */
#define SYS_STATE_CLEAR_IPC_REFS 1 /* clear IPC references */
+#define SYS_STATE_SET_STATE_TABLE 2 /* set state map */
/* Subfunctions for SYS_SCHEDCTL */
# define SCHEDCTL_FLAG_KERNEL 1 /* mark kernel scheduler and remove
typedef struct {
int request;
+ void *address;
+ int length;
- uint8_t padding[52];
+ uint8_t padding[44];
} mess_lsys_krn_sys_statectl;
_ASSERT_MSG_SIZE(mess_lsys_krn_sys_statectl);
int sys_runctl(endpoint_t proc_ep, int action, int flags);
int sys_update(endpoint_t src_ep, endpoint_t dst_ep);
-int sys_statectl(int request);
+int sys_statectl(int request, void* address, int length);
int sys_privctl(endpoint_t proc_ep, int req, void *p);
int sys_privquery_mem(endpoint_t proc_ep, phys_bytes physstart,
phys_bytes physlen);
int s_irq_tab[NR_IRQ];
vir_bytes s_grant_table; /* grant table address of process, or 0 */
int s_grant_entries; /* no. of entries, or 0 */
+ vir_bytes s_state_table; /* state table address of process, or 0 */
+ int s_state_entries; /* no. of entries, or 0 */
};
/* Guard word for task stacks. */
priv(rp)->s_nr_irq= 0;
priv(rp)->s_grant_table= 0;
priv(rp)->s_grant_entries= 0;
+ priv(rp)->s_state_table= 0;
+ priv(rp)->s_state_entries= 0;
/* Override defaults if the caller has supplied a privilege structure. */
if (m_ptr->m_lsys_krn_sys_privctl.arg_ptr)
*/
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);
* will not restart statefully, and thus will skip this code.
*/
if (type == SEF_INIT_RESTART) {
- if ((r = sys_statectl(SYS_STATE_CLEAR_IPC_REFS)) != OK)
+ if ((r = sys_statectl(SYS_STATE_CLEAR_IPC_REFS, 0, 0)) != OK)
panic("blockdriver_init: sys_statectl failed: %d", r);
}
* For this reason, there may blocked callers when a driver restarts.
* Ask the kernel to unblock them (if any).
*/
- if ((r = sys_statectl(SYS_STATE_CLEAR_IPC_REFS)) != OK)
+ if ((r = sys_statectl(SYS_STATE_CLEAR_IPC_REFS, 0, 0)) != OK)
panic("chardriver_announce: sys_statectl failed: %d", r);
/* Publish a driver up event. */
* For this reason, there may blocked callers when a driver restarts.
* Ask the kernel to unblock them (if any).
*/
- if ((r = sys_statectl(SYS_STATE_CLEAR_IPC_REFS)) != OK) {
+ if ((r = sys_statectl(SYS_STATE_CLEAR_IPC_REFS, 0, 0)) != OK) {
panic("chardriver_init: sys_statectl failed: %d", r);
}
#include "syslib.h"
-int sys_statectl(int request)
+int sys_statectl(int request, void* address, int length)
{
message m;
m.m_lsys_krn_sys_statectl.request = request;
+ m.m_lsys_krn_sys_statectl.address = address;
+ m.m_lsys_krn_sys_statectl.length = length;
return _kernel_call(SYS_STATECTL, &m);
}