git: a6ffaf995b44 - stable/13 - linuxkpi: Add `kmap_local_page_prot()` and `kunmap_local()`

From: Jean-Sébastien Pédron <dumbbell_at_FreeBSD.org>
Date: Thu, 16 Feb 2023 11:56:14 UTC
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 <dumbbell@FreeBSD.org>
AuthorDate: 2023-01-20 17:52:39 +0000
Commit:     Jean-Sébastien Pédron <dumbbell@FreeBSD.org>
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_ */