diff --git a/components/app_trace/port/xtensa/port.c b/components/app_trace/port/xtensa/port.c index d64f2631fd..cefd5a0cd2 100644 --- a/components/app_trace/port/xtensa/port.c +++ b/components/app_trace/port/xtensa/port.c @@ -155,7 +155,7 @@ #include "soc/sensitive_reg.h" #endif #include "eri.h" -#include "trax.h" +#include "esp_private/trax.h" #include "esp_log.h" #include "esp_app_trace_membufs_proto.h" #include "esp_app_trace_port.h" diff --git a/components/esp_hw_support/sleep_modes.c b/components/esp_hw_support/sleep_modes.c index ea85bd96b6..0414e7134b 100644 --- a/components/esp_hw_support/sleep_modes.c +++ b/components/esp_hw_support/sleep_modes.c @@ -42,7 +42,7 @@ #include "sdkconfig.h" #include "esp_rom_uart.h" #include "esp_rom_sys.h" -#include "brownout.h" +#include "esp_private/brownout.h" #include "esp_private/sleep_retention.h" #include "esp_private/esp_clk.h" diff --git a/components/esp_system/port/CMakeLists.txt b/components/esp_system/port/CMakeLists.txt index debcacb4ea..62d6f15553 100644 --- a/components/esp_system/port/CMakeLists.txt +++ b/components/esp_system/port/CMakeLists.txt @@ -4,8 +4,7 @@ if(CONFIG_IDF_TARGET_ARCH_RISCV) list(APPEND INCLUDE_FILES "include/riscv") endif() -target_include_directories(${COMPONENT_LIB} PRIVATE ${INCLUDE_FILES}) -target_include_directories(${COMPONENT_LIB} PUBLIC public_compat) +target_include_directories(${COMPONENT_LIB} PRIVATE ${INCLUDE_FILES} include/private) set(srcs "cpu_start.c" "panic_handler.c" "brownout.c") add_prefix(srcs "${CMAKE_CURRENT_LIST_DIR}/" ${srcs}) diff --git a/components/esp_system/port/arch/riscv/panic_arch.c b/components/esp_system/port/arch/riscv/panic_arch.c index de5cc73cc4..5e000217c8 100644 --- a/components/esp_system/port/arch/riscv/panic_arch.c +++ b/components/esp_system/port/arch/riscv/panic_arch.c @@ -12,7 +12,7 @@ #include "esp_private/panic_internal.h" #include "esp_private/panic_reason.h" #include "riscv/rvruntime-frames.h" -#include "cache_err_int.h" +#include "esp_private/cache_err_int.h" #if CONFIG_ESP_SYSTEM_MEMPROT_FEATURE #if CONFIG_IDF_TARGET_ESP32C3 diff --git a/components/esp_system/port/arch/xtensa/panic_arch.c b/components/esp_system/port/arch/xtensa/panic_arch.c index 23d0b09453..b992e0bbb9 100644 --- a/components/esp_system/port/arch/xtensa/panic_arch.c +++ b/components/esp_system/port/arch/xtensa/panic_arch.c @@ -14,7 +14,7 @@ #include "esp_private/panic_reason.h" #include "soc/soc.h" -#include "cache_err_int.h" +#include "esp_private/cache_err_int.h" #include "sdkconfig.h" diff --git a/components/esp_system/port/arch/xtensa/trax.c b/components/esp_system/port/arch/xtensa/trax.c index fd24aa1a54..96dafeb675 100644 --- a/components/esp_system/port/arch/xtensa/trax.c +++ b/components/esp_system/port/arch/xtensa/trax.c @@ -9,7 +9,7 @@ #include "esp_err.h" #include "esp_log.h" #include "xt_trax.h" -#include "trax.h" +#include "esp_private/trax.h" #include "hal/trace_ll.h" #include "soc/dport_reg.h" #include "soc/tracemem_config.h" diff --git a/components/esp_system/port/cpu_start.c b/components/esp_system/port/cpu_start.c index d672f776e1..ad9b5fcc58 100644 --- a/components/esp_system/port/cpu_start.c +++ b/components/esp_system/port/cpu_start.c @@ -15,7 +15,7 @@ #include "esp_system.h" #include "esp_efuse.h" -#include "cache_err_int.h" +#include "esp_private/cache_err_int.h" #include "esp_clk_internal.h" #include "esp_rom_efuse.h" @@ -79,7 +79,7 @@ #include "soc/spinlock.h" #if CONFIG_ESP32_TRAX || CONFIG_ESP32S2_TRAX || CONFIG_ESP32S3_TRAX -#include "trax.h" +#include "esp_private/trax.h" #endif #include "bootloader_mem.h" diff --git a/components/esp_system/port/include/esp_clk_internal.h b/components/esp_system/port/include/esp_clk_internal.h index f1f8964573..cc9d121285 100644 --- a/components/esp_system/port/include/esp_clk_internal.h +++ b/components/esp_system/port/include/esp_clk_internal.h @@ -1,19 +1,15 @@ -// Copyright 2015-2017 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-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once +#ifdef __cplusplus +extern "C" { +#endif + /** * @file esp_clk_internal.h * @@ -42,3 +38,7 @@ void esp_perip_clk_init(void); * Only internal use in unit test. */ void rtc_clk_select_rtc_slow_clk(void); + +#ifdef __cplusplus +} +#endif diff --git a/components/esp_system/port/include/port/panic_funcs.h b/components/esp_system/port/include/port/panic_funcs.h index 3c681fec95..c2b4280051 100644 --- a/components/esp_system/port/include/port/panic_funcs.h +++ b/components/esp_system/port/include/port/panic_funcs.h @@ -1,17 +1,17 @@ -// Copyright 2020 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: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once +#ifdef __cplusplus +extern "C" { +#endif + void __attribute__((noreturn)) panic_restart(void); + +#ifdef __cplusplus +} +#endif diff --git a/components/esp_system/port/include/private/esp_private/brownout.h b/components/esp_system/port/include/private/esp_private/brownout.h new file mode 100644 index 0000000000..1e369ed6ae --- /dev/null +++ b/components/esp_system/port/include/private/esp_private/brownout.h @@ -0,0 +1,23 @@ +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + + +#ifndef __ESP_BROWNOUT_H +#define __ESP_BROWNOUT_H + +#ifdef __cplusplus +extern "C" { +#endif + +void esp_brownout_init(void); + +void esp_brownout_disable(void); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/components/esp_system/port/public_compat/cache_err_int.h b/components/esp_system/port/include/private/esp_private/cache_err_int.h similarity index 55% rename from components/esp_system/port/public_compat/cache_err_int.h rename to components/esp_system/port/include/private/esp_private/cache_err_int.h index d87406f80f..22e1c3ec7c 100644 --- a/components/esp_system/port/public_compat/cache_err_int.h +++ b/components/esp_system/port/include/private/esp_private/cache_err_int.h @@ -1,16 +1,8 @@ -// Copyright 2015-2017 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-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/components/esp_system/port/public_compat/trax.h b/components/esp_system/port/include/private/esp_private/trax.h similarity index 76% rename from components/esp_system/port/public_compat/trax.h rename to components/esp_system/port/include/private/esp_private/trax.h index 1322b7b585..1ff8d2ea4a 100644 --- a/components/esp_system/port/public_compat/trax.h +++ b/components/esp_system/port/include/private/esp_private/trax.h @@ -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-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include "sdkconfig.h" #include "esp_err.h" diff --git a/components/esp_system/port/include/riscv/eh_frame_parser_impl.h b/components/esp_system/port/include/riscv/eh_frame_parser_impl.h index 14e3e655fd..d2a4784627 100644 --- a/components/esp_system/port/include/riscv/eh_frame_parser_impl.h +++ b/components/esp_system/port/include/riscv/eh_frame_parser_impl.h @@ -1,17 +1,9 @@ -// Copyright 2020 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: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ /** * @file DWARF Exception Frames parser header @@ -21,11 +13,14 @@ * */ -#ifndef EH_FRAME_PARSER_IMPL_H -#define EH_FRAME_PARSER_IMPL_H +#pragma once #include "riscv/rvruntime-frames.h" +#ifdef __cplusplus +extern "C" { +#endif + /** * @brief Define the Executionframe as RvExcFrame for this implementation. */ @@ -62,4 +57,8 @@ typedef RvExcFrame ExecutionFrame; */ #define EXECUTION_FRAME_REG(frame, i) (((uint32_t*) (frame))[(i)]) -#endif // _EH_FRAME_PARSER_IMPL_H +#ifdef __cplusplus +} +#endif + +// #endif // _EH_FRAME_PARSER_IMPL_H diff --git a/components/esp_system/port/panic_handler.c b/components/esp_system/port/panic_handler.c index 780777f011..c3944a0e13 100644 --- a/components/esp_system/port/panic_handler.c +++ b/components/esp_system/port/panic_handler.c @@ -17,7 +17,7 @@ #include "hal/soc_hal.h" #include "hal/cpu_hal.h" -#include "cache_err_int.h" +#include "esp_private/cache_err_int.h" #include "sdkconfig.h" #include "esp_rom_sys.h" diff --git a/components/esp_system/port/public_compat/brownout.h b/components/esp_system/port/public_compat/brownout.h deleted file mode 100644 index 397092cd44..0000000000 --- a/components/esp_system/port/public_compat/brownout.h +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2015-2021 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. - - -#ifndef __ESP_BROWNOUT_H -#define __ESP_BROWNOUT_H - -#ifdef __cplusplus -extern "C" { -#endif - -void esp_brownout_init(void); - -void esp_brownout_disable(void); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/components/esp_system/port/soc/esp32/system_internal.c b/components/esp_system/port/soc/esp32/system_internal.c index e6a15e6414..07e8e86933 100644 --- a/components/esp_system/port/soc/esp32/system_internal.c +++ b/components/esp_system/port/soc/esp32/system_internal.c @@ -1,16 +1,8 @@ -// Copyright 2018 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: 2018-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include #include "esp_system.h" @@ -32,7 +24,7 @@ #include "hal/cpu_hal.h" #include "freertos/xtensa_api.h" #include "soc/soc_memory_layout.h" -#include "cache_err_int.h" +#include "esp_private/cache_err_int.h" #include "esp32/rom/cache.h" #include "esp32/rom/rtc.h" diff --git a/components/esp_system/port/soc/esp32c3/system_internal.c b/components/esp_system/port/soc/esp32c3/system_internal.c index 77020b3a91..73c2ad2626 100644 --- a/components/esp_system/port/soc/esp32c3/system_internal.c +++ b/components/esp_system/port/soc/esp32c3/system_internal.c @@ -1,16 +1,8 @@ -// Copyright 2018 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: 2018-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include #include "sdkconfig.h" @@ -32,7 +24,7 @@ #include "soc/system_reg.h" #include "soc/uart_reg.h" #include "hal/wdt_hal.h" -#include "cache_err_int.h" +#include "esp_private/cache_err_int.h" #include "esp32c3/rom/cache.h" #include "esp32c3/rom/rtc.h" diff --git a/components/esp_system/port/soc/esp32h2/system_internal.c b/components/esp_system/port/soc/esp32h2/system_internal.c index 71a028e1c1..944864d45c 100644 --- a/components/esp_system/port/soc/esp32h2/system_internal.c +++ b/components/esp_system/port/soc/esp32h2/system_internal.c @@ -23,7 +23,7 @@ #include "soc/syscon_reg.h" #include "soc/system_reg.h" #include "hal/wdt_hal.h" -#include "cache_err_int.h" +#include "esp_private/cache_err_int.h" #include "esp32h2/rom/cache.h" #include "esp32h2/rom/rtc.h" diff --git a/components/esp_system/port/soc/esp8684/system_internal.c b/components/esp_system/port/soc/esp8684/system_internal.c index b02c8a51e0..ace4946352 100644 --- a/components/esp_system/port/soc/esp8684/system_internal.c +++ b/components/esp_system/port/soc/esp8684/system_internal.c @@ -23,7 +23,7 @@ #include "soc/syscon_reg.h" #include "soc/system_reg.h" #include "hal/wdt_hal.h" -#include "cache_err_int.h" +#include "esp_private/cache_err_int.h" #include "esp8684/rom/cache.h" #include "esp8684/rom/rtc.h" diff --git a/components/esp_system/startup.c b/components/esp_system/startup.c index 53e6224cc7..8886fda52a 100644 --- a/components/esp_system/startup.c +++ b/components/esp_system/startup.c @@ -53,7 +53,7 @@ #include "esp_vfs_console.h" #include "esp_private/esp_clk.h" -#include "brownout.h" +#include "esp_private/brownout.h" #include "esp_rom_sys.h" diff --git a/docs/en/migration-guides/system.rst b/docs/en/migration-guides/system.rst index 7b71fcf1e5..3924c507c9 100644 --- a/docs/en/migration-guides/system.rst +++ b/docs/en/migration-guides/system.rst @@ -11,11 +11,21 @@ Thus, any project presenting a ``CMakeLists.txt`` file with the parameters ``PRI ESP Clock --------- -The old headers ``target/clk.h``, ``esp_clk.h`` have been removed. +The old headers ``{IDF_TARGET_NAME}/clk.h``, ``esp_clk.h`` have been removed. Therefore, If you want to use the function with the prefix ``esp_clk`` please include ``esp_private/esp_clk.h`` instead. Cache Error Interrupt --------------------- -The old headers ``target/cache_err_int.h`` have been removed. Please include ``cache_err_int.h`` directly. +The old headers ``{IDF_TARGET_NAME}/cache_err_int.h`` have been removed. Please include ``esp_private/cache_err_int.h`` instead. + +Brownout +-------- + +The header ``brownout.h`` has been made private. ESP-IDF developers should include ``esp_private/brownout.h`` instead. + +Trax +---- + +The header ``trax.h`` has been made private. ESP-IDF developers should include ``esp_private/trax.h`` instead. diff --git a/tools/ci/check_copyright_ignore.txt b/tools/ci/check_copyright_ignore.txt index 37d1c53175..0ad773ae09 100644 --- a/tools/ci/check_copyright_ignore.txt +++ b/tools/ci/check_copyright_ignore.txt @@ -908,9 +908,6 @@ components/esp_system/include/esp_task_wdt.h components/esp_system/port/arch/riscv/expression_with_stack.c components/esp_system/port/arch/xtensa/debug_helpers.c components/esp_system/port/arch/xtensa/expression_with_stack.c -components/esp_system/port/include/esp_clk_internal.h -components/esp_system/port/include/port/panic_funcs.h -components/esp_system/port/include/riscv/eh_frame_parser_impl.h components/esp_system/port/public_compat/brownout.h components/esp_system/port/public_compat/cache_err_int.h components/esp_system/port/public_compat/trax.h @@ -918,12 +915,10 @@ components/esp_system/port/soc/esp32/cache_err_int.c components/esp_system/port/soc/esp32/cache_err_int.h components/esp_system/port/soc/esp32/intr.c components/esp_system/port/soc/esp32/reset_reason.c -components/esp_system/port/soc/esp32/system_internal.c components/esp_system/port/soc/esp32c3/apb_backup_dma.c components/esp_system/port/soc/esp32c3/cache_err_int.c components/esp_system/port/soc/esp32c3/cache_err_int.h components/esp_system/port/soc/esp32c3/reset_reason.c -components/esp_system/port/soc/esp32c3/system_internal.c components/esp_system/port/soc/esp32h2/apb_backup_dma.c components/esp_system/port/soc/esp32h2/cache_err_int.c components/esp_system/port/soc/esp32h2/cache_err_int.h