fix(heap): Fix wrong config to enable MALLOC_CAP_EXEC in memory_layout.c

In esp32c2 and esp32c61 memory_layout.c files, the config used to allow
MALLOC_CAP_EXEC was CONFIG_ESP_SYSTEM_MEMPROT_FEATURE when
CONFIG_ESP_SYSTEM_PMP_IDRAM_SPLIT should be used.

Closes https://github.com/espressif/esp-idf/issues/14836
This commit is contained in:
Guillaume Souchere
2024-11-21 12:05:11 +01:00
parent aa07a85df2
commit a5eb9f34e1
4 changed files with 20 additions and 14 deletions

View File

@@ -15,7 +15,7 @@
#define ALLOC_SZ 1024
#ifndef CONFIG_ESP_SYSTEM_MEMPROT_FEATURE
#if !(CONFIG_ESP_SYSTEM_MEMPROT_FEATURE || CONFIG_ESP_SYSTEM_PMP_IDRAM_SPLIT)
static void *malloc_block_diram(uint32_t caps)
{
void *attempts[256] = { 0 }; // Allocate up to 256 ALLOC_SZ blocks to exhaust all non-D/IRAM memory temporarily
@@ -78,4 +78,4 @@ TEST_CASE("Allocate D/IRAM as IRAM", "[heap][qemu-ignore]")
free(iram);
}
#endif // CONFIG_ESP_SYSTEM_MEMPROT_FEATURE
#endif // !(CONFIG_ESP_SYSTEM_MEMPROT_FEATURE || CONFIG_ESP_SYSTEM_PMP_IDRAM_SPLIT)