From nobody Mon Jan 30 22:17:40 2023 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 4P5Mxc3ZhGz3bGkc; Mon, 30 Jan 2023 22:17:40 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P5Mxc35hMz4CZR; Mon, 30 Jan 2023 22:17:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675117060; 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=8XkjfCLn5Yb2tzpmrJCTbVR2IYzFAaZA/fiXBvy1h4s=; b=odadeda+/rtDgl69LqJfkwSKPoWNxPv+FXY7/mDXffNpgBSjc/tZ+2vBq4qEolxdXaIHrl G0JwGWSmieDkGpUS+ZtNyMKz5iBBP1r9uhlVXQtVX65svxrPpiP2TqyvGc4ZUrw18SwQtp lby00V/GG85i8g1csNXOFbOezD7Iq1EAUF0to2exMkHBG+0IAEuMQsSSCmgsPuMj53rsHT hl88ovI83vri5wa4umUZ4DnQ+vvKszV/Nz3o+RjwWDirVqhrK2oZqKbQ4ApunjsakvoALZ r+D5xgkTKGngmZSw6lJUfZQ/C9ZuRzxkd8JQtnjJdCmGi3dyzPg4Dr1n/pGnlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675117060; 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=8XkjfCLn5Yb2tzpmrJCTbVR2IYzFAaZA/fiXBvy1h4s=; b=q69S2BZWyy3MNQQ4sciJ7ZyYcXiSQpePqdUIeKjMimziydCyxsVRRyyzLCmLLz6Y8xlndw 7FTYcZhNTkETCcakT2OiROe3L1QuirBxFQb63vR7fzH/nMATVCxJXJlTBfXCUxqXXag/z0 p6CUVn6l/qliKOjMPJ5GlZZsuRyFmqW86/Cgo4rqA57DswpWl0XqIIpgSWAK5pEnWThTTl FMjEFFXsK7DNR8nUOGZBbhbEDJQoltNWiQ6mj8yJ9nAD5hs5B05NvS96cNWx+Z/61362mG W8wE9Bgg11F03ynF+G1Bmo7yABeTzJF9MrTmYczzBaOlsLS6U1j/8MAb50z5yw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675117060; a=rsa-sha256; cv=none; b=vTlpb/fMI7+YDtMhe1GOQiTjsnUc0HOYceFDa97isOaCR9PokiohfDyOGnP5RrdAqPp54M wxWeYku1WeHNc6GTqOkUvyPEx7hg3QoEsthlsNrsW1LMLv4cLQP+4sW3eGvA2rjoo+TPFT sExHXTb2gpT52UAU51lWywEuv9qp2EG1e5o2yFuXRvX5xL4pgEzbLVbssgiWRi51DYfGNO gjvhmxeLKlEab+DIRH8hRCGgpt9BUKBfpnTBiHXdrN1qCL9OAHHm7ojUR2elxVByhw/qEA ZMjLScPVe5A5SX+uejmUWJSADfbkMmaJIuQtZGvl4n6mFt7YpgkjNLyAHUZJYA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P5Mxc25PSzPxn; Mon, 30 Jan 2023 22:17:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30UMHeGd060346; Mon, 30 Jan 2023 22:17:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30UMHeCx060345; Mon, 30 Jan 2023 22:17:40 GMT (envelope-from git) Date: Mon, 30 Jan 2023 22:17:40 GMT Message-Id: <202301302217.30UMHeCx060345@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Subject: git: 9dafbd0c69a6 - main - linuxkpi: Add `kmap_local_page_prot()` and `kunmap_local()` 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9dafbd0c69a6aade69b23a649548b6c7133f1091 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=9dafbd0c69a6aade69b23a649548b6c7133f1091 commit 9dafbd0c69a6aade69b23a649548b6c7133f1091 Author: Jean-Sébastien Pédron AuthorDate: 2023-01-20 17:52:39 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2023-01-30 22:09:22 +0000 linuxkpi: Add `kmap_local_page_prot()` and `kunmap_local()` They are synonymous to `kmap_atomic_prot()` and `kunmap_atomic()` respectively. While here, fix several style(9) issues. Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D38155 --- sys/compat/linuxkpi/common/include/linux/highmem.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/highmem.h b/sys/compat/linuxkpi/common/include/linux/highmem.h index 53efbec06385..0056b590f239 100644 --- a/sys/compat/linuxkpi/common/include/linux/highmem.h +++ b/sys/compat/linuxkpi/common/include/linux/highmem.h @@ -50,6 +50,7 @@ static inline vm_page_t kmap_to_page(void *addr) { + return (virt_to_page(addr)); } @@ -88,9 +89,17 @@ kmap_atomic_prot(vm_page_t page, pgprot_t prot) static inline void * kmap_atomic(vm_page_t page) { + return (kmap_atomic_prot(page, VM_PROT_ALL)); } +static inline void * +kmap_local_page_prot(vm_page_t page, pgprot_t prot) +{ + + return (kmap_atomic_prot(page, prot)); +} + static inline void kunmap(vm_page_t page) { @@ -111,8 +120,16 @@ kunmap(vm_page_t page) static inline void kunmap_atomic(void *vaddr) { + if (!PMAP_HAS_DMAP) kunmap(virt_to_page(vaddr)); } +static inline void +kunmap_local(void *addr) +{ + + kunmap_atomic(addr); +} + #endif /* _LINUXKPI_LINUX_HIGHMEM_H_ */