From 50177dbae18a22c450dfef179b1aa1d48c5c76b2 Mon Sep 17 00:00:00 2001 From: Masayuki Ishikawa Date: Thu, 25 Aug 2022 09:16:10 +0900 Subject: [PATCH] arch: common: Fix arm_allocateheap.c for BUILD_KERNEL Summary: - I noticed that the kernel heap area overlaps the PGPOOL - This commit fixes this issue Impact: - None Testing: - Tested with sabre-6quad:netknsh Signed-off-by: Masayuki Ishikawa --- arch/arm/src/common/arm_allocateheap.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm/src/common/arm_allocateheap.c b/arch/arm/src/common/arm_allocateheap.c index 4d571fc3a0..ef28edc828 100644 --- a/arch/arm/src/common/arm_allocateheap.c +++ b/arch/arm/src/common/arm_allocateheap.c @@ -131,8 +131,14 @@ void weak_function up_allocate_heap(void **heap_start, size_t *heap_size) board_autoled_on(LED_HEAPALLOCATE); *heap_start = (void *)g_idle_topstack; + +#ifdef CONFIG_ARCH_PGPOOL_PBASE + *heap_size = CONFIG_ARCH_PGPOOL_PBASE - g_idle_topstack; +#else *heap_size = CONFIG_RAM_END - g_idle_topstack; #endif + +#endif } /****************************************************************************