if(!GRANT_VALID(g_key))
return ENOMEM;
- m->DS_KEY_GRANT = g_key;
- m->DS_KEY_LEN = len_key;
+ m->m_ds_req.key_grant = g_key;
+ m->m_ds_req.key_len = len_key;
r = _taskcall(DS_PROC_NR, type, m);
message m;
memset(&m, 0, sizeof(m));
- m.DS_VAL = (u32_t) endpoint;
- m.DS_FLAGS = DSF_TYPE_LABEL | flags;
+ m.m_ds_req.val_in.ep = endpoint;
+ m.m_ds_req.flags = DSF_TYPE_LABEL | flags;
return do_invoke_ds(&m, DS_PUBLISH, ds_name);
}
message m;
memset(&m, 0, sizeof(m));
- m.DS_VAL = value;
- m.DS_FLAGS = DSF_TYPE_U32 | flags;
+ m.m_ds_req.val_in.u32 = value;
+ m.m_ds_req.flags = DSF_TYPE_U32 | flags;
return do_invoke_ds(&m, DS_PUBLISH, ds_name);
}
return ENOMEM;
memset(&m, 0, sizeof(m));
- m.DS_VAL = gid;
- m.DS_VAL_LEN = length;
- m.DS_FLAGS = flags;
+ m.m_ds_req.val_in.grant = gid;
+ m.m_ds_req.val_len = length;
+ m.m_ds_req.flags = flags;
r = do_invoke_ds(&m, DS_PUBLISH, ds_name);
cpf_revoke(gid);
int r;
memset(&m, 0, sizeof(m));
- m.DS_VAL = (u32_t) endpoint;
+ m.m_ds_req.val_in.ep = endpoint;
r = do_invoke_ds(&m, DS_RETRIEVE_LABEL, ds_name);
return r;
}
int r;
memset(&m, 0, sizeof(m));
- m.DS_FLAGS = DSF_TYPE_LABEL;
+ m.m_ds_req.flags = DSF_TYPE_LABEL;
r = do_invoke_ds(&m, DS_RETRIEVE, ds_name);
- *endpoint = (endpoint_t) m.DS_VAL;
+ *endpoint = m.m_ds_reply.val_out.ep;
return r;
}
int r;
memset(&m, 0, sizeof(m));
- m.DS_FLAGS = DSF_TYPE_U32;
+ m.m_ds_req.flags = DSF_TYPE_U32;
r = do_invoke_ds(&m, DS_RETRIEVE, ds_name);
- *value = m.DS_VAL;
+ *value = m.m_ds_reply.val_out.u32;
return r;
}
return ENOMEM;
memset(&m, 0, sizeof(m));
- m.DS_VAL = gid;
- m.DS_VAL_LEN = *length;
- m.DS_FLAGS = flags;
+ m.m_ds_req.val_in.grant = gid;
+ m.m_ds_req.val_len = *length;
+ m.m_ds_req.flags = flags;
r = do_invoke_ds(&m, DS_RETRIEVE, ds_name);
- *length = m.DS_VAL_LEN;
+ *length = m.m_ds_reply.val_len;
cpf_revoke(gid);
return r;
message m;
memset(&m, 0, sizeof(m));
- m.DS_FLAGS = DSF_TYPE_U32;
+ m.m_ds_req.flags = DSF_TYPE_U32;
return do_invoke_ds(&m, DS_DELETE, ds_name);
}
message m;
memset(&m, 0, sizeof(m));
- m.DS_FLAGS = DSF_TYPE_STR;
+ m.m_ds_req.flags = DSF_TYPE_STR;
return do_invoke_ds(&m, DS_DELETE, ds_name);
}
message m;
memset(&m, 0, sizeof(m));
- m.DS_FLAGS = DSF_TYPE_MEM;
+ m.m_ds_req.flags = DSF_TYPE_MEM;
return do_invoke_ds(&m, DS_DELETE, ds_name);
}
message m;
memset(&m, 0, sizeof(m));
- m.DS_FLAGS = DSF_TYPE_LABEL;
+ m.m_ds_req.flags = DSF_TYPE_LABEL;
return do_invoke_ds(&m, DS_DELETE, ds_name);
}
message m;
memset(&m, 0, sizeof(m));
- m.DS_FLAGS = flags;
+ m.m_ds_req.flags = flags;
return do_invoke_ds(&m, DS_SUBSCRIBE, regexp);
}
memset(&m, 0, sizeof(m));
r = do_invoke_ds(&m, DS_CHECK, ds_key);
- if(type) *type = m.DS_FLAGS;
- if(owner_e) *owner_e = m.DS_OWNER;
+ if(type) *type = m.m_ds_req.flags;
+ if(owner_e) *owner_e = m.m_ds_req.owner;
return r;
}
/* Get key name given an input message. */
int r;
- if (m_ptr->DS_KEY_LEN > DS_MAX_KEYLEN || m_ptr->DS_KEY_LEN < 2) {
- printf("DS: bogus key length (%d) from %d\n", m_ptr->DS_KEY_LEN,
+ if (m_ptr->m_ds_req.key_len > DS_MAX_KEYLEN || m_ptr->m_ds_req.key_len < 2) {
+ printf("DS: bogus key length (%d) from %d\n", m_ptr->m_ds_req.key_len,
m_ptr->m_source);
return EINVAL;
}
/* Copy name from caller. */
r = sys_safecopyfrom(m_ptr->m_source,
- (cp_grant_id_t) m_ptr->DS_KEY_GRANT, 0,
- (vir_bytes) key_name, m_ptr->DS_KEY_LEN);
+ (cp_grant_id_t) m_ptr->m_ds_req.key_grant, 0,
+ (vir_bytes) key_name, m_ptr->m_ds_req.key_len);
if(r != OK) {
printf("DS: publish: copy failed from %d: %d\n", m_ptr->m_source, r);
return r;
struct data_store *dsp;
char key_name[DS_MAX_KEYLEN];
char *source;
- int flags = m_ptr->DS_FLAGS;
+ int flags = m_ptr->m_ds_req.flags;
size_t length;
int r;
dsp = lookup_entry(key_name, flags & DSF_MASK_TYPE);
/* If type is LABEL, also try to lookup the entry by num. */
if((flags & DSF_TYPE_LABEL) && (dsp == NULL))
- dsp = lookup_label_entry(m_ptr->DS_VAL);
+ dsp = lookup_label_entry(m_ptr->m_ds_req.val_in.ep);
if(dsp == NULL) {
/* The entry doesn't exist, allocate a new data slot. */
/* Store! */
switch(flags & DSF_MASK_TYPE) {
case DSF_TYPE_U32:
+ dsp->u.u32 = m_ptr->m_ds_req.val_in.u32;
+ break;
case DSF_TYPE_LABEL:
- dsp->u.u32 = m_ptr->DS_VAL;
+ dsp->u.u32 = m_ptr->m_ds_req.val_in.ep;
break;
case DSF_TYPE_STR:
case DSF_TYPE_MEM:
- length = m_ptr->DS_VAL_LEN;
+ length = m_ptr->m_ds_req.val_len;
/* Allocate a new data buffer if necessary. */
if(!(dsp->flags & DSF_IN_USE)) {
if((dsp->u.mem.data = malloc(length)) == NULL)
}
/* Copy the memory range. */
- r = sys_safecopyfrom(m_ptr->m_source, (cp_grant_id_t) m_ptr->DS_VAL,
+ r = sys_safecopyfrom(m_ptr->m_source, m_ptr->m_ds_req.val_in.grant,
0, (vir_bytes) dsp->u.mem.data, length);
if(r != OK) {
printf("DS: publish: memory map/copy failed from %d: %d\n",
{
struct data_store *dsp;
char key_name[DS_MAX_KEYLEN];
- int flags = m_ptr->DS_FLAGS;
+ int flags = m_ptr->m_ds_req.flags;
int type = flags & DSF_MASK_TYPE;
size_t length;
int r;
/* Copy the requested data. */
switch(type) {
case DSF_TYPE_U32:
+ m_ptr->m_ds_reply.val_out.u32 = dsp->u.u32;
+ break;
case DSF_TYPE_LABEL:
- m_ptr->DS_VAL = dsp->u.u32;
+ m_ptr->m_ds_reply.val_out.ep = dsp->u.u32;
break;
case DSF_TYPE_STR:
case DSF_TYPE_MEM:
- length = MIN(m_ptr->DS_VAL_LEN, dsp->u.mem.length);
- r = sys_safecopyto(m_ptr->m_source, (cp_grant_id_t) m_ptr->DS_VAL, 0,
+ length = MIN(m_ptr->m_ds_req.val_len, dsp->u.mem.length);
+ r = sys_safecopyto(m_ptr->m_source, m_ptr->m_ds_req.val_in.grant, 0,
(vir_bytes) dsp->u.mem.data, length);
if(r != OK) {
printf("DS: retrieve: copy failed to %d: %d\n",
m_ptr->m_source, r);
return r;
}
- m_ptr->DS_VAL_LEN = length;
+ m_ptr->m_ds_reply.val_len = length;
break;
default:
return EINVAL;
int r;
/* Lookup the label entry. */
- if((dsp = lookup_label_entry(m_ptr->DS_VAL)) == NULL)
+ if((dsp = lookup_label_entry(m_ptr->m_ds_req.val_in.ep)) == NULL)
return ESRCH;
/* Copy the key name. */
r = sys_safecopyto(m_ptr->m_source,
- (cp_grant_id_t) m_ptr->DS_KEY_GRANT, (vir_bytes) 0,
+ (cp_grant_id_t) m_ptr->m_ds_req.key_grant, (vir_bytes) 0,
(vir_bytes) dsp->key, strlen(dsp->key) + 1);
if(r != OK) {
printf("DS: copy failed from %d: %d\n", m_ptr->m_source, r);
/* The subscription doesn't exist, allocate a new one. */
if((subp = alloc_sub_slot()) == NULL)
return EAGAIN;
- } else if(!(m_ptr->DS_FLAGS & DSF_OVERWRITE)) {
+ } else if(!(m_ptr->m_ds_req.flags & DSF_OVERWRITE)) {
/* The subscription exists but we can't overwrite, return error. */
return EEXIST;
}
}
/* If type_set = 0, then subscribe all types. */
- type_set = m_ptr->DS_FLAGS & DSF_MASK_TYPE;
+ type_set = m_ptr->m_ds_req.flags & DSF_MASK_TYPE;
if(type_set == 0)
type_set = DSF_MASK_TYPE;
subp->old_subs[b] = 0;
/* See if caller requested an instant initial list. */
- if(m_ptr->DS_FLAGS & DSF_INITIAL) {
+ if(m_ptr->m_ds_req.flags & DSF_INITIAL) {
int i, match_found = FALSE;
for(i = 0; i < NR_DS_KEYS; i++) {
if(!(ds_store[i].flags & DSF_IN_USE))
/* Copy the key name. */
r = sys_safecopyto(m_ptr->m_source,
- (cp_grant_id_t) m_ptr->DS_KEY_GRANT, (vir_bytes) 0,
+ (cp_grant_id_t) m_ptr->m_ds_req.key_grant, (vir_bytes) 0,
(vir_bytes) ds_store[i].key, strlen(ds_store[i].key) + 1);
if(r != OK) {
printf("DS: check: copy failed from %d: %d\n", m_ptr->m_source, r);
/* Copy the type and the owner of the original entry. */
entry_owner_e = ds_getprocep(ds_store[i].owner);
- m_ptr->DS_FLAGS = ds_store[i].flags & DSF_MASK_TYPE;
- m_ptr->DS_OWNER = entry_owner_e;
+ m_ptr->m_ds_req.flags = ds_store[i].flags & DSF_MASK_TYPE;
+ m_ptr->m_ds_req.owner = entry_owner_e;
/* Mark the entry as no longer updated for the subscriber. */
UNSET_BIT(subp->old_subs, i);
char key_name[DS_MAX_KEYLEN];
char *source;
char *label;
- int type = m_ptr->DS_FLAGS & DSF_MASK_TYPE;
+ int type = m_ptr->m_ds_req.flags & DSF_MASK_TYPE;
int i, r;
/* Lookup the source. */