hal: Deprecate soc_hal.h and soc_ll.h interface

This commit marks all functions in soc_hal.h and soc_ll.h as deprecated.
Users should use functions from esp_cpu.h instead.

Also added missing wrap funcions for esp_cpu_stall() in test_panic.c files.
This commit is contained in:
Guillaume Souchere 2022-07-21 19:39:21 +08:00 committed by Darian Leung
parent 6005cc9163
commit dcae121d80
7 changed files with 39 additions and 38 deletions

View File

@ -8,7 +8,6 @@
/*
Note: This is a compatibility header. Call the interfaces in esp_cpu.h instead
[refactor-todo]: Mark all API in this header as deprecated
*/
#include "soc/soc_caps.h"

View File

@ -8,7 +8,6 @@
/*
Note: This is a compatibility header. Call the interfaces in esp_cpu.h instead
[refactor-todo]: Mark all API in this header as deprecated
*/
#include "esp_attr.h"
@ -18,17 +17,17 @@ Note: This is a compatibility header. Call the interfaces in esp_cpu.h instead
extern "C" {
#endif
FORCE_INLINE_ATTR void soc_ll_stall_core(int core)
FORCE_INLINE_ATTR __attribute__((deprecated)) void soc_ll_stall_core(int core)
{
esp_cpu_stall(core);
}
FORCE_INLINE_ATTR void soc_ll_unstall_core(int core)
FORCE_INLINE_ATTR __attribute__((deprecated)) void soc_ll_unstall_core(int core)
{
esp_cpu_unstall(core);
}
FORCE_INLINE_ATTR void soc_ll_reset_core(int core)
FORCE_INLINE_ATTR __attribute__((deprecated)) void soc_ll_reset_core(int core)
{
esp_cpu_reset(core);
}

View File

@ -2089,9 +2089,7 @@ tools/test_apps/system/gdb_loadable_elf/main/hello_world_main.c
tools/test_apps/system/longjmp_test/app_test.py
tools/test_apps/system/longjmp_test/main/hello_world_main.c
tools/test_apps/system/memprot/app_test.py
tools/test_apps/system/memprot/main/esp32c3/test_panic.c
tools/test_apps/system/memprot/main/esp32s2/test_memprot_main.c
tools/test_apps/system/memprot/main/esp32s2/test_panic.c
tools/test_apps/system/monitor_ide_integration/app_test.py
tools/test_apps/system/monitor_ide_integration/main/main.c
tools/test_apps/system/no_embedded_paths/check_for_file_paths.py

View File

@ -7,6 +7,6 @@ if((IDF_TARGET STREQUAL "esp32s2") OR (IDF_TARGET STREQUAL "esp32c3") OR (IDF_TA
target_link_libraries(${project_elf} PRIVATE
"-Wl,--wrap=esp_panic_handler"
"-Wl,--wrap=esp_panic_handler_reconfigure_wdts"
"-Wl,--wrap=soc_hal_stall_core")
"-Wl,--wrap=esp_cpu_stall")
endif()

View File

@ -1,16 +1,8 @@
// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "riscv/rvruntime-frames.h"
#include "esp_private/panic_internal.h"
@ -21,6 +13,7 @@ extern void esp_panic_handler(panic_info_t *info);
volatile bool g_override_illegal_instruction = false;
void __real_esp_panic_handler(panic_info_t *info);
void __real_esp_cpu_stall(int core_id);
void return_from_panic_handler(RvExcFrame *frm) __attribute__((noreturn));
@ -50,3 +43,12 @@ void __wrap_esp_panic_handler(panic_info_t *info)
__real_esp_panic_handler(info);
}
}
void __wrap_esp_cpu_stall(int core_id)
{
if ( g_override_illegal_instruction == true ) {
return;
} else {
__real_esp_cpu_stall(core_id);
}
}

View File

@ -1,16 +1,8 @@
// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "freertos/xtensa_context.h"
#include "esp_private/panic_internal.h"
@ -19,6 +11,7 @@ extern void esp_panic_handler(panic_info_t *info);
extern volatile bool g_override_illegal_instruction;
void __real_esp_panic_handler(panic_info_t *info);
void __real_esp_cpu_stall(int core_id);
/* Memprot test specific IllegalInstruction exception handler:
* when testing the protection against a code execution, sample code
@ -41,3 +34,12 @@ void __wrap_esp_panic_handler(panic_info_t *info)
__real_esp_panic_handler(info);
}
}
void __wrap_esp_cpu_stall(int core_id)
{
if ( g_override_illegal_instruction == true ) {
return;
} else {
__real_esp_cpu_stall(core_id);
}
}

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -13,7 +13,8 @@ extern volatile bool g_override_illegal_instruction;
void __real_esp_panic_handler(panic_info_t *info);
void __real_esp_panic_handler_reconfigure_wdts(void);
void __real_soc_hal_stall_core(int core);
void __real_esp_cpu_stall(int core_id);
static void disable_all_wdts(void)
{
@ -68,11 +69,11 @@ void __wrap_esp_panic_handler_reconfigure_wdts(void)
}
}
void __wrap_soc_hal_stall_core(int core)
void __wrap_esp_cpu_stall(int core_id)
{
if ( g_override_illegal_instruction == true ) {
return;
} else {
__real_soc_hal_stall_core(core);
__real_esp_cpu_stall(core_id);
}
}