diff --git a/arch/arm/src/mps/mps_allocateheap.c b/arch/arm/src/mps/mps_allocateheap.c index 65db21b8cbaef..f3f135f59fd40 100644 --- a/arch/arm/src/mps/mps_allocateheap.c +++ b/arch/arm/src/mps/mps_allocateheap.c @@ -198,6 +198,7 @@ void up_allocate_heap(void **heap_start, size_t *heap_size) } # if defined(CONFIG_MM_KERNEL_HEAP) + *heap_start += CONFIG_MM_KERNEL_HEAPSIZE; *heap_size -= CONFIG_MM_KERNEL_HEAPSIZE; # endif @@ -249,23 +250,8 @@ void up_allocate_kheap(void **heap_start, size_t *heap_size) *heap_start = (void *)USERSPACE->us_bssend; *heap_size = ubase - (uintptr_t)USERSPACE->us_bssend; # else - if (g_idle_topstack > MPS_SRAM1_START + MPS_SRAM1_SIZE) - { - /* If the range of SRAM1 is exceeded, we think that the extern REGION - * is enabled - */ - - *heap_size = PRIMARY_RAM_END - g_idle_topstack; - } - else - { - *heap_size = MPS_SRAM1_START + MPS_SRAM1_SIZE - g_idle_topstack; - } - - *heap_size -= CONFIG_MM_KERNEL_HEAPSIZE; - *heap_start = (void *)g_idle_topstack + *heap_size; + *heap_start = (void *)g_idle_topstack; *heap_size = CONFIG_MM_KERNEL_HEAPSIZE; - # endif } #endif