vmrequest = caller;
}
+/*===========================================================================*
+ * vm_check_range *
+ *===========================================================================*/
+PUBLIC int vm_check_range(struct proc *caller, struct proc *target,
+ vir_bytes vir_addr, size_t bytes)
+{
+ /* Public interface to vm_suspend(), for use by kernel calls. On behalf
+ * of 'caller', call into VM to check linear virtual address range of
+ * process 'target', starting at 'vir_addr', for 'bytes' bytes. This
+ * function assumes that it will called twice if VM returned an error
+ * the first time (since nothing has changed in that case), and will
+ * then return the error code resulting from the first call. Upon the
+ * first call, a non-success error code is returned as well.
+ */
+ int r;
+
+ if (!vm_running)
+ return EFAULT;
+
+ if ((caller->p_misc_flags & MF_KCALL_RESUME) &&
+ (r = caller->p_vmrequest.vmresult) != OK)
+ return r;
+
+ vm_suspend(caller, target, vir_addr, bytes, VMSTYPE_KERNELCALL);
+
+ return VMSUSPEND;
+}
+
/*===========================================================================*
* delivermsg *
*===========================================================================*/
_PROTOTYPE( int vm_lookup, (const struct proc *proc, vir_bytes virtual, phys_bytes *result, u32_t *ptent));
_PROTOTYPE( size_t vm_lookup_range, (const struct proc *proc,
vir_bytes vir_addr, phys_bytes *phys_addr, size_t bytes) );
+_PROTOTYPE( int vm_check_range, (struct proc *caller,
+ struct proc *target, vir_bytes vir_addr, size_t bytes) );
_PROTOTYPE( void delivermsg, (struct proc *target));
_PROTOTYPE( void arch_do_syscall, (struct proc *proc) );
_PROTOTYPE( int arch_phys_map, (int index, phys_bytes *addr,