# define VM_NOTIFY_SIG_IPC m1_i2
#define VM_INFO (VM_RQ_BASE+40)
-# define VMI_WHAT m2_i1
-# define VMI_EP m2_i2
-# define VMI_COUNT m2_i3
-# define VMI_PTR m2_p1
-# define VMI_NEXT m2_l1
-/* VMI_WHAT values. */
+/* VM_INFO 'what' values. */
#define VMIW_STATS 1
#define VMIW_USAGE 2
#define VMIW_REGION 3
} mess_lsys_vm_query_exit;
_ASSERT_MSG_SIZE(mess_lsys_vm_query_exit);
+typedef struct {
+ int what;
+ endpoint_t ep;
+ int count;
+ void *ptr;
+ vir_bytes next;
+ uint8_t padding[36];
+} mess_lsys_vm_info;
+_ASSERT_MSG_SIZE(mess_lsys_vm_info);
+
typedef struct {
endpoint_t m_source; /* who sent the message */
int m_type; /* what kind of message is it */
mess_lc_vm_getphys m_lc_vm_getphys;
mess_lc_vm_shm_unmap m_lc_vm_shm_unmap;
mess_lsys_vm_query_exit m_lsys_vm_query_exit;
+ mess_lsys_vm_info m_lsys_vm_info;
mess_vfs_lchardriver_cancel m_vfs_lchardriver_cancel;
mess_vfs_lchardriver_openclose m_vfs_lchardriver_openclose;
message m;
memset(&m, 0, sizeof(m));
- m.VMI_WHAT = VMIW_STATS;
- m.VMI_PTR = (void *) vsi;
+ m.m_lsys_vm_info.what = VMIW_STATS;
+ m.m_lsys_vm_info.ptr = vsi;
return _taskcall(VM_PROC_NR, VM_INFO, &m);
}
message m;
memset(&m, 0, sizeof(m));
- m.VMI_WHAT = VMIW_USAGE;
- m.VMI_EP = who;
- m.VMI_PTR = (void *) vui;
+ m.m_lsys_vm_info.what = VMIW_USAGE;
+ m.m_lsys_vm_info.ep = who;
+ m.m_lsys_vm_info.ptr = vui;
return _taskcall(VM_PROC_NR, VM_INFO, &m);
}
int result;
memset(&m, 0, sizeof(m));
- m.VMI_WHAT = VMIW_REGION;
- m.VMI_EP = who;
- m.VMI_COUNT = count;
- m.VMI_PTR = (void *) vri;
- m.VMI_NEXT = *next;
+ m.m_lsys_vm_info.what = VMIW_REGION;
+ m.m_lsys_vm_info.ep = who;
+ m.m_lsys_vm_info.count = count;
+ m.m_lsys_vm_info.ptr = vri;
+ m.m_lsys_vm_info.next = *next;
if ((result = _taskcall(VM_PROC_NR, VM_INFO, &m)) != OK)
return result;
- *next = m.VMI_NEXT;
- return m.VMI_COUNT;
+ *next = m.m_lsys_vm_info.next;
+ return m.m_lsys_vm_info.count;
}
return EINVAL;
vmp = &vmproc[pr];
- ptr = (vir_bytes) m->VMI_PTR;
+ ptr = (vir_bytes) m->m_lsys_vm_info.ptr;
- switch(m->VMI_WHAT) {
+ switch(m->m_lsys_vm_info.what) {
case VMIW_STATS:
vsi.vsi_pagesize = VM_PAGE_SIZE;
vsi.vsi_total = total_pages;
break;
case VMIW_USAGE:
- if(m->VMI_EP < 0)
+ if(m->m_lsys_vm_info.ep < 0)
get_usage_info_kernel(&vui);
- else if (vm_isokendpt(m->VMI_EP, &pr) != OK)
+ else if (vm_isokendpt(m->m_lsys_vm_info.ep, &pr) != OK)
return EINVAL;
else get_usage_info(&vmproc[pr], &vui);
break;
case VMIW_REGION:
- if (vm_isokendpt(m->VMI_EP, &pr) != OK)
+ if (vm_isokendpt(m->m_lsys_vm_info.ep, &pr) != OK)
return EINVAL;
- count = MIN(m->VMI_COUNT, MAX_VRI_COUNT);
- next = m->VMI_NEXT;
+ count = MIN(m->m_lsys_vm_info.count, MAX_VRI_COUNT);
+ next = m->m_lsys_vm_info.next;
count = get_region_info(&vmproc[pr], vri, count, &next);
- m->VMI_COUNT = count;
- m->VMI_NEXT = next;
+ m->m_lsys_vm_info.count = count;
+ m->m_lsys_vm_info.next = next;
addr = (vir_bytes) vri;
size = sizeof(vri[0]) * count;