esp-rom: create a patch of tlsf_check() for target(s) supporting ROM implementation of TLSF

The tlsf implementation in the ROM does not provide a mechanism
to register a callback to be called in by tlsf_check().

This commit is creating a patch of the tlsf implementation to provide
a definition of the function allowing to register the callback called
in tlsf_check() and add the call of this callback in tlsf_check().

This patch is only compiled for target(s) with ESP_ROM_HAS_HEAP_TLSF
set and ESP_ROM_TLSF_CHECK_PATCH set. For all the other configurations
the environment remains unchanged by those modifications.
This commit is contained in:
Guillaume Souchere
2022-08-12 11:28:16 +02:00
parent f051da86e2
commit b9abad7a89
6 changed files with 262 additions and 2 deletions
+3 -2
View File
@@ -25,8 +25,8 @@
#include "tlsf.h"
#else
/* Header containing the declaration of tlsf_poison_fill_pfunc_set()
* used to register multi_heap_internal_poison_fill_region() as a
* callback to fill memory region with given patterns in the heap
* and tlsf_poison_check_pfunc_set() used to register callbacks to
* fill and check memory region with given patterns in the heap
* components.
*/
#include "rom/tlsf.h"
@@ -361,6 +361,7 @@ multi_heap_handle_t multi_heap_register(void *start, size_t size)
#endif
#ifdef CONFIG_HEAP_TLSF_USE_ROM_IMPL
tlsf_poison_fill_pfunc_set(multi_heap_internal_poison_fill_region);
tlsf_poison_check_pfunc_set(multi_heap_internal_check_block_poisoning);
#endif
return multi_heap_register_impl(start, size);
}