Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 May 2025 15:45:03 GMT
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 789aed31dc84 - main - subr_devmap: Make devmap_ptov static
Message-ID:  <202505021545.542Fj34W097620@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by andrew:

URL: https://cgit.FreeBSD.org/src/commit/?id=789aed31dc840765416e88066c027e8f56c292a3

commit 789aed31dc840765416e88066c027e8f56c292a3
Author:     Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2025-05-02 15:34:17 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2025-05-02 15:39:04 +0000

    subr_devmap: Make devmap_ptov static
    
    The devmap_ptov and devmap_vtop functions are only used in this file.
    
    Reviewed by:    mhorne
    Sponsored by:   Arm Ltd
    Differential Revision:  https://reviews.freebsd.org/D50015
---
 sys/kern/subr_devmap.c |  6 ++++--
 sys/sys/devmap.h       | 14 --------------
 2 files changed, 4 insertions(+), 16 deletions(-)

diff --git a/sys/kern/subr_devmap.c b/sys/kern/subr_devmap.c
index 1592db1790d5..79f3c75269ca 100644
--- a/sys/kern/subr_devmap.c
+++ b/sys/kern/subr_devmap.c
@@ -41,6 +41,8 @@
 #include <machine/pte.h>
 #endif
 
+#define	DEVMAP_PADDR_NOTFOUND	((vm_paddr_t)(-1))
+
 static const struct devmap_entry *devmap_table;
 static boolean_t devmap_bootstrap_done = false;
 
@@ -198,7 +200,7 @@ devmap_bootstrap(void)
  * Look up the given physical address in the static mapping data and return the
  * corresponding virtual address, or NULL if not found.
  */
-void *
+static void *
 devmap_ptov(vm_paddr_t pa, vm_size_t size)
 {
 	const struct devmap_entry *pd;
@@ -218,7 +220,7 @@ devmap_ptov(vm_paddr_t pa, vm_size_t size)
  * Look up the given virtual address in the static mapping data and return the
  * corresponding physical address, or DEVMAP_PADDR_NOTFOUND if not found.
  */
-vm_paddr_t
+static vm_paddr_t
 devmap_vtop(void * vpva, vm_size_t size)
 {
 	const struct devmap_entry *pd;
diff --git a/sys/sys/devmap.h b/sys/sys/devmap.h
index 914bec31af4c..69e696a20fc9 100644
--- a/sys/sys/devmap.h
+++ b/sys/sys/devmap.h
@@ -76,20 +76,6 @@ void devmap_register_table(const struct devmap_entry * _table);
  */
 void devmap_bootstrap(void);
 
-/*
- * Translate between virtual and physical addresses within a region that is
- * static-mapped by the devmap code.  If the given address range isn't
- * static-mapped, then ptov returns NULL and vtop returns DEVMAP_PADDR_NOTFOUND.
- * The latter implies that you can't vtop just the last byte of physical address
- * space.  This is not as limiting as it might sound, because even if a device
- * occupies the end of the physical address space, you're only prevented from
- * doing vtop for that single byte.  If you vtop a size bigger than 1 it works.
- */
-#define	DEVMAP_PADDR_NOTFOUND	((vm_paddr_t)(-1))
-
-void *     devmap_ptov(vm_paddr_t _pa, vm_size_t _sz);
-vm_paddr_t devmap_vtop(void * _va, vm_size_t _sz);
-
 /* Print the static mapping table; used for bootverbose output. */
 void devmap_print_table(void);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202505021545.542Fj34W097620>