From: Ben Gras Date: Mon, 21 Sep 2009 14:42:58 +0000 (+0000) Subject: vm stubs; no more sys_vm_setbuf X-Git-Tag: v3.1.5~129 X-Git-Url: http://zhaoyanbai.com/repos/?a=commitdiff_plain;h=348978e64a5f732bf77a9aebed4226b554cfd0dd;p=minix.git vm stubs; no more sys_vm_setbuf --- diff --git a/lib/syslib/Makefile.in b/lib/syslib/Makefile.in index c8882352f..3fc7305e3 100644 --- a/lib/syslib/Makefile.in +++ b/lib/syslib/Makefile.in @@ -66,7 +66,6 @@ libsys_FILES=" \ sys_vinl.c \ sys_vinw.c \ sys_vircopy.c \ - sys_vm_setbuf.c \ sys_vmctl.c \ sys_voutb.c \ sys_voutl.c \ @@ -76,8 +75,10 @@ libsys_FILES=" \ ds.c \ vm_allocmem.c \ vm_brk.c \ + vm_ctl.c \ vm_exec_newmem.c \ vm_exit.c \ + vm_notify_sig.c \ vm_fork.c \ vm_map_phys.c \ vm_umap.c \ diff --git a/lib/syslib/alloc_util.c b/lib/syslib/alloc_util.c index a2a5bd761..52d7792e5 100644 --- a/lib/syslib/alloc_util.c +++ b/lib/syslib/alloc_util.c @@ -29,6 +29,8 @@ void *alloc_contig(size_t len, int flags, phys_bytes *phys) if(flags & AC_LOWER16M) mmapflags |= MAP_LOWER16M; + if(flags & AC_LOWER1M) + mmapflags |= MAP_LOWER1M; if(flags & AC_ALIGN64K) mmapflags |= MAP_ALIGN64K; diff --git a/lib/syslib/sys_fork.c b/lib/syslib/sys_fork.c index 8aef1b8ca..1aa4c9034 100755 --- a/lib/syslib/sys_fork.c +++ b/lib/syslib/sys_fork.c @@ -1,11 +1,12 @@ #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 child; /* which proc has been created by the fork */ int *child_endpoint; struct mem_map *map_ptr; u32_t flags; +vir_bytes *msgaddr; { /* A process has forked. Tell the kernel. */ @@ -18,5 +19,6 @@ u32_t flags; m.PR_FORK_FLAGS = flags; r = _taskcall(SYSTASK, SYS_FORK, &m); *child_endpoint = m.PR_ENDPT; + *msgaddr = m.PR_FORK_MSGADDR; return r; } diff --git a/lib/syslib/sys_vm_setbuf.c b/lib/syslib/sys_vm_setbuf.c deleted file mode 100644 index ade00cc62..000000000 --- a/lib/syslib/sys_vm_setbuf.c +++ /dev/null @@ -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); -} - diff --git a/lib/syslib/sys_vmctl.c b/lib/syslib/sys_vmctl.c index a98d76574..29f27e243 100755 --- a/lib/syslib/sys_vmctl.c +++ b/lib/syslib/sys_vmctl.c @@ -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, - vir_bytes *len, int *wrflag) + vir_bytes *len, int *wrflag, endpoint_t *requestor) { message m; 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; *len = m.SVMCTL_MRG_LEN; *wrflag = m.SVMCTL_MRG_WRITE; + *requestor = (endpoint_t) m.SVMCTL_MRG_REQUESTOR; } 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); +} diff --git a/lib/syslib/vm_ctl.c b/lib/syslib/vm_ctl.c new file mode 100644 index 000000000..545d5cce5 --- /dev/null +++ b/lib/syslib/vm_ctl.c @@ -0,0 +1,18 @@ + +#include "syslib.h" + +#include + +/*===========================================================================* + * 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); +} + diff --git a/lib/syslib/vm_notify_sig.c b/lib/syslib/vm_notify_sig.c new file mode 100644 index 000000000..3325d6bb7 --- /dev/null +++ b/lib/syslib/vm_notify_sig.c @@ -0,0 +1,20 @@ + +#include "syslib.h" + +#include + +/*===========================================================================* + * 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); +} +