startup: namespaced start_app and start_app_other_core to avoid user code collision

This commit is contained in:
Felipe Neves 2020-08-31 14:00:46 -03:00
parent a1e5dd58b2
commit e67162a7ea
4 changed files with 11 additions and 19 deletions

View File

@ -4,13 +4,6 @@ entries:
panic (noflash)
panic_handler (noflash)
reset_reason (noflash)
system_api:esp_system_abort (noflash)
startup:do_secondary_init(default)
startup:start_cpu0_default(default)
startup:do_core_init(default)
startup:do_system_init_fn(default)
startup:start_cpu_other_cores_default(default)
startup:do_global_ctors(default)
if ESP_CONSOLE_USB_CDC_SUPPORT_ETS_PRINTF:
usb_console:esp_usb_console_write_char (noflash)

View File

@ -81,7 +81,7 @@
uint64_t g_startup_time = 0;
// App entry point for core 0
extern void start_app(void);
extern void esp_startup_start_app(void);
// Entry point for core 0 from hardware init (port layer)
void start_cpu0(void) __attribute__((weak, alias("start_cpu0_default"))) __attribute__((noreturn));
@ -91,7 +91,7 @@ void start_cpu0(void) __attribute__((weak, alias("start_cpu0_default"))) __attri
void start_cpu_other_cores(void) __attribute__((weak, alias("start_cpu_other_cores_default"))) __attribute__((noreturn));
// App entry point for core [1..X]
void start_app_other_cores(void) __attribute__((weak, alias("start_app_other_cores_default"))) __attribute__((noreturn));
void esp_startup_start_app_other_cores(void) __attribute__((weak, alias("esp_startup_start_app_other_cores_default"))) __attribute__((noreturn));
static volatile bool s_system_inited[SOC_CPU_CORES_NUM] = { false };
@ -159,7 +159,7 @@ static void do_system_init_fn(void)
}
#if !CONFIG_ESP_SYSTEM_SINGLE_CORE_MODE
static void IRAM_ATTR start_app_other_cores_default(void)
static void esp_startup_start_app_other_cores_default(void)
{
while (1) {
esp_rom_delay_us(UINT32_MAX);
@ -174,7 +174,7 @@ static void start_cpu_other_cores_default(void)
esp_rom_delay_us(100);
}
start_app_other_cores();
esp_startup_start_app_other_cores();
}
#endif
@ -304,7 +304,7 @@ static void do_secondary_init(void)
#endif
}
void start_cpu0_default(void)
static void start_cpu0_default(void)
{
ESP_EARLY_LOGI(TAG, "Pro cpu start user code");
@ -353,7 +353,7 @@ void start_cpu0_default(void)
s_system_full_inited = true;
#endif
start_app();
esp_startup_start_app();
while (1);
}

View File

@ -112,7 +112,6 @@ entries:
queue: xQueueAddToSet (default)
queue: xQueueRemoveFromSet (default)
queue: xQueueSelectFromSet (default)
port:start_app(default)
port:main_task(default)
port:start_app_other_cores(default)
port:xPortStartScheduler(default)
port:main_task (default)
port:esp_startup_start_app (default)
port:esp_startup_start_app_other_cores (default)

View File

@ -547,7 +547,7 @@ static void main_task(void* args)
#if !CONFIG_FREERTOS_UNICORE
void start_app_other_cores(void)
void esp_startup_start_app_other_cores(void)
{
// For now, we only support up to two core: 0 and 1.
if (xPortGetCoreID() >= 2) {
@ -581,7 +581,7 @@ void start_app_other_cores(void)
}
#endif
void start_app(void)
void esp_startup_start_app(void)
{
#if CONFIG_ESP_INT_WDT
esp_int_wdt_init();