summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMike Rapoport (Microsoft) <rppt@kernel.org>2026-03-23 10:20:42 +0300
committerMike Rapoport (Microsoft) <rppt@kernel.org>2026-04-01 11:19:45 +0300
commit8b7b85384fad6e21e8a28628e7ebacb5a6329de4 (patch)
tree0ba30c2976dfdd5a92ce8631b77bc5e7327e8a1e /tools
parent0709682cdb4ac77e3f78ea9c10d7f74b41a12518 (diff)
downloadlinux-8b7b85384fad6e21e8a28628e7ebacb5a6329de4.tar.xz
memblock: move reserve_bootmem_range() to memblock.c and make it static
reserve_bootmem_region() is only called from memmap_init_reserved_pages() and it was in mm/mm_init.c because of its dependecies on static init_deferred_page(). Since init_deferred_page() is not static anymore, move reserve_bootmem_region(), rename it to memmap_init_reserved_range() and make it static. Update the comment describing it to better reflect what the function does and drop bogus comment about reserved pages in free_bootmem_page(). Update memblock test stubs to reflect the core changes. Reviewed-by: Lorenzo Stoakes (Oracle) <ljs@kernel.org> Reviewed-by: David Hildenbrand (Arm) <david@kernel.org> Link: https://patch.msgid.link/20260323072042.3651061-1-rppt@kernel.org Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/include/linux/mm.h2
-rw-r--r--tools/testing/memblock/internal.h9
-rw-r--r--tools/testing/memblock/mmzone.c4
3 files changed, 9 insertions, 6 deletions
diff --git a/tools/include/linux/mm.h b/tools/include/linux/mm.h
index 028f3faf46e7..74cbd51dbea2 100644
--- a/tools/include/linux/mm.h
+++ b/tools/include/linux/mm.h
@@ -32,8 +32,6 @@ static inline phys_addr_t virt_to_phys(volatile void *address)
return (phys_addr_t)address;
}
-void reserve_bootmem_region(phys_addr_t start, phys_addr_t end, int nid);
-
static inline void totalram_pages_inc(void)
{
}
diff --git a/tools/testing/memblock/internal.h b/tools/testing/memblock/internal.h
index 009b97bbdd22..eb02d5771f4c 100644
--- a/tools/testing/memblock/internal.h
+++ b/tools/testing/memblock/internal.h
@@ -29,4 +29,13 @@ static inline unsigned long free_reserved_area(void *start, void *end,
return 0;
}
+#define for_each_valid_pfn(pfn, start_pfn, end_pfn) \
+ for ((pfn) = (start_pfn); (pfn) < (end_pfn); (pfn)++)
+
+static inline void init_deferred_page(unsigned long pfn, int nid)
+{
+}
+
+#define __SetPageReserved(p) ((void)(p))
+
#endif
diff --git a/tools/testing/memblock/mmzone.c b/tools/testing/memblock/mmzone.c
index d3d58851864e..e719450f81cb 100644
--- a/tools/testing/memblock/mmzone.c
+++ b/tools/testing/memblock/mmzone.c
@@ -11,10 +11,6 @@ struct pglist_data *next_online_pgdat(struct pglist_data *pgdat)
return NULL;
}
-void reserve_bootmem_region(phys_addr_t start, phys_addr_t end, int nid)
-{
-}
-
void atomic_long_set(atomic_long_t *v, long i)
{
}