vm: add third-party mmap() mode and PROCCTL

these two functions will be used to support all exec() functionality
going into a single library shared by RS and VFS and exec() knowledge
leaving VM.

	. third-party mmap: allow certain processes (VFS, RS) to
	  do mmap() on behalf of another process
	. PROCCTL: used to free and clear a process' address space
This commit is contained in:
Ben Gras
2012-06-06 00:50:13 +02:00
parent 1daf36038c
commit ee4016155e
12 changed files with 98 additions and 7 deletions

View File

@@ -127,6 +127,7 @@ SRCS= \
vm_push_sig.c \
vm_umap.c \
vm_yield_get_block.c \
vm_procctl.c \
vprintf.c \
.if ${MKCOVERAGE} != "no"

22
lib/libsys/vm_procctl.c Normal file
View File

@@ -0,0 +1,22 @@
#include "syslib.h"
#include <minix/vm.h>
#include <string.h>
/*===========================================================================*
* vm_exit *
*===========================================================================*/
int vm_procctl(endpoint_t ep, int param)
{
message m;
int result;
memset(&m, 0, sizeof(m));
m.VMPCTL_WHO = ep;
m.VMPCTL_PARAM = param;
result = _taskcall(VM_PROC_NR, VM_PROCCTL, &m);
return(result);
}