Skip to content

Commit f6c17cb

Browse files
committed
Merge branch 'feature/add_exec_caps_to_iram_region' into 'master'
feat(heap): Add executable caps to IRAM region See merge request sdk/ESP8266_RTOS_SDK!1589
2 parents e4d4998 + 5d980e2 commit f6c17cb

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

components/heap/include/esp_heap_caps.h

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ extern "C" {
3131
*/
3232
#define HEAP_ALIGN(ptr) (((size_t)ptr + (HEAP_ALIGN_SIZE - 1)) & ~(HEAP_ALIGN_SIZE - 1))
3333

34+
#define MALLOC_CAP_EXEC (1 << 0) ///< Memory must be able to run executable code
3435
#define MALLOC_CAP_32BIT (1 << 1) ///< Memory must allow for aligned 32-bit data accesses
3536
#define MALLOC_CAP_8BIT (1 << 2) ///< Memory must allow for 8-bit data accesses
3637
#define MALLOC_CAP_DMA (1 << 3) ///< Memory must be able to accessed by DMA

components/heap/port/esp8266/esp_heap_init.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ void heap_caps_init(void)
4646
if (iram_size > HEAP_REGION_IRAM_MIN && iram_size < HEAP_REGION_IRAM_MAX) {
4747
g_heap_region[heap_region_num].start_addr = (uint8_t *)&_iram_end;
4848
g_heap_region[heap_region_num].total_size = iram_size;
49-
g_heap_region[heap_region_num].caps = MALLOC_CAP_32BIT;
49+
g_heap_region[heap_region_num].caps = MALLOC_CAP_32BIT | MALLOC_CAP_EXEC;
5050
heap_region_num++;
5151
}
5252
#endif

0 commit comments

Comments
 (0)