From nobody Mon May 18 21:28:20 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4gK9s04jgyz6cqLL for ; Mon, 18 May 2026 21:28:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gK9s01TP8z3gs0 for ; Mon, 18 May 2026 21:28:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1779139700; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4Cg73CODKtfd9c6vDuurpobVL8c1h/k6kcoYwzF6q5s=; b=IfB3KQwgjeGM7lPzh7WqDyBN3D2et8S8rpB5AIw0vIr10ItghiXbuLthdRngtJMpL44FvS LU5sMo41JWhXJSE/RDG2ZJRR18yCDCfBrcM6YPVRLXl8ZNV2lMwVBQa+vKS0zmiKrwWXhr OYSBq4ZuV0iblqa1MPENlaGvobpZDPq7+M68Jcl0mfZdYiIxzykuNeTmC+lU6pAoJZ9AXw qy5F4PzUEzrEjSvi/vYxs4CunOU5wkgJEof+h92t2ZRvTPwuYGqEpaH/LnsYFh7pu2q9B7 HrAaUwWpX/0bvH6nUtR1mI5MtSYAreWFOehCk7jC5cewFHEZ9no7uGHZzSQgaw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1779139700; a=rsa-sha256; cv=none; b=qs0KR0gnNeKJoqp/H0Fq7QbFGA0PQH7RrCvIAZl98B6iSGSOvKW88NEJajW/WNBpGO0oMF 12iTu3BcRcptiiOCIaFwIjFVOTP128/IsGa2rjxRNdNShoImtZuV2Un/S8orlvzLRFOJpS uEoF4b3t48OIrQ9FXbocw/BVII67blThvMw2jktjo2M+zhvlpTgms1X0R9v1QWfh4dAZv1 hiGiYBfk49FmzTtFtd1ZCEKLJHN3a7E4/f+H88bBhh02gYfLZBIYyFqsh42BfY4OnKCnj7 s7PtiPkyTj2YBcw9iP6GVGh+2IuntZbwNpm9ALxZ1QOdKMrrhwMMvXTxjHGzIA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1779139700; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4Cg73CODKtfd9c6vDuurpobVL8c1h/k6kcoYwzF6q5s=; b=QN8+2dW0VQN3+bOIETk9O9N3ySerKj1BzMUrC70eWo8mLkc3tGN6cSwk4VJEt/klMW2nOK Q+kr3IEq6xO1xPooglz3PBCETbGRoj1akJBjaaB2OmTNxjH85yeZFHoNfEmPv7m/Crfsss DMj8ltfxxACqLAHqEILUkmtSbcmIJB+E6C6RsKwZmJzUlTcRcbNSd7uiVEt3NmDJGM/GcL KOaU9G46LjpdVwItU8DzhlHNSWbszo/r2c4Y0otTZhgJUMzP/56MYLrtdNaZaT1GUWwCJR EuFV1fPV6itIvE8znxtYm1htuaoLbsDQcFJdYilTWGvG98KUOsXU/Jq4G7KsQA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gK9s012wrzls5 for ; Mon, 18 May 2026 21:28:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 41208 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 18 May 2026 21:28:20 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 3ae682909950 - stable/15 - uio.9: Document uiomove_fromphys() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 3ae6829099507245f6d7a661fe1500451716a09b Auto-Submitted: auto-generated Date: Mon, 18 May 2026 21:28:20 +0000 Message-Id: <6a0b8474.41208.6a94426b@gitrepo.freebsd.org> The branch stable/15 has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=3ae6829099507245f6d7a661fe1500451716a09b commit 3ae6829099507245f6d7a661fe1500451716a09b Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2026-03-20 07:52:28 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2026-05-18 21:28:03 +0000 uio.9: Document uiomove_fromphys() Reviewed by: kib Discussed with: markj, royger MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D54070 (cherry picked from commit 076e44839160f74f96fda83fa81c3acb41b9ebc8) --- share/man/man9/Makefile | 1 + share/man/man9/uio.9 | 45 ++++++++++++++++++++++++++++++++++----------- 2 files changed, 35 insertions(+), 11 deletions(-) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 2ecc511c8523..0bdb66f32c65 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -2324,6 +2324,7 @@ MLINKS+=uidinfo.9 uifind.9 \ uidinfo.9 uihold.9 MLINKS+=uio.9 uiomove.9 \ uio.9 uiomove_frombuf.9 \ + uio.9 uiomove_fromphys.9 \ uio.9 uiomove_nofault.9 MLINKS+=unr.9 alloc_unr.9 \ unr.9 alloc_unrl.9 \ diff --git a/share/man/man9/uio.9 b/share/man/man9/uio.9 index b143eb6e8e62..a7563125a351 100644 --- a/share/man/man9/uio.9 +++ b/share/man/man9/uio.9 @@ -23,13 +23,14 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd October 22, 2025 +.Dd May 7, 2026 .Dt UIO 9 .Os .Sh NAME .Nm uio , .Nm uiomove , .Nm uiomove_frombuf , +.Nm uiomove_fromphys , .Nm uiomove_nofault .Nd device driver I/O routines .Sh SYNOPSIS @@ -37,25 +38,29 @@ .In sys/uio.h .Bd -literal struct uio { - struct iovec *uio_iov; /* scatter/gather list */ - int uio_iovcnt; /* length of scatter/gather list */ - off_t uio_offset; /* offset in target object */ - ssize_t uio_resid; /* remaining bytes to copy */ - enum uio_seg uio_segflg; /* address space */ - enum uio_rw uio_rw; /* operation */ - struct thread *uio_td; /* owner */ + struct iovec *uio_iov; /* scatter/gather list */ + int uio_iovcnt; /* length of scatter/gather list */ + off_t uio_offset; /* offset in target object */ + ssize_t uio_resid; /* remaining bytes to process */ + enum uio_seg uio_segflg; /* address space */ + enum uio_rw uio_rw; /* operation */ + struct thread *uio_td; /* owner */ }; .Ed +.Pp .Ft int .Fn uiomove "void *buf" "int howmuch" "struct uio *uiop" .Ft int .Fn uiomove_frombuf "void *buf" "int howmuch" "struct uio *uiop" .Ft int +.Fn uiomove_fromphys "vm_page_t ma[]" "vm_offset_t offset" "int howmuch" "struct uio *uiop" +.Ft int .Fn uiomove_nofault "void *buf" "int howmuch" "struct uio *uiop" .Sh DESCRIPTION The functions .Fn uiomove , .Fn uiomove_frombuf , +.Fn uiomove_fromphys , and .Fn uiomove_nofault are used to transfer data between buffers and I/O vectors that might @@ -152,10 +157,27 @@ When .Va uio_offset is greater than or equal to the buffer size, the result is success with no bytes transferred, effectively signaling EOF. +.Pp +The +.Fn uiomove_fromphys +function provides a machine-independent way to copy memory +to and from the physical address space. +The +.Fa "ma[]" +argument is an array of physical pages. +Every physical page address in the array provides +a page-sized chunk of the physical space. +The +.Fa "offset" +argument is the offset into the +.Fa "ma[]" +array. +In particular, the offset does not have to lie within the first page. .Sh RETURN VALUES On success .Fn uiomove , .Fn uiomove_frombuf , +.Fn uiomove_fromphys , and .Fn uiomove_nofault will return 0; on error they will return an appropriate error code. @@ -168,7 +190,7 @@ will not work (the buffer pointer is not being advanced in case of a partial read), it is just here to demonstrate the .Nm handling. -.Bd -literal +.Bd -literal -offset 2n /* MIN() can be found there: */ #include @@ -200,7 +222,8 @@ fooread(struct cdev *dev, struct uio *uio, int flag) } .Ed .Sh ERRORS -.Fn uiomove +.Fn uiomove , +.Fn uiomove_fromphys and .Fn uiomove_nofault will fail and return the following error code if: @@ -211,7 +234,7 @@ The invoked or .Xr copyout 9 returned -.Er EFAULT +.Er EFAULT . .El .Pp In addition,