Source-Changes-HG archive

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

[src/trunk]: src/sys/kern uiomove(): if we're informed that we should yield t...



details:   https://anonhg.NetBSD.org/src/rev/a5ff5f02544e
branches:  trunk
changeset: 484043:a5ff5f02544e
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Thu Mar 23 20:39:58 2000 +0000

description:
uiomove(): if we're informed that we should yield the CPU, use the new
preempt() primitive to do so.

diffstat:

 sys/kern/kern_subr.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (32 lines):

diff -r 5bc10299f7a4 -r a5ff5f02544e sys/kern/kern_subr.c
--- a/sys/kern/kern_subr.c      Thu Mar 23 20:37:58 2000 +0000
+++ b/sys/kern/kern_subr.c      Thu Mar 23 20:39:58 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_subr.c,v 1.61 2000/03/16 17:19:53 jdolecek Exp $  */
+/*     $NetBSD: kern_subr.c,v 1.62 2000/03/23 20:39:58 thorpej Exp $   */
 
 /*-
  * Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc.
@@ -124,11 +124,12 @@
        u_int cnt;
        int error = 0;
        char *cp = buf;
+       struct proc *p = uio->uio_procp;
 
 #ifdef DIAGNOSTIC
        if (uio->uio_rw != UIO_READ && uio->uio_rw != UIO_WRITE)
                panic("uiomove: mode");
-       if (uio->uio_segflg == UIO_USERSPACE && uio->uio_procp != curproc)
+       if (uio->uio_segflg == UIO_USERSPACE && p != curproc)
                panic("uiomove proc");
 #endif
        while (n > 0 && uio->uio_resid) {
@@ -144,6 +145,8 @@
                switch (uio->uio_segflg) {
 
                case UIO_USERSPACE:
+                       if (p->p_schedflags & PSCHED_SHOULDYIELD)
+                               preempt(NULL);
                        if (uio->uio_rw == UIO_READ)
                                error = copyout(cp, iov->iov_base, cnt);
                        else



Home | Main Index | Thread Index | Old Index