2010-01-19 22:00:20 +01:00
|
|
|
|
|
|
|
#include "syslib.h"
|
|
|
|
|
|
|
|
#include <minix/vm.h>
|
|
|
|
|
|
|
|
/*===========================================================================*
|
|
|
|
* vm_info_stats *
|
|
|
|
*===========================================================================*/
|
2012-03-25 20:25:53 +02:00
|
|
|
int vm_info_stats(struct vm_stats_info *vsi)
|
2010-01-19 22:00:20 +01:00
|
|
|
{
|
|
|
|
message m;
|
|
|
|
|
|
|
|
m.VMI_WHAT = VMIW_STATS;
|
|
|
|
m.VMI_PTR = (void *) vsi;
|
|
|
|
|
|
|
|
return _taskcall(VM_PROC_NR, VM_INFO, &m);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*===========================================================================*
|
|
|
|
* vm_info_usage *
|
|
|
|
*===========================================================================*/
|
2012-03-25 20:25:53 +02:00
|
|
|
int vm_info_usage(endpoint_t who, struct vm_usage_info *vui)
|
2010-01-19 22:00:20 +01:00
|
|
|
{
|
|
|
|
message m;
|
|
|
|
|
|
|
|
m.VMI_WHAT = VMIW_USAGE;
|
|
|
|
m.VMI_EP = who;
|
|
|
|
m.VMI_PTR = (void *) vui;
|
|
|
|
|
|
|
|
return _taskcall(VM_PROC_NR, VM_INFO, &m);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*===========================================================================*
|
|
|
|
* vm_info_region *
|
|
|
|
*===========================================================================*/
|
2012-03-25 20:25:53 +02:00
|
|
|
int vm_info_region(endpoint_t who, struct vm_region_info *vri,
|
2010-01-19 22:00:20 +01:00
|
|
|
int count, vir_bytes *next)
|
|
|
|
{
|
|
|
|
message m;
|
|
|
|
int result;
|
|
|
|
|
|
|
|
m.VMI_WHAT = VMIW_REGION;
|
|
|
|
m.VMI_EP = who;
|
|
|
|
m.VMI_COUNT = count;
|
|
|
|
m.VMI_PTR = (void *) vri;
|
|
|
|
m.VMI_NEXT = *next;
|
|
|
|
|
|
|
|
if ((result = _taskcall(VM_PROC_NR, VM_INFO, &m)) != OK)
|
|
|
|
return result;
|
|
|
|
|
|
|
|
*next = m.VMI_NEXT;
|
|
|
|
return m.VMI_COUNT;
|
|
|
|
}
|
|
|
|
|