[PATCH v2 09/28] microblaze: introduce arch_zone_limits_init()
Mike Rapoport
rppt at kernel.org
Fri Jan 2 17:59:45 AEDT 2026
From: "Mike Rapoport (Microsoft)" <rppt at kernel.org>
Move calculations of zone limits to a dedicated arch_zone_limits_init()
function.
Later MM core will use this function as an architecture specific callback
during nodes and zones initialization and thus there won't be a need to
call free_area_init() from every architecture.
Signed-off-by: Mike Rapoport (Microsoft) <rppt at kernel.org>
---
arch/microblaze/mm/init.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/arch/microblaze/mm/init.c b/arch/microblaze/mm/init.c
index 31d475cdb1c5..54da60b81094 100644
--- a/arch/microblaze/mm/init.c
+++ b/arch/microblaze/mm/init.c
@@ -54,6 +54,16 @@ static void __init highmem_init(void)
}
#endif /* CONFIG_HIGHMEM */
+void __init arch_zone_limits_init(unsigned long *max_zone_pfns)
+{
+#ifdef CONFIG_HIGHMEM
+ max_zone_pfns[ZONE_DMA] = max_low_pfn;
+ max_zone_pfns[ZONE_HIGHMEM] = max_pfn;
+#else
+ max_zone_pfns[ZONE_DMA] = max_pfn;
+#endif
+}
+
/*
* paging_init() sets up the page tables - in fact we've already done this.
*/
@@ -71,13 +81,8 @@ static void __init paging_init(void)
#ifdef CONFIG_HIGHMEM
highmem_init();
-
- zones_size[ZONE_DMA] = max_low_pfn;
- zones_size[ZONE_HIGHMEM] = max_pfn;
-#else
- zones_size[ZONE_DMA] = max_pfn;
#endif
-
+ arch_zone_limits_init(zones_size);
/* We don't have holes in memory map */
free_area_init(zones_size);
}
--
2.51.0
More information about the Linuxppc-dev
mailing list