forked from espressif/esp-idf
refactor(pthread): decouple pthread_init from esp_system
This commit is contained in:
@@ -69,7 +69,7 @@ else()
|
|||||||
# link-time registration is used.
|
# link-time registration is used.
|
||||||
# [refactor-todo] esp_partition required for virtual efuse
|
# [refactor-todo] esp_partition required for virtual efuse
|
||||||
# init code. Move to esp_efuse component.
|
# 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")
|
LDFRAGMENTS "linker.lf" "app.lf")
|
||||||
add_subdirectory(port)
|
add_subdirectory(port)
|
||||||
|
|
||||||
|
@@ -46,7 +46,6 @@
|
|||||||
#include "esp_private/pm_impl.h"
|
#include "esp_private/pm_impl.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "esp_pthread.h"
|
|
||||||
#include "esp_private/esp_clk.h"
|
#include "esp_private/esp_clk.h"
|
||||||
#include "esp_private/spi_flash_os.h"
|
#include "esp_private/spi_flash_os.h"
|
||||||
#include "esp_private/brownout.h"
|
#include "esp_private/brownout.h"
|
||||||
@@ -157,11 +156,6 @@ ESP_SYSTEM_INIT_FN(init_newlib_time, CORE, BIT(0), 105)
|
|||||||
return ESP_OK;
|
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
|
#if !CONFIG_APP_BUILD_TYPE_PURE_RAM_APP
|
||||||
ESP_SYSTEM_INIT_FN(init_flash, CORE, BIT(0), 130)
|
ESP_SYSTEM_INIT_FN(init_flash, CORE, BIT(0), 130)
|
||||||
{
|
{
|
||||||
|
@@ -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: 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: 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: 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: 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)
|
CORE: 150: init_secure in components/esp_system/startup_funcs.c on BIT(0)
|
||||||
|
@@ -15,6 +15,7 @@
|
|||||||
#include "freertos/FreeRTOS.h"
|
#include "freertos/FreeRTOS.h"
|
||||||
#include "freertos/task.h"
|
#include "freertos/task.h"
|
||||||
#include "freertos/semphr.h"
|
#include "freertos/semphr.h"
|
||||||
|
#include "esp_private/startup_internal.h"
|
||||||
#if CONFIG_SPIRAM
|
#if CONFIG_SPIRAM
|
||||||
#include "esp_private/freertos_idf_additions_priv.h"
|
#include "esp_private/freertos_idf_additions_priv.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -71,6 +72,11 @@ static void esp_pthread_cfg_key_destructor(void *value)
|
|||||||
free(value);
|
free(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ESP_SYSTEM_INIT_FN(init_pthread, CORE, BIT(0), 120)
|
||||||
|
{
|
||||||
|
return esp_pthread_init();
|
||||||
|
}
|
||||||
|
|
||||||
esp_err_t esp_pthread_init(void)
|
esp_err_t esp_pthread_init(void)
|
||||||
{
|
{
|
||||||
if (pthread_key_create(&s_pthread_cfg_key, esp_pthread_cfg_key_destructor) != 0) {
|
if (pthread_key_create(&s_pthread_cfg_key, esp_pthread_cfg_key_destructor) != 0) {
|
||||||
|
@@ -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
|
# 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 (?)
|
# code. To be possibly removed (?)
|
||||||
esp_partition
|
esp_partition
|
||||||
# pthread is required by esp_system (for initialization only, can be made a weak dependency)
|
# pthread is required by cxx. See [refactor-todo] about cxx, can it work without pthread?
|
||||||
# and cxx. See also [refactor-todo] about cxx, can it work without pthread?
|
|
||||||
pthread
|
pthread
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user