devmap: eliminate unused arguments

The optional 'table' pointer is a legacy part of the interface, which
has been replaced by devmap_register_table()/devmap_add_entry(). The few
in-tree callers have already adapted to this, so it can be removed.

The 'l1pt' argument is already entirely unused within the function.

Reviewed by:	andrew, markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D45319
This commit is contained in:
Mitchell Horne
2024-06-04 20:17:47 -03:00
parent 191e6a6049
commit 5df74441b3
5 changed files with 10 additions and 20 deletions
+1 -1
View File
@@ -551,7 +551,7 @@ initarm(struct arm_boot_params *abp)
/* Establish static device mappings. */ /* Establish static device mappings. */
err_devmap = platform_devmap_init(); err_devmap = platform_devmap_init();
devmap_bootstrap(0, NULL); devmap_bootstrap();
vm_max_kernel_address = platform_lastaddr(); vm_max_kernel_address = platform_lastaddr();
/* /*
+1 -1
View File
@@ -996,7 +996,7 @@ initarm(struct arm64_bootparams *abp)
physmem_init_kernel_globals(); physmem_init_kernel_globals();
devmap_bootstrap(0, NULL); devmap_bootstrap();
valid = bus_probe(); valid = bus_probe();
+4 -13
View File
@@ -165,28 +165,19 @@ devmap_register_table(const struct devmap_entry *table)
/* /*
* Map all of the static regions in the devmap table, and remember the devmap * Map all of the static regions in the devmap table, and remember the devmap
* table so the mapdev, ptov, and vtop functions can do lookups later. * table so the mapdev, ptov, and vtop functions can do lookups later.
*
* If a non-NULL table pointer is given it is used unconditionally, otherwise
* the previously-registered table is used. This smooths transition from legacy
* code that fills in a local table then calls this function passing that table,
* and newer code that uses devmap_register_table() in platform-specific
* code, then lets the common platform-specific init function call this function
* with a NULL pointer.
*/ */
void void
devmap_bootstrap(vm_offset_t l1pt, const struct devmap_entry *table) devmap_bootstrap(void)
{ {
const struct devmap_entry *pd; const struct devmap_entry *pd;
devmap_bootstrap_done = true; devmap_bootstrap_done = true;
/* /*
* If given a table pointer, use it. Otherwise, if a table was * If a table was previously registered, use it. Otherwise, no work to
* previously registered, use it. Otherwise, no work to do. * do.
*/ */
if (table != NULL) if (devmap_table == NULL)
devmap_table = table;
else if (devmap_table == NULL)
return; return;
for (pd = devmap_table; pd->pd_size != 0; ++pd) { for (pd = devmap_table; pd->pd_size != 0; ++pd) {
+1 -1
View File
@@ -568,7 +568,7 @@ initriscv(struct riscv_bootparams *rvbp)
physmem_init_kernel_globals(); physmem_init_kernel_globals();
/* Establish static device mappings */ /* Establish static device mappings */
devmap_bootstrap(0, NULL); devmap_bootstrap();
cninit(); cninit();
+3 -4
View File
@@ -71,11 +71,10 @@ void devmap_register_table(const struct devmap_entry * _table);
* Establish mappings for all the entries in the table. This is called * Establish mappings for all the entries in the table. This is called
* automatically from the common platform-specific init function in * automatically from the common platform-specific init function in
* <ARCH>/machdep.c, and also from the custom platform-specific init routines * <ARCH>/machdep.c, and also from the custom platform-specific init routines
* in older code. If the table pointer is NULL, this will use the table * in older code. This function only has an effect when a table was installed
* installed previously by devmap_register_table(). * previously by devmap_register_table().
*/ */
void devmap_bootstrap(vm_offset_t _l1pt, void devmap_bootstrap(void);
const struct devmap_entry *_table);
/* /*
* Translate between virtual and physical addresses within a region that is * Translate between virtual and physical addresses within a region that is