Merge branch 'refactor/decouple_esp_system_pthread' into 'master'

refactor(pthread): decouple pthread_init from esp_system

Closes IDF-8757

See merge request espressif/esp-idf!28909
pull/12800/head
Marius Vikhammer 2024-02-08 13:30:59 +08:00
commit 6afb652626
5 zmienionych plików z 9 dodań i 10 usunięć

Wyświetl plik

@ -69,7 +69,7 @@ else()
# link-time registration is used.
# [refactor-todo] esp_partition required for virtual efuse
# init code. Move to esp_efuse component.
pthread bootloader_support efuse esp_partition esp_pm
bootloader_support efuse esp_partition esp_pm
LDFRAGMENTS "linker.lf" "app.lf")
add_subdirectory(port)

Wyświetl plik

@ -46,7 +46,6 @@
#include "esp_private/pm_impl.h"
#endif
#include "esp_pthread.h"
#include "esp_private/esp_clk.h"
#include "esp_private/spi_flash_os.h"
#include "esp_private/brownout.h"
@ -157,11 +156,6 @@ ESP_SYSTEM_INIT_FN(init_newlib_time, CORE, BIT(0), 105)
return ESP_OK;
}
ESP_SYSTEM_INIT_FN(init_pthread, CORE, BIT(0), 120)
{
return esp_pthread_init();
}
#if !CONFIG_APP_BUILD_TYPE_PURE_RAM_APP
ESP_SYSTEM_INIT_FN(init_flash, CORE, BIT(0), 130)
{

Wyświetl plik

@ -50,7 +50,7 @@ CORE: 112: init_vfs_usj_sec in components/esp_driver_usb_serial_jtag/src/usb_ser
CORE: 114: init_vfs_console in components/vfs/vfs_console.c on BIT(0)
CORE: 115: init_newlib_stdio in components/newlib/newlib_init.c on BIT(0)
CORE: 120: init_pthread in components/esp_system/startup_funcs.c on BIT(0)
CORE: 120: init_pthread in components/pthread/pthread.c on BIT(0)
CORE: 130: init_flash in components/esp_system/startup_funcs.c on BIT(0)
CORE: 140: init_virtual_efuse in components/esp_system/startup_funcs.c on BIT(0)
CORE: 150: init_secure in components/esp_system/startup_funcs.c on BIT(0)

Wyświetl plik

@ -15,6 +15,7 @@
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/semphr.h"
#include "esp_private/startup_internal.h"
#if CONFIG_SPIRAM
#include "esp_private/freertos_idf_additions_priv.h"
#endif
@ -71,6 +72,11 @@ static void esp_pthread_cfg_key_destructor(void *value)
free(value);
}
ESP_SYSTEM_INIT_FN(init_pthread, CORE, BIT(0), 120)
{
return esp_pthread_init();
}
esp_err_t esp_pthread_init(void)
{
if (pthread_key_create(&s_pthread_cfg_key, esp_pthread_cfg_key_destructor) != 0) {

Wyświetl plik

@ -62,8 +62,7 @@ set(extra_components_which_shouldnt_be_included
# esp_partition is a new component for separated IDF partition APIs. Added due to its involvement in the spi_flash
# code. To be possibly removed (?)
esp_partition
# pthread is required by esp_system (for initialization only, can be made a weak dependency)
# and cxx. See also [refactor-todo] about cxx, can it work without pthread?
# pthread is required by cxx. See [refactor-todo] about cxx, can it work without pthread?
pthread
)