libc/common: Refine check for xtensa _heap_sentry

Not all xtensa targets define the top of usable RAM via the _heap_sentry
address; it looks like the list is limited to esp32, esp32s2, esp32s3 and
intel parts. The first three all define HAS_ESPRESSIF_HAL, so key the test
using that or SOC_FAMILY_INTEL_ADSP.

Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Keith Packard 2023-05-09 09:58:38 -07:00 committed by Stephanos Ioannidis
parent 706d9f6db2
commit f74455127d

View File

@ -99,7 +99,8 @@ static POOL_SECTION unsigned char __aligned(HEAP_ALIGN) malloc_arena[HEAP_SIZE];
# define HEAP_BASE ROUND_UP(USED_RAM_END_ADDR, HEAP_ALIGN)
# ifdef CONFIG_XTENSA
# if defined(CONFIG_XTENSA) && (defined(CONFIG_SOC_FAMILY_INTEL_ADSP) \
|| defined(CONFIG_HAS_ESPRESSIF_HAL))
extern char _heap_sentry[];
# define HEAP_SIZE ROUND_DOWN((POINTER_TO_UINT(_heap_sentry) - HEAP_BASE), HEAP_ALIGN)
# else