diff --git a/components/esp_hw_support/include/hal/soc_hal.h b/components/esp_hw_support/include/hal/soc_hal.h index 42432d6eac..ef7ba764b4 100644 --- a/components/esp_hw_support/include/hal/soc_hal.h +++ b/components/esp_hw_support/include/hal/soc_hal.h @@ -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" diff --git a/components/esp_hw_support/include/hal/soc_ll.h b/components/esp_hw_support/include/hal/soc_ll.h index 4622cedd65..8b2cc870bc 100644 --- a/components/esp_hw_support/include/hal/soc_ll.h +++ b/components/esp_hw_support/include/hal/soc_ll.h @@ -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); } diff --git a/tools/ci/check_copyright_ignore.txt b/tools/ci/check_copyright_ignore.txt index 58a716a605..9d91c9d854 100644 --- a/tools/ci/check_copyright_ignore.txt +++ b/tools/ci/check_copyright_ignore.txt @@ -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 diff --git a/tools/test_apps/system/memprot/CMakeLists.txt b/tools/test_apps/system/memprot/CMakeLists.txt index d6516a0ca3..786665248b 100644 --- a/tools/test_apps/system/memprot/CMakeLists.txt +++ b/tools/test_apps/system/memprot/CMakeLists.txt @@ -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() diff --git a/tools/test_apps/system/memprot/main/esp32c3/test_panic.c b/tools/test_apps/system/memprot/main/esp32c3/test_panic.c index 31295e0e21..f75450ef2c 100644 --- a/tools/test_apps/system/memprot/main/esp32c3/test_panic.c +++ b/tools/test_apps/system/memprot/main/esp32c3/test_panic.c @@ -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); + } +} diff --git a/tools/test_apps/system/memprot/main/esp32s2/test_panic.c b/tools/test_apps/system/memprot/main/esp32s2/test_panic.c index e003b80d77..eb4d69f62b 100644 --- a/tools/test_apps/system/memprot/main/esp32s2/test_panic.c +++ b/tools/test_apps/system/memprot/main/esp32s2/test_panic.c @@ -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); + } +} diff --git a/tools/test_apps/system/memprot/main/esp32s3/test_panic.c b/tools/test_apps/system/memprot/main/esp32s3/test_panic.c index 4e48e4e358..b126e537d2 100644 --- a/tools/test_apps/system/memprot/main/esp32s3/test_panic.c +++ b/tools/test_apps/system/memprot/main/esp32s3/test_panic.c @@ -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); } }