esp32_allocateheap.c: Adjust the region of the heap coming from the

external memory when a BSS section is allowed to reside there.

Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
This commit is contained in:
Abdelatif Guettouche
2021-03-11 15:19:02 +01:00
committed by YAMAMOTO Takashi
parent cc23bdeca4
commit fcafacb9a3
2 changed files with 12 additions and 5 deletions
+3 -1
View File
@@ -69,10 +69,12 @@
#define RTC_RODATA_ATTR __attribute__((section(".rtc.rodata")))
/* Forces bss variable into external memory. */
/* Allow bss variables into external memory. */
#ifdef CONFIG_XTENSA_EXTMEM_BSS
# define EXT_RAM_ATTR __attribute__((section(".extmem.bss")))
#else
# define EXT_RAM_ATTR
#endif
#endif /* __ARCH_XTENSA_SRC_COMMON_XTENSA_ATTR_H */
+9 -4
View File
@@ -148,11 +148,16 @@ void xtensa_add_region(void)
umm_addregion(start, size);
#endif
#if defined(CONFIG_ESP32_SPIRAM)
/* Check for any additional memory regions */
#ifdef CONFIG_ESP32_SPIRAM
# if defined(CONFIG_HEAP2_BASE) && defined(CONFIG_HEAP2_SIZE)
umm_addregion((FAR void *)CONFIG_HEAP2_BASE, CONFIG_HEAP2_SIZE);
# ifdef CONFIG_XTENSA_EXTMEM_BSS
start = (FAR void *)(&_ebss_extmem);
size = CONFIG_HEAP2_SIZE - (size_t)(&_ebss_extmem - &_sbss_extmem);
# else
start = (FAR void *)CONFIG_HEAP2_BASE;
size = CONFIG_HEAP2_SIZE;
# endif
umm_addregion(start, size);
# endif
#endif
}