mirror of
https://github.com/apache/nuttx.git
synced 2026-05-21 13:13:08 +08:00
mps_allocateheap:Modify the heap logic
Summary: Due to the modification of 4244610, the heap_size may be used on SRAM1, which can lead to misconfiguration problems for some mps qemu configurations (e.g.MPS3) that use extern DDR as the heap, refer to the previous issue VELAPLATFO-34555. Signed-off-by: chenrun1 <chenrun1@xiaomi.com> Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
@@ -174,7 +174,19 @@ void up_allocate_heap(void **heap_start, size_t *heap_size)
|
||||
/* Return the heap settings */
|
||||
|
||||
*heap_start = (void *)g_idle_topstack;
|
||||
*heap_size = MPS_SRAM1_START + MPS_SRAM1_SIZE - g_idle_topstack;
|
||||
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;
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user