]> Zhao Yanbai Git Server - minix.git/commitdiff
vm stubs; no more sys_vm_setbuf
authorBen Gras <ben@minix3.org>
Mon, 21 Sep 2009 14:42:58 +0000 (14:42 +0000)
committerBen Gras <ben@minix3.org>
Mon, 21 Sep 2009 14:42:58 +0000 (14:42 +0000)
lib/syslib/Makefile.in
lib/syslib/alloc_util.c
lib/syslib/sys_fork.c
lib/syslib/sys_vm_setbuf.c [deleted file]
lib/syslib/sys_vmctl.c
lib/syslib/vm_ctl.c [new file with mode: 0644]
lib/syslib/vm_notify_sig.c [new file with mode: 0644]

index c8882352f3d4ae2dd504288f47830bdca57ecdda..3fc7305e346ca9f64553dd248646c222474c5a11 100644 (file)
@@ -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 \
index a2a5bd7619fff31aecb50b09869bb93aa3e95442..52d7792e55bc4b3108050256f208c21c328f6237 100644 (file)
@@ -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;
 
index 8aef1b8caa5af25d81fdeaf0eccca4fb0ad25b80..1aa4c90347f9dd5349dc1afedf8f4b617b5335f3 100755 (executable)
@@ -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 (file)
index ade00cc..0000000
+++ /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);
-}
-
index a98d765743f092b488a66d8f9f8a403d093442d5..29f27e2438f5b6c0f313505dca946292ef52004e 100755 (executable)
@@ -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 (file)
index 0000000..545d5cc
--- /dev/null
@@ -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);
+}
+
diff --git a/lib/syslib/vm_notify_sig.c b/lib/syslib/vm_notify_sig.c
new file mode 100644 (file)
index 0000000..3325d6b
--- /dev/null
@@ -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);
+}
+