From nobody Thu Feb 16 11:56:14 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 4PHYLn4M4Qz3q5p8; Thu, 16 Feb 2023 11:56:17 +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 4PHYLl2JwLz49bL; Thu, 16 Feb 2023 11:56:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676548575; 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=KSXwgFwaNknXci83HiLyD9gpg0nfQkiNrm17scKWbcY=; b=IeFP+juSAkGX+HbPljmW5xH+AwClNL76WIiLFXNpytHosTFzJLXHA3AWx8uGsYfHOM3oR1 eeJ88TRHc3WUfuF3HtZIgRGFkUmjr5FtdNKd8kmMhHblLV9kfN2JbIQU8e3vHrvvGa0B/i wNENOA2yZbco/ME4e3nvJzM2QCjA+R2ldFKyw1jNi/mE0E7dKCNw0I2+04BDmwTIA+tJ1m jd+xJ1jnJLQdHWlvwTyEUbT5vyb0SptnLGxS4JlunoBovyraQwbeHUcc23Bh2kwmXUkqLe FRoIW/BEL1X8pdOIBJsOHwc+EshAfwzBAvwBooiMCAbY/d8ar2gErv1w8Oj4cQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676548575; 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=KSXwgFwaNknXci83HiLyD9gpg0nfQkiNrm17scKWbcY=; b=mpVCbdDip1Ij0oyrVn/o6glSJcnbbE8yWYVJfbV1KYZC0wQGUNHNKQCRzgBy3ejOaZEUVv UViOfN+D7Y2mBw6mK8vNmkCCUBqEBN+Mv9Bhysts8MGKw01tdhmOOf3vFKi4BIWqXy4G9Z xAd3Dq/BFrPPoWOLxTbjYmaAthftTDw0ZLq2dRHvriLQb3NxElD12sMIXCwm5t2bejn4yX MsFlqepTDLouwPBG42Kamy/rAEpBIFWatts4RIcewEV+1D63+KzcDZ1L9edz8ci2zv6xS2 PVOni5PE1z+9x95x3XKk9X4cFO7pX6tVK4nDcCfWnulbHXMkklcNwRjeqnZY/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676548575; a=rsa-sha256; cv=none; b=RAeR88Z27OGlxn7yu1ZnxLfho+Ehaz0mY7p2gARw9BHLPnG1/w/nBbHxCWy0UJ7+fZmYli 6jjIRt5E0aLHEImoNmFctzSk4Brhb0vd6qIAImWaTvF7jZHe8e3LzLNkL2uiJB7cpUR8Sk +EDAoTKYTkiBAfPHjsLS6Vt0J7MxlHY7D2Ibx3JmwgAIHnGaluW17E3Wa39l97MAkjA1Zs ryV3iWR5siZS+3SAmFwREkVq+Aoejj4QsrbQm93+3K7Hb3MRSTLReIDOiHrmlVQaPmbA0A dGKs03mLJczDaZ9+oVC08UTI/hmeYVct4kq2Wz5APWylq5JWK+H21/Q6P/AaLA== 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 4PHYLk6sJxz13H9; Thu, 16 Feb 2023 11:56:14 +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 31GBuEYu055829; Thu, 16 Feb 2023 11:56:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31GBuEgS055828; Thu, 16 Feb 2023 11:56:14 GMT (envelope-from git) Date: Thu, 16 Feb 2023 11:56:14 GMT Message-Id: <202302161156.31GBuEgS055828@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Subject: git: a6ffaf995b44 - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: a6ffaf995b44553b65c8493af38d627d21bfb47d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=a6ffaf995b44553b65c8493af38d627d21bfb47d commit a6ffaf995b44553b65c8493af38d627d21bfb47d Author: Jean-Sébastien Pédron AuthorDate: 2023-01-20 17:52:39 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2023-02-16 11:55:17 +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 (cherry picked from commit 9dafbd0c69a6aade69b23a649548b6c7133f1091) --- 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_ */