#define VM_SHM_UNMAP (VM_RQ_BASE+34)
#define VM_GETPHYS (VM_RQ_BASE+35)
-# define VMPHYS_ENDPT m2_i1
-# define VMPHYS_ADDR m2_l1
-# define VMPHYS_RETA m2_l2
#define VM_GETREF (VM_RQ_BASE+36)
# define VMREFCNT_ENDPT m2_i1
} mess_lc_vm_shm_unmap;
_ASSERT_MSG_SIZE(mess_lc_vm_shm_unmap);
+typedef struct {
+ endpoint_t endpt;
+ void *addr;
+ void *ret_addr;
+ uint8_t padding[44];
+} mess_lc_vm_getphys;
+_ASSERT_MSG_SIZE(mess_lc_vm_getphys);
+
typedef struct {
endpoint_t m_source; /* who sent the message */
int m_type; /* what kind of message is it */
mess_vfs_lc_lseek m_vfs_lc_lseek;
mess_lsys_vm_vmremap m_lsys_vm_vmremap;
+ mess_lc_vm_getphys m_lc_vm_getphys;
mess_lc_vm_shm_unmap m_lc_vm_shm_unmap;
mess_vfs_lchardriver_cancel m_vfs_lchardriver_cancel;
int r;
memset(&m, 0, sizeof(m));
- m.VMPHYS_ENDPT = endpt;
- m.VMPHYS_ADDR = (long) addr;
+ m.m_lc_vm_getphys.endpt = endpt;
+ m.m_lc_vm_getphys.addr = addr;
r = _syscall(VM_PROC_NR, VM_GETPHYS, &m);
if (r != OK)
return 0;
- return m.VMPHYS_RETA;
+ return (unsigned long) m.m_lc_vm_getphys.ret_addr;
}
u8_t vm_getrefcount(endpoint_t endpt, void *addr)
phys_bytes ret;
vir_bytes addr;
- target = m->VMPHYS_ENDPT;
- addr = m->VMPHYS_ADDR;
+ target = m->m_lc_vm_getphys.endpt;
+ addr = (vir_bytes) m->m_lc_vm_getphys.addr;
if ((r = vm_isokendpt(target, &n)) != OK)
return EINVAL;
r = map_get_phys(vmp, addr, &ret);
- m->VMPHYS_RETA = ret;
+ m->m_lc_vm_getphys.ret_addr = (void *) ret;
return r;
}