* SMAP_EP endpoint of the grantor
* SMAP_GID grant id
* SMAP_OFFSET offset of the grant space
- * SMAP_SEG segment
* SMAP_ADDRESS address
* SMAP_BYTES bytes to be copied
* SMAP_FLAG access, writable map or not?
/* Grantee. */
endpoint_t grantee;
- int seg;
vir_bytes address;
/* Length. */
*===========================================================================*/
static int add_info(endpoint_t grantor, endpoint_t grantee, cp_grant_id_t gid,
vir_bytes offset, vir_bytes address_Dseg,
- int seg, vir_bytes address, vir_bytes bytes)
+ vir_bytes address, vir_bytes bytes)
{
int i;
map_info[i].gid = gid;
map_info[i].address_Dseg = address_Dseg;
map_info[i].offset = offset;
- map_info[i].seg = seg;
map_info[i].address = address;
map_info[i].bytes = bytes;
/*===========================================================================*
* get_unmap_info *
*===========================================================================*/
-static struct map_info_s *get_unmap_info(endpoint_t grantee, int seg,
+static struct map_info_s *get_unmap_info(endpoint_t grantee,
vir_bytes address)
{
int i;
for(i = 0; i < MAX_MAP_INFO; i++) {
if(map_info[i].flag == 1
&& map_info[i].grantee == grantee
- && map_info[i].seg == seg
&& map_info[i].address == address)
return &map_info[i];
}
*===========================================================================*/
int map_invoke_vm(struct proc * caller,
int req_type, /* VMPTYPE_... COWMAP, SMAP, SUNMAP */
- endpoint_t end_d, int seg_d, vir_bytes off_d,
- endpoint_t end_s, int seg_s, vir_bytes off_s,
+ endpoint_t end_d, vir_bytes off_d,
+ endpoint_t end_s, vir_bytes off_s,
size_t size, int flag)
{
struct proc *src, *dst;
src = endpoint_lookup(end_s);
dst = endpoint_lookup(end_d);
- lin_src = umap_local(src, seg_s, off_s, size);
- lin_dst = umap_local(dst, seg_d, off_d, size);
+ lin_src = umap_local(src, D, off_s, size);
+ lin_dst = umap_local(dst, D, off_d, size);
if(lin_src == 0 || lin_dst == 0) {
printf("map_invoke_vm: error in umap_local.\n");
return EINVAL;
endpoint_t grantor = m_ptr->SMAP_EP;
cp_grant_id_t gid = (cp_grant_id_t) m_ptr->SMAP_GID;
vir_bytes offset = (vir_bytes) m_ptr->SMAP_OFFSET;
- int seg = (int) m_ptr->SMAP_SEG;
vir_bytes address = (vir_bytes) m_ptr->SMAP_ADDRESS;
vir_bytes bytes = (vir_bytes) m_ptr->SMAP_BYTES;
int flag = m_ptr->SMAP_FLAG;
/* Add map info. */
r = add_info(new_grantor, caller->p_endpoint, gid, offset,
- offset_result, seg, address, bytes);
+ offset_result, address, bytes);
if(r != OK)
return r;
/* Invoke VM. */
return map_invoke_vm(caller, VMPTYPE_SMAP,
- caller->p_endpoint, seg, address, new_grantor, D, offset_result, bytes,flag);
+ caller->p_endpoint, address, new_grantor, offset_result, bytes,flag);
}
/*===========================================================================*
}
r = map_invoke_vm(caller, VMPTYPE_SUNMAP,
- p->grantee, p->seg, p->address,
- new_grantor, D, offset_result,
+ p->grantee, p->address,
+ new_grantor, offset_result,
p->bytes, 0);
clear_info(p);
if(r != OK) {
int do_safeunmap(struct proc * caller, message * m_ptr)
{
vir_bytes address = (vir_bytes) m_ptr->SMAP_ADDRESS;
- int seg = (int)m_ptr->SMAP_SEG;
struct map_info_s *p;
int r;
- while((p = get_unmap_info(caller->p_endpoint, seg, address)) != NULL) {
+ while((p = get_unmap_info(caller->p_endpoint, address)) != NULL) {
if((r = safeunmap(caller, p)) != OK)
return r;
}
*===========================================================================*/
int sys_safemap(endpoint_t grantor, cp_grant_id_t grant,
vir_bytes grant_offset, vir_bytes my_address,
- size_t bytes, int my_seg, int writable)
+ size_t bytes, int writable)
{
/* Map a block of data for which the other process has previously
* granted permission.
copy_mess.SMAP_EP = grantor;
copy_mess.SMAP_GID = grant;
copy_mess.SMAP_OFFSET = grant_offset;
- copy_mess.SMAP_SEG = (void*) my_seg;
copy_mess.SMAP_ADDRESS = my_address;
copy_mess.SMAP_BYTES = bytes;
copy_mess.SMAP_FLAG = writable;
+ copy_mess.SMAP_SEG_OBSOLETE = (void *) D;
+
return(_kernel_call(SYS_SAFEMAP, ©_mess));
}
/*===========================================================================*
* sys_safeunmap *
*===========================================================================*/
-int sys_safeunmap(int my_seg, vir_bytes my_address)
+int sys_safeunmap(vir_bytes my_address)
{
/* Requestor unmaps safemap. */
message copy_mess;
- copy_mess.SMAP_SEG = (void*) my_seg;
copy_mess.SMAP_ADDRESS = my_address;
+ copy_mess.SMAP_SEG_OBSOLETE = (void *) D;
+
return(_kernel_call(SYS_SAFEUNMAP, ©_mess));
}