summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_uio.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/subr_uio.c')
-rw-r--r--sys/kern/subr_uio.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/sys/kern/subr_uio.c b/sys/kern/subr_uio.c
index 9b93005..77156f1 100644
--- a/sys/kern/subr_uio.c
+++ b/sys/kern/subr_uio.c
@@ -158,8 +158,7 @@ uiomove(void *cp, int n, struct uio *uio)
switch (uio->uio_segflg) {
case UIO_USERSPACE:
- if (ticks - PCPU_GET(switchticks) >= hogticks)
- uio_yield();
+ maybe_yield();
if (uio->uio_rw == UIO_READ)
error = copyout(cp, iov->iov_base, cnt);
else
@@ -283,11 +282,8 @@ uiomoveco(void *cp, int n, struct uio *uio, int disposable)
switch (uio->uio_segflg) {
case UIO_USERSPACE:
- if (ticks - PCPU_GET(switchticks) >= hogticks)
- uio_yield();
-
+ maybe_yield();
error = userspaceco(cp, cnt, uio, disposable);
-
if (error)
return (error);
break;
@@ -356,20 +352,6 @@ again:
return (0);
}
-void
-uio_yield(void)
-{
- struct thread *td;
-
- td = curthread;
- DROP_GIANT();
- thread_lock(td);
- sched_prio(td, td->td_user_pri);
- mi_switch(SW_INVOL | SWT_RELINQUISH, NULL);
- thread_unlock(td);
- PICKUP_GIANT();
-}
-
int
copyinfrom(const void * __restrict src, void * __restrict dst, size_t len,
int seg)
OpenPOWER on IntegriCloud