Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Use #ifdef _RUMPKERNEL for now to prefer copyout ov...



details:   https://anonhg.NetBSD.org/src/rev/8f0fa369eb20
branches:  trunk
changeset: 336991:8f0fa369eb20
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Mar 29 15:08:03 2015 +0000

description:
Use #ifdef _RUMPKERNEL for now to prefer copyout over kcopy in tests.

Gross -- please fix me if you have a better approach.

diffstat:

 sys/kern/subr_copy.c |  14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diffs (42 lines):

diff -r 8b1b968bd150 -r 8f0fa369eb20 sys/kern/subr_copy.c
--- a/sys/kern/subr_copy.c      Sun Mar 29 15:05:34 2015 +0000
+++ b/sys/kern/subr_copy.c      Sun Mar 29 15:08:03 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_copy.c,v 1.3 2015/03/29 15:05:34 riastradh Exp $  */
+/*     $NetBSD: subr_copy.c,v 1.4 2015/03/29 15:08:03 riastradh Exp $  */
 
 /*-
  * Copyright (c) 1997, 1998, 1999, 2002, 2007, 2008 The NetBSD Foundation, Inc.
@@ -79,7 +79,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_copy.c,v 1.3 2015/03/29 15:05:34 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_copy.c,v 1.4 2015/03/29 15:08:03 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/fcntl.h>
@@ -211,6 +211,11 @@
        if (len == 0)
                return (0);
 
+#ifdef _RUMPKERNEL             /* XXX */
+       if (__predict_true(vm == curproc->p_vmspace)) {
+               return copyin(uaddr, kaddr, len);
+       }
+#endif
        if (VMSPACE_IS_KERNEL_P(vm)) {
                return kcopy(uaddr, kaddr, len);
        }
@@ -244,6 +249,11 @@
        if (len == 0)
                return (0);
 
+#ifdef _RUMPKERNEL             /* XXX */
+       if (__predict_true(vm == curproc->p_vmspace)) {
+               return copyout(kaddr, uaddr, len);
+       }
+#endif
        if (VMSPACE_IS_KERNEL_P(vm)) {
                return kcopy(kaddr, uaddr, len);
        }



Home | Main Index | Thread Index | Old Index