feat(heap): move TLSF ROM patches and related files from esp_rom to heap

The TLSF ROM patch code (rom_patch_tlsf.c, rom_patch_multi_heap.c),
their headers, and the per-target *.rom.heap.ld linker scripts are
semantically owned by the heap component, not esp_rom. Move them
accordingly:

- components/esp_rom/patches/esp_rom_tlsf.c
  → components/heap/rom_patches/rom_patch_tlsf.c
- components/esp_rom/patches/esp_rom_multi_heap.c
  → components/heap/rom_patches/rom_patch_multi_heap.c
- components/esp_rom/include/esp_rom_tlsf.h
  → components/heap/rom_patches/include/rom_patch_tlsf.h
- components/esp_rom/include/esp_rom_multi_heap.h
  → components/heap/rom_patches/include/rom_patch_multi_heap.h
- components/esp_rom/<target>/ld/<target>.rom.heap.ld (×8)
  → components/heap/port/<target>/ld/<target>.rom.heap.ld

Update heap/CMakeLists.txt to:
- use target_linker_script() directly for *.rom.heap.ld
- guard post-registration ROM patch setup with NOT BOOTLOADER_BUILD
- drop stale CONFIG_HEAP_TLSF_CHECK_PATCH symbol reference
- drop esp_rom_include_multi_heap_patch from TLSF_CHECK_PATCH guard

Remove the corresponding entries from esp_rom/CMakeLists.txt.
This commit is contained in:
Guillaume Souchere
2026-04-23 12:21:31 +02:00
parent 3f3ef6f08e
commit a56354e9ab
27 changed files with 50 additions and 45 deletions
@@ -58,6 +58,7 @@ list(APPEND srcs "common/multi_heap.c")
# TLSF implementation for heap
list(APPEND include "${heap_dir}/tlsf")
list(APPEND include "${heap_dir}/rom_patches/include")
# esp_app_desc_t configuration structure for TEE
list(APPEND srcs "common/esp_app_desc_tee.c")
@@ -6,7 +6,7 @@
#include <assert.h>
#include <stdio.h>
#include <stdbool.h>
#include "esp_rom_tlsf.h"
#include "rom_patch_tlsf.h"
#include "esp_rom_sys.h"
#include "tlsf_block_functions.h"
#include "multi_heap.h"
@@ -13,6 +13,9 @@ set(ld_output "${CMAKE_CURRENT_BINARY_DIR}/ld/esp_tee.ld")
target_linker_script(${COMPONENT_LIB} INTERFACE "${ld_output}")
idf_component_get_property(heap_dir heap COMPONENT_DIR)
target_linker_script(${COMPONENT_LIB} INTERFACE "${heap_dir}/port/${target}/ld/${target}.rom.heap.ld")
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/ld")
# Preprocess esp_tee.ld.in linker script to include configuration, becomes esp_tee.ld