# define VMGD_SIZEP m2_l2
#define VM_MAP_PHYS (VM_RQ_BASE+15)
-# define VMMP_EP m1_i1
-# define VMMP_PHADDR m1_p2
-# define VMMP_LEN m1_i2
-# define VMMP_VADDR_REPLY m1_p3
#define VM_UNMAP_PHYS (VM_RQ_BASE+16)
# define VMUP_EP m1_i1
} mess_lc_ipc_semop;
_ASSERT_MSG_SIZE(mess_lc_ipc_semop);
+typedef struct {
+ endpoint_t ep;
+ phys_bytes phaddr;
+ size_t len;
+ void *reply;
+ uint8_t padding[40];
+} mess_lsys_vm_map_phys;
+_ASSERT_MSG_SIZE(mess_lsys_vm_map_phys);
+
typedef struct {
endpoint_t m_source; /* who sent the message */
int m_type; /* what kind of message is it */
mess_lc_ipc_semctl m_lc_ipc_semctl;
mess_lc_ipc_semop m_lc_ipc_semop;
mess_lc_vm_brk m_lc_vm_brk;
+ mess_lsys_vm_map_phys m_lsys_vm_map_phys;
mess_vfs_lchardriver_cancel m_vfs_lchardriver_cancel;
mess_vfs_lchardriver_openclose m_vfs_lchardriver_openclose;
int r;
memset(&m, 0, sizeof(m));
- m.VMMP_EP = who;
- m.VMMP_PHADDR = phaddr;
- m.VMMP_LEN = len;
+ m.m_lsys_vm_map_phys.ep = who;
+ m.m_lsys_vm_map_phys.phaddr = phaddr;
+ m.m_lsys_vm_map_phys.len = len;
r = _taskcall(VM_PROC_NR, VM_MAP_PHYS, &m);
if (r != OK) return MAP_FAILED;
- return (void *) m.VMMP_VADDR_REPLY;
+ return m.m_lsys_vm_map_phys.reply;
}
int
phys_bytes startaddr;
size_t offset;
- target = m->VMMP_EP;
- len = m->VMMP_LEN;
+ target = m->m_lsys_vm_map_phys.ep;
+ len = m->m_lsys_vm_map_phys.len;
if (len <= 0) return EINVAL;
if((r=vm_isokendpt(target, &n)) != OK)
return EINVAL;
- startaddr = (vir_bytes)m->VMMP_PHADDR;
+ startaddr = (vir_bytes)m->m_lsys_vm_map_phys.phaddr;
/* First check permission, then round range down/up. Caller can't
* help it if we can't map in lower than page granularity.
phys_setphys(vr, startaddr);
- m->VMMP_VADDR_REPLY = (void *) (vr->vaddr + offset);
+ m->m_lsys_vm_map_phys.reply = (void *) (vr->vaddr + offset);
return OK;
}