vm stubs; no more sys_vm_setbuf
This commit is contained in:
parent
c9fee544b6
commit
348978e64a
7 changed files with 55 additions and 24 deletions
|
@ -66,7 +66,6 @@ libsys_FILES=" \
|
||||||
sys_vinl.c \
|
sys_vinl.c \
|
||||||
sys_vinw.c \
|
sys_vinw.c \
|
||||||
sys_vircopy.c \
|
sys_vircopy.c \
|
||||||
sys_vm_setbuf.c \
|
|
||||||
sys_vmctl.c \
|
sys_vmctl.c \
|
||||||
sys_voutb.c \
|
sys_voutb.c \
|
||||||
sys_voutl.c \
|
sys_voutl.c \
|
||||||
|
@ -76,8 +75,10 @@ libsys_FILES=" \
|
||||||
ds.c \
|
ds.c \
|
||||||
vm_allocmem.c \
|
vm_allocmem.c \
|
||||||
vm_brk.c \
|
vm_brk.c \
|
||||||
|
vm_ctl.c \
|
||||||
vm_exec_newmem.c \
|
vm_exec_newmem.c \
|
||||||
vm_exit.c \
|
vm_exit.c \
|
||||||
|
vm_notify_sig.c \
|
||||||
vm_fork.c \
|
vm_fork.c \
|
||||||
vm_map_phys.c \
|
vm_map_phys.c \
|
||||||
vm_umap.c \
|
vm_umap.c \
|
||||||
|
|
|
@ -29,6 +29,8 @@ void *alloc_contig(size_t len, int flags, phys_bytes *phys)
|
||||||
|
|
||||||
if(flags & AC_LOWER16M)
|
if(flags & AC_LOWER16M)
|
||||||
mmapflags |= MAP_LOWER16M;
|
mmapflags |= MAP_LOWER16M;
|
||||||
|
if(flags & AC_LOWER1M)
|
||||||
|
mmapflags |= MAP_LOWER1M;
|
||||||
if(flags & AC_ALIGN64K)
|
if(flags & AC_ALIGN64K)
|
||||||
mmapflags |= MAP_ALIGN64K;
|
mmapflags |= MAP_ALIGN64K;
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
#include "syslib.h"
|
#include "syslib.h"
|
||||||
|
|
||||||
PUBLIC int sys_fork(parent, child, child_endpoint, map_ptr, flags)
|
PUBLIC int sys_fork(parent, child, child_endpoint, map_ptr, flags, msgaddr)
|
||||||
endpoint_t parent; /* process doing the fork */
|
endpoint_t parent; /* process doing the fork */
|
||||||
endpoint_t child; /* which proc has been created by the fork */
|
endpoint_t child; /* which proc has been created by the fork */
|
||||||
int *child_endpoint;
|
int *child_endpoint;
|
||||||
struct mem_map *map_ptr;
|
struct mem_map *map_ptr;
|
||||||
u32_t flags;
|
u32_t flags;
|
||||||
|
vir_bytes *msgaddr;
|
||||||
{
|
{
|
||||||
/* A process has forked. Tell the kernel. */
|
/* A process has forked. Tell the kernel. */
|
||||||
|
|
||||||
|
@ -18,5 +19,6 @@ u32_t flags;
|
||||||
m.PR_FORK_FLAGS = flags;
|
m.PR_FORK_FLAGS = flags;
|
||||||
r = _taskcall(SYSTASK, SYS_FORK, &m);
|
r = _taskcall(SYSTASK, SYS_FORK, &m);
|
||||||
*child_endpoint = m.PR_ENDPT;
|
*child_endpoint = m.PR_ENDPT;
|
||||||
|
*msgaddr = m.PR_FORK_MSGADDR;
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
#include "syslib.h"
|
|
||||||
|
|
||||||
/*===========================================================================*
|
|
||||||
* sys_vm_setbuf *
|
|
||||||
*===========================================================================*/
|
|
||||||
PUBLIC int sys_vm_setbuf(base, size, high)
|
|
||||||
phys_bytes base;
|
|
||||||
phys_bytes size;
|
|
||||||
phys_bytes high;
|
|
||||||
{
|
|
||||||
message m;
|
|
||||||
int result;
|
|
||||||
|
|
||||||
m.m4_l1= base;
|
|
||||||
m.m4_l2= size;
|
|
||||||
m.m4_l3= high;
|
|
||||||
|
|
||||||
result = _taskcall(SYSTASK, SYS_VM_SETBUF, &m);
|
|
||||||
return(result);
|
|
||||||
}
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ PUBLIC int sys_vmctl_get_cr3_i386(endpoint_t who, u32_t *cr3)
|
||||||
}
|
}
|
||||||
|
|
||||||
PUBLIC int sys_vmctl_get_memreq(endpoint_t *who, vir_bytes *mem,
|
PUBLIC int sys_vmctl_get_memreq(endpoint_t *who, vir_bytes *mem,
|
||||||
vir_bytes *len, int *wrflag)
|
vir_bytes *len, int *wrflag, endpoint_t *requestor)
|
||||||
{
|
{
|
||||||
message m;
|
message m;
|
||||||
int r;
|
int r;
|
||||||
|
@ -56,7 +56,16 @@ PUBLIC int sys_vmctl_get_memreq(endpoint_t *who, vir_bytes *mem,
|
||||||
*mem = (vir_bytes) m.SVMCTL_MRG_ADDR;
|
*mem = (vir_bytes) m.SVMCTL_MRG_ADDR;
|
||||||
*len = m.SVMCTL_MRG_LEN;
|
*len = m.SVMCTL_MRG_LEN;
|
||||||
*wrflag = m.SVMCTL_MRG_WRITE;
|
*wrflag = m.SVMCTL_MRG_WRITE;
|
||||||
|
*requestor = (endpoint_t) m.SVMCTL_MRG_REQUESTOR;
|
||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PUBLIC int sys_vmctl_enable_paging(struct mem_map *map)
|
||||||
|
{
|
||||||
|
message m;
|
||||||
|
m.SVMCTL_WHO = SELF;
|
||||||
|
m.SVMCTL_PARAM = VMCTL_ENABLE_PAGING;
|
||||||
|
m.SVMCTL_VALUE = (int) map;
|
||||||
|
return _taskcall(SYSTASK, SYS_VMCTL, &m);
|
||||||
|
}
|
||||||
|
|
18
lib/syslib/vm_ctl.c
Normal file
18
lib/syslib/vm_ctl.c
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
|
||||||
|
#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);
|
||||||
|
}
|
||||||
|
|
20
lib/syslib/vm_notify_sig.c
Normal file
20
lib/syslib/vm_notify_sig.c
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
|
||||||
|
#include "syslib.h"
|
||||||
|
|
||||||
|
#include <minix/vm.h>
|
||||||
|
|
||||||
|
/*===========================================================================*
|
||||||
|
* vm_notify_sig *
|
||||||
|
*===========================================================================*/
|
||||||
|
PUBLIC int vm_notify_sig(endpoint_t ep, endpoint_t ipc_ep)
|
||||||
|
{
|
||||||
|
message m;
|
||||||
|
int result;
|
||||||
|
|
||||||
|
m.VM_NOTIFY_SIG_ENDPOINT = ep;
|
||||||
|
m.VM_NOTIFY_SIG_IPC = ipc_ep;
|
||||||
|
|
||||||
|
result = _taskcall(VM_PROC_NR, VM_NOTIFY_SIG, &m);
|
||||||
|
return(result);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue