mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
refactor(heap): decouple heap_init from esp_system
This commit is contained in:
parent
5f85aefe0d
commit
e2144e01c1
@ -13,7 +13,6 @@
|
|||||||
#include "esp_check.h"
|
#include "esp_check.h"
|
||||||
#include "esp_system.h"
|
#include "esp_system.h"
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
#include "esp_heap_caps_init.h"
|
|
||||||
#include "spi_flash_mmap.h"
|
#include "spi_flash_mmap.h"
|
||||||
#include "esp_flash_internal.h"
|
#include "esp_flash_internal.h"
|
||||||
#include "esp_newlib.h"
|
#include "esp_newlib.h"
|
||||||
@ -69,12 +68,6 @@ ESP_SYSTEM_INIT_FN(init_show_cpu_freq, CORE, BIT(0), 10)
|
|||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
ESP_SYSTEM_INIT_FN(init_heap, CORE, BIT(0), 100)
|
|
||||||
{
|
|
||||||
heap_caps_init();
|
|
||||||
return ESP_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
ESP_SYSTEM_INIT_FN(init_psram_heap, CORE, BIT(0), 103)
|
ESP_SYSTEM_INIT_FN(init_psram_heap, CORE, BIT(0), 103)
|
||||||
{
|
{
|
||||||
#if CONFIG_SPIRAM_BOOT_INIT && (CONFIG_SPIRAM_USE_CAPS_ALLOC || CONFIG_SPIRAM_USE_MALLOC)
|
#if CONFIG_SPIRAM_BOOT_INIT && (CONFIG_SPIRAM_USE_CAPS_ALLOC || CONFIG_SPIRAM_USE_MALLOC)
|
||||||
|
@ -32,7 +32,7 @@ CORE: 21: init_efuse_show_app_info in components/efuse/src/esp_efuse_startup.c
|
|||||||
# With SPI RAM enabled, there's a second reason: half of the SPI RAM will be managed by the
|
# With SPI RAM enabled, there's a second reason: half of the SPI RAM will be managed by the
|
||||||
# app CPU, and when that is not up yet, the memory will be inaccessible and heap_caps_init may
|
# app CPU, and when that is not up yet, the memory will be inaccessible and heap_caps_init may
|
||||||
# fail initializing it properly.
|
# fail initializing it properly.
|
||||||
CORE: 100: init_heap in components/esp_system/startup_funcs.c on BIT(0)
|
CORE: 100: init_heap in components/heap/heap_caps_init.c on BIT(0)
|
||||||
|
|
||||||
# When apptrace module is enabled, there will be SEGGER_SYSVIEW calls in the newlib init.
|
# When apptrace module is enabled, there will be SEGGER_SYSVIEW calls in the newlib init.
|
||||||
# SEGGER_SYSVIEW relies on apptrace module
|
# SEGGER_SYSVIEW relies on apptrace module
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
|
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
@ -14,11 +14,19 @@
|
|||||||
#include "esp_heap_caps_init.h"
|
#include "esp_heap_caps_init.h"
|
||||||
#include "heap_memory_layout.h"
|
#include "heap_memory_layout.h"
|
||||||
|
|
||||||
|
#include "esp_private/startup_internal.h"
|
||||||
|
|
||||||
static const char *TAG = "heap_init";
|
static const char *TAG = "heap_init";
|
||||||
|
|
||||||
/* Linked-list of registered heaps */
|
/* Linked-list of registered heaps */
|
||||||
struct registered_heap_ll registered_heaps;
|
struct registered_heap_ll registered_heaps;
|
||||||
|
|
||||||
|
ESP_SYSTEM_INIT_FN(init_heap, CORE, BIT(0), 100)
|
||||||
|
{
|
||||||
|
heap_caps_init();
|
||||||
|
return ESP_OK;
|
||||||
|
}
|
||||||
|
|
||||||
static void register_heap(heap_t *region)
|
static void register_heap(heap_t *region)
|
||||||
{
|
{
|
||||||
size_t heap_size = region->end - region->start;
|
size_t heap_size = region->end - region->start;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user