[PATCH 03/28] arm: introduce arch_zone_limits_init()

Mike Rapoport
2025-12-28T12:41:06Z

arch/arm/mm/init.c | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 54bdca025c9f..bdcc3639681f 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -107,18 +107,23 @@ void __init setup_dma_zone(const struct machine_desc *mdesc)
#endif
}

-static void __init zone_sizes_init(unsigned long min, unsigned long max_low,
- unsigned long max_high)
+void __init arch_zone_limits_init(unsigned long *max_zone_pfn)
{
- unsigned long max_zone_pfn[MAX_NR_ZONES] = { 0 };
-
#ifdef CONFIG_ZONE_DMA
- max_zone_pfn[ZONE_DMA] = min(arm_dma_pfn_limit, max_low);
+ max_zone_pfn[ZONE_DMA] = min(arm_dma_pfn_limit, max_low_pfn);
#endif
- max_zone_pfn[ZONE_NORMAL] = max_low;
+ max_zone_pfn[ZONE_NORMAL] = max_low_pfn;
#ifdef CONFIG_HIGHMEM
- max_zone_pfn[ZONE_HIGHMEM] = max_high;
+ max_zone_pfn[ZONE_HIGHMEM] = max_pfn;
#endif
+}
+
+static void __init zone_sizes_init(unsigned long min, unsigned long max_low,
+ unsigned long max_high)
+{
+ unsigned long max_zone_pfn[MAX_NR_ZONES] = { 0 };
+
+ arch_zone_limits_init(max_zone_pfn);
free_area_init(max_zone_pfn);
}

--
2.51.0