uio_machdep.c (fdafd315ad0d0f28a11b9fb4476a9ab059c62b92) uio_machdep.c (473c90ac04cec0abbb414978c53e9c259c9129e8)
1/*-
2 * SPDX-License-Identifier: BSD-3-Clause
3 *
4 * Copyright (c) 2004 Alan L. Cox <alc@cs.rice.edu>
5 * Copyright (c) 1982, 1986, 1991, 1993
6 * The Regents of the University of California. All rights reserved.
7 * (c) UNIX System Laboratories, Inc.
8 * All or some portions of this file are derived from material licensed

--- 83 unchanged lines hidden (view full) ---

92 if (uio->uio_segflg != UIO_NOCOPY) {
93 mapped = pmap_map_io_transient(
94 &ma[offset >> PAGE_SHIFT], &vaddr, 1, true);
95 cp = (char *)vaddr + page_offset;
96 }
97 switch (uio->uio_segflg) {
98 case UIO_USERSPACE:
99 maybe_yield();
1/*-
2 * SPDX-License-Identifier: BSD-3-Clause
3 *
4 * Copyright (c) 2004 Alan L. Cox <alc@cs.rice.edu>
5 * Copyright (c) 1982, 1986, 1991, 1993
6 * The Regents of the University of California. All rights reserved.
7 * (c) UNIX System Laboratories, Inc.
8 * All or some portions of this file are derived from material licensed

--- 83 unchanged lines hidden (view full) ---

92 if (uio->uio_segflg != UIO_NOCOPY) {
93 mapped = pmap_map_io_transient(
94 &ma[offset >> PAGE_SHIFT], &vaddr, 1, true);
95 cp = (char *)vaddr + page_offset;
96 }
97 switch (uio->uio_segflg) {
98 case UIO_USERSPACE:
99 maybe_yield();
100 if (uio->uio_rw == UIO_READ)
100 switch (uio->uio_rw) {
101 case UIO_READ:
101 error = copyout(cp, iov->iov_base, cnt);
102 error = copyout(cp, iov->iov_base, cnt);
102 else
103 break;
104 case UIO_WRITE:
103 error = copyin(iov->iov_base, cp, cnt);
105 error = copyin(iov->iov_base, cp, cnt);
106 break;
107 }
104 if (error)
105 goto out;
106 break;
107 case UIO_SYSSPACE:
108 if (error)
109 goto out;
110 break;
111 case UIO_SYSSPACE:
108 if (uio->uio_rw == UIO_READ)
112 switch (uio->uio_rw) {
113 case UIO_READ:
109 bcopy(cp, iov->iov_base, cnt);
114 bcopy(cp, iov->iov_base, cnt);
110 else
115 break;
116 case UIO_WRITE:
111 bcopy(iov->iov_base, cp, cnt);
117 bcopy(iov->iov_base, cp, cnt);
118 break;
119 }
112 break;
113 case UIO_NOCOPY:
114 break;
115 }
116 if (__predict_false(mapped)) {
117 pmap_unmap_io_transient(&ma[offset >> PAGE_SHIFT],
118 &vaddr, 1, true);
119 mapped = false;

--- 16 unchanged lines hidden ---
120 break;
121 case UIO_NOCOPY:
122 break;
123 }
124 if (__predict_false(mapped)) {
125 pmap_unmap_io_transient(&ma[offset >> PAGE_SHIFT],
126 &vaddr, 1, true);
127 mapped = false;

--- 16 unchanged lines hidden ---