memset(&m, 0, sizeof(m));
switch(request) {
case RS_UPDATE:
- m.RS_LU_STATE = req_lu_state;
- m.RS_LU_PREPARE_MAXTIME = req_lu_maxtime;
+ m.m_rs_update.state = req_lu_state;
+ m.m_rs_update.prepare_maxtime = req_lu_maxtime;
/* fall through */
case RS_UP:
case RS_EDIT:
assert(config.rs_start.rss_priority < NR_SCHED_QUEUES);
assert(config.rs_start.rss_quantum > 0);
- m.RS_CMD_ADDR = (char *) &config.rs_start;
+ m.m_rs_req.addr = (char *) &config.rs_start;
break;
case RS_DOWN:
case RS_REFRESH:
case RS_RESTART:
case RS_CLONE:
- m.RS_CMD_ADDR = req_label;
- m.RS_CMD_LEN = strlen(req_label);
+ m.m_rs_req.addr = req_label;
+ m.m_rs_req.len = strlen(req_label);
break;
case RS_SHUTDOWN:
break;
if (tell_rs) {
/* Tell RS to refresh or restart the driver */
msg.m_type = RS_REFRESH;
- msg.RS_CMD_ADDR = driver[which].label;
- msg.RS_CMD_LEN = strlen(driver[which].label);
+ msg.m_rs_req.addr = driver[which].label;
+ msg.m_rs_req.len = strlen(driver[which].label);
#if DEBUG
printf("Filter: asking RS to refresh %s..\n",
#define RS_INIT (RS_RQ_BASE + 20) /* service init message */
#define RS_LU_PREPARE (RS_RQ_BASE + 21) /* prepare to update message */
-# define RS_CMD_ADDR m1_p1 /* command string */
-# define RS_CMD_LEN m1_i1 /* length of command */
-# define RS_PERIOD m1_i2 /* heartbeat period */
-# define RS_DEV_MAJOR m1_i3 /* major device number */
-
-# define RS_ENDPOINT m1_i1 /* endpoint number in reply */
-
-# define RS_NAME m1_p1 /* name */
-# define RS_NAME_LEN m1_i1 /* namelen */
-
-# define RS_INIT_RESULT m7_i1 /* init result */
-# define RS_INIT_TYPE m7_i2 /* init type */
-# define RS_INIT_RPROCTAB_GID m7_i3 /* init rproc table gid */
-# define RS_INIT_OLD_ENDPOINT m7_i4 /* init old endpoint */
-
-# define RS_LU_RESULT m1_i1 /* live update result */
-# define RS_LU_STATE m1_i2 /* state required to update */
-# define RS_LU_PREPARE_MAXTIME m1_i3 /* the max time to prepare */
-
/*===========================================================================*
* Messages for the Data Store Server *
*===========================================================================*/
} mess_lsys_kern_vsafecopy;
_ASSERT_MSG_SIZE(mess_lsys_kern_vsafecopy);
+typedef struct {
+ int result;
+ int type;
+ cp_grant_id_t rproctab_gid;
+ endpoint_t old_endpoint;
+ uint8_t padding[40];
+} mess_rs_init;
+_ASSERT_MSG_SIZE(mess_rs_init);
+
+typedef struct {
+ int result;
+ int state;
+ int prepare_maxtime;
+ uint8_t padding[44];
+} mess_rs_update;
+_ASSERT_MSG_SIZE(mess_rs_update);
+
+typedef struct {
+ int len;
+ int name_len;
+ endpoint_t endpoint;
+ void *addr;
+ const char *name;
+ uint8_t padding[36];
+} mess_rs_req;
+_ASSERT_MSG_SIZE(mess_rs_req);
+
typedef struct {
endpoint_t m_source; /* who sent the message */
int m_type; /* what kind of message is it */
mess_lsys_vm_unmap_phys m_lsys_vm_unmap_phys;
mess_lsys_kern_safecopy m_lsys_kern_safecopy;
mess_lsys_kern_vsafecopy m_lsys_kern_vsafecopy;
+ mess_rs_init m_rs_init;
+ mess_rs_update m_rs_update;
+ mess_rs_req m_rs_req;
mess_vfs_lchardriver_cancel m_vfs_lchardriver_cancel;
mess_vfs_lchardriver_openclose m_vfs_lchardriver_openclose;
len_key = strlen(name)+1;
memset(&m, 0, sizeof(m));
- m.RS_NAME = (char *) __UNCONST(name);
- m.RS_NAME_LEN = len_key;
+ m.m_rs_req.name = name;
+ m.m_rs_req.name_len = len_key;
if (_syscall(RS_PROC_NR, RS_LOOKUP, &m) != -1) {
- *value = m.RS_ENDPOINT;
+ *value = m.m_rs_req.endpoint;
return OK;
}
memset(&m, 0, sizeof(m));
m.m_source = sef_self_endpoint;
m.m_type = RS_INIT;
- m.RS_INIT_RESULT = result;
+ m.m_rs_init.result = result;
r = sef_cbs.sef_cb_init_response(&m);
return r;
sef_init_info_t info;
/* Get init parameters from message. */
- type = m_ptr->RS_INIT_TYPE;
- info.rproctab_gid = m_ptr->RS_INIT_RPROCTAB_GID;
+ type = m_ptr->m_rs_init.type;
+ info.rproctab_gid = m_ptr->m_rs_init.rproctab_gid;
info.endpoint = sef_self_endpoint;
- info.old_endpoint = m_ptr->RS_INIT_OLD_ENDPOINT;
+ info.old_endpoint = m_ptr->m_rs_init.old_endpoint;
/* Peform initialization. */
r = process_init(type, &info);
sef_lu_debug_cycle = 0;
old_state = sef_lu_state;
- state = m_ptr->RS_LU_STATE;
+ state = m_ptr->m_rs_update.state;
/* Deal with prepare cancel requests first. */
is_valid_state = (state == SEF_LU_STATE_NULL);
*/
m.m_source = sef_self_endpoint;
m.m_type = RS_LU_PREPARE;
- m.RS_LU_STATE = sef_lu_state;
- m.RS_LU_RESULT = result;
+ m.m_rs_update.state = sef_lu_state;
+ m.m_rs_update.result = result;
r = sef_cbs.sef_cb_lu_response(&m);
#if SEF_LU_DEBUG
if(m.m_type != RS_INIT) {
panic("unexpected reply from service: %d", m.m_source);
}
- result = m.RS_INIT_RESULT;
+ result = m.m_rs_init.result;
rp = rproc_ptr[_ENDPOINT_P(m.m_source)];
/* Check result. */
/* Prepare cancel request. */
m.m_type = RS_LU_PREPARE;
- m.RS_LU_STATE = SEF_LU_STATE_NULL;
+ m.m_rs_update.state = SEF_LU_STATE_NULL;
if(rpub->endpoint == RS_PROC_NR) {
/* RS can process the request directly. */
do_sef_lu_request(&m);
rpub = rp->r_pub;
/* Copy the request structure. */
- r = copy_rs_start(m_ptr->m_source, m_ptr->RS_CMD_ADDR, &rs_start);
+ r = copy_rs_start(m_ptr->m_source, m_ptr->m_rs_req.addr, &rs_start);
if (r != OK) {
return r;
}
char label[RS_MAX_LABEL_LEN];
/* Copy label. */
- s = copy_label(m_ptr->m_source, m_ptr->RS_CMD_ADDR,
- m_ptr->RS_CMD_LEN, label, sizeof(label));
+ s = copy_label(m_ptr->m_source, m_ptr->m_rs_req.addr,
+ m_ptr->m_rs_req.len, label, sizeof(label));
if(s != OK) {
return s;
}
char script[MAX_SCRIPT_LEN];
/* Copy label. */
- s = copy_label(m_ptr->m_source, m_ptr->RS_CMD_ADDR,
- m_ptr->RS_CMD_LEN, label, sizeof(label));
+ s = copy_label(m_ptr->m_source, m_ptr->m_rs_req.addr,
+ m_ptr->m_rs_req.len, label, sizeof(label));
if(s != OK) {
return s;
}
char label[RS_MAX_LABEL_LEN];
/* Copy label. */
- s = copy_label(m_ptr->m_source, m_ptr->RS_CMD_ADDR,
- m_ptr->RS_CMD_LEN, label, sizeof(label));
+ s = copy_label(m_ptr->m_source, m_ptr->m_rs_req.addr,
+ m_ptr->m_rs_req.len, label, sizeof(label));
if(s != OK) {
return s;
}
char label[RS_MAX_LABEL_LEN];
/* Copy the request structure. */
- r = copy_rs_start(m_ptr->m_source, m_ptr->RS_CMD_ADDR, &rs_start);
+ r = copy_rs_start(m_ptr->m_source, m_ptr->m_rs_req.addr, &rs_start);
if (r != OK) {
return r;
}
char label[RS_MAX_LABEL_LEN];
/* Copy label. */
- s = copy_label(m_ptr->m_source, m_ptr->RS_CMD_ADDR,
- m_ptr->RS_CMD_LEN, label, sizeof(label));
+ s = copy_label(m_ptr->m_source, m_ptr->m_rs_req.addr,
+ m_ptr->m_rs_req.len, label, sizeof(label));
if(s != OK) {
return s;
}
is_rs = (m_ptr->m_source == RS_PROC_NR);
who_p = _ENDPOINT_P(m_ptr->m_source);
- result = m_ptr->RS_INIT_RESULT;
+ result = m_ptr->m_rs_init.result;
/* Check for RS failing initialization first. */
if(is_rs && result != OK) {
int prepare_maxtime;
/* Copy the request structure. */
- s = copy_rs_start(m_ptr->m_source, m_ptr->RS_CMD_ADDR, &rs_start);
+ s = copy_rs_start(m_ptr->m_source, m_ptr->m_rs_req.addr, &rs_start);
if (s != OK) {
return s;
}
return s;
/* Retrieve live update state. */
- lu_state = m_ptr->RS_LU_STATE;
+ lu_state = m_ptr->m_rs_update.state;
if(lu_state == SEF_LU_STATE_NULL) {
return(EINVAL);
}
/* Retrieve prepare max time. */
- prepare_maxtime = m_ptr->RS_LU_PREPARE_MAXTIME;
+ prepare_maxtime = m_ptr->m_rs_update.prepare_maxtime;
if(prepare_maxtime) {
if(prepare_maxtime < 0 || prepare_maxtime > RS_MAX_PREPARE_MAXTIME) {
return(EINVAL);
who_p = _ENDPOINT_P(m_ptr->m_source);
rp = rproc_ptr[who_p];
- result = m_ptr->RS_LU_RESULT;
+ result = m_ptr->m_rs_update.result;
is_rs = (m_ptr->m_source == RS_PROC_NR);
/* Make sure the originating service was requested to prepare for update. */
struct rproc *rrp;
struct rprocpub *rrpub;
- len = m_ptr->RS_NAME_LEN;
+ len = m_ptr->m_rs_req.name_len;
if(len < 2 || len >= sizeof(namebuf)) {
printf("RS: len too weird (%d)\n", len);
return EINVAL;
}
- if((r=sys_datacopy(m_ptr->m_source, (vir_bytes) m_ptr->RS_NAME,
+ if((r=sys_datacopy(m_ptr->m_source, (vir_bytes) m_ptr->m_rs_req.name,
SELF, (vir_bytes) namebuf, len)) != OK) {
printf("RS: name copy failed\n");
return r;
return ESRCH;
}
rrpub = rrp->r_pub;
- m_ptr->RS_ENDPOINT = rrpub->endpoint;
+ m_ptr->m_rs_req.endpoint = rrpub->endpoint;
return OK;
}
/* Send initialization message. */
m.m_type = RS_INIT;
- m.RS_INIT_TYPE = type;
- m.RS_INIT_RPROCTAB_GID = rinit.rproctab_gid;
- m.RS_INIT_OLD_ENDPOINT = old_endpoint;
+ m.m_rs_init.type = type;
+ m.m_rs_init.rproctab_gid = rinit.rproctab_gid;
+ m.m_rs_init.old_endpoint = old_endpoint;
r = asynsend(rpub->endpoint, &m);
return r;
static struct rprocpub rprocpub[NR_BOOT_PROCS];
/* Map all the services in the boot image. */
- if((s = sys_safecopyfrom(RS_PROC_NR, m->RS_INIT_RPROCTAB_GID, 0,
+ if((s = sys_safecopyfrom(RS_PROC_NR, m->m_rs_init.rproctab_gid, 0,
(vir_bytes) rprocpub, sizeof(rprocpub))) != OK) {
panic("vm: sys_safecopyfrom (rs) failed: %d", s);
}
}
/* RS expects this response that it then again wants to reply to: */
- m->RS_INIT_RESULT = OK;
+ m->m_rs_init.result = OK;
ipc_sendrec(RS_PROC_NR, m);
return(SUSPEND);