VM information interface

This commit is contained in:
David van Moolenbroek
2010-01-19 21:00:20 +00:00
parent 7d51b0cce1
commit 61bb82a44b
18 changed files with 412 additions and 64 deletions

View File

@@ -80,11 +80,11 @@ libsys_FILES=" \
taskcall.c \
ds.c \
vm_brk.c \
vm_ctl.c \
vm_exec_newmem.c \
vm_exit.c \
vm_notify_sig.c \
vm_fork.c \
vm_info.c \
vm_map_phys.c \
vm_umap.c \
vm_push_sig.c"

View File

@@ -1,18 +0,0 @@
#include "syslib.h"
#include <minix/vm.h>
/*===========================================================================*
* vm_umap *
*===========================================================================*/
PUBLIC int vm_ctl(int what, int param)
{
message m;
int result;
m.VCTL_WHAT = what;
m.VCTL_PARAM = param;
return _taskcall(VM_PROC_NR, VM_CTL, &m);
}

54
lib/syslib/vm_info.c Normal file
View File

@@ -0,0 +1,54 @@
#include "syslib.h"
#include <minix/vm.h>
/*===========================================================================*
* vm_info_stats *
*===========================================================================*/
PUBLIC int vm_info_stats(struct vm_stats_info *vsi)
{
message m;
m.VMI_WHAT = VMIW_STATS;
m.VMI_PTR = (void *) vsi;
return _taskcall(VM_PROC_NR, VM_INFO, &m);
}
/*===========================================================================*
* vm_info_usage *
*===========================================================================*/
PUBLIC int vm_info_usage(endpoint_t who, struct vm_usage_info *vui)
{
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 *
*===========================================================================*/
PUBLIC int vm_info_region(endpoint_t who, struct vm_region_info *vri,
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;
}