change(xtensa): Deprecate ".../xtensa_api.h" include path

This commit deprecates the "freertos/xtensa_api.h" and "xtensa/xtensa_api.h"
include paths. Users should use "xtensa_api.h" instead.

- Replace legacy include paths
- Removed some unnecessary includes of "xtensa_api.h"
- Replaced some calls with "esp_cpu_..." equivalents
- Add warning to compatibility header
This commit is contained in:
Darian Leung 2023-10-27 17:41:49 +08:00
parent 0fb0fc8654
commit 2204c8e137
30 changed files with 22 additions and 43 deletions

View File

@ -16,8 +16,8 @@
#include "freertos/task.h"
#include "freertos/queue.h"
#include "freertos/semphr.h"
#include "freertos/xtensa_api.h"
#include "freertos/portmacro.h"
#include "xtensa_api.h" // Replace with interrupt allocator API (IDF-3891)
#include "xtensa/core-macros.h"
#include "esp_types.h"
#include "esp_mac.h"

View File

@ -43,8 +43,6 @@
#include "riscv/interrupt.h"
#include "esp32c3/rom/rom_layout.h"
#else //CONFIG_IDF_TARGET_ESP32S3
#include "freertos/xtensa_api.h"
#include "xtensa/core-macros.h"
#include "esp32s3/rom/rom_layout.h"
#endif
#if CONFIG_BT_ENABLED

View File

@ -13,7 +13,6 @@
#include "soc/rtc.h"
#include "soc/periph_defs.h"
#include "freertos/FreeRTOS.h"
#include "freertos/xtensa_api.h"
#include "freertos/semphr.h"
#include "esp_timer.h"
#include "esp_intr_alloc.h"

View File

@ -11,7 +11,6 @@
#include "sys/lock.h"
#include "soc/soc_pins.h"
#include "freertos/FreeRTOS.h"
#include "freertos/xtensa_api.h"
#include "freertos/semphr.h"
#include "freertos/timers.h"
#include "esp_intr_alloc.h"

View File

@ -11,7 +11,6 @@
#include "sys/lock.h"
#include "soc/soc_pins.h"
#include "freertos/FreeRTOS.h"
#include "freertos/xtensa_api.h"
#include "freertos/semphr.h"
#include "freertos/timers.h"
#include "esp_intr_alloc.h"

View File

@ -12,7 +12,7 @@
#include <assert.h>
#include "soc/soc_caps.h"
#ifdef __XTENSA__
#include "xtensa/xtensa_api.h"
#include "xtensa_api.h"
#include "xt_utils.h"
#elif __riscv
#include "riscv/rv_utils.h"

View File

@ -22,7 +22,6 @@
#include "soc/rtc.h"
#include "esp_private/rtc_clk.h"
#include "hal/wdt_hal.h"
#include "freertos/xtensa_api.h"
#include "soc/soc_memory_layout.h"
#include "esp_private/cache_err_int.h"
@ -61,7 +60,7 @@ void IRAM_ATTR esp_system_reset_modules_on_exit(void)
void IRAM_ATTR esp_restart_noos(void)
{
// Disable interrupts
xt_ints_off(0xFFFFFFFF);
esp_cpu_intr_disable(0xFFFFFFFF);
// Enable RTC watchdog for 1 second
wdt_hal_context_t rtc_wdt_ctx;

View File

@ -22,7 +22,6 @@
#include "soc/syscon_reg.h"
#include "soc/rtc_periph.h"
#include "hal/wdt_hal.h"
#include "freertos/xtensa_api.h"
#include "soc/soc_memory_layout.h"
#include "esp32s2/rom/rtc.h"
@ -61,7 +60,7 @@ void IRAM_ATTR esp_system_reset_modules_on_exit(void)
void IRAM_ATTR esp_restart_noos(void)
{
// Disable interrupts
xt_ints_off(0xFFFFFFFF);
esp_cpu_intr_disable(0xFFFFFFFF);
// Enable RTC watchdog for 1 second
wdt_hal_context_t rtc_wdt_ctx;

View File

@ -21,7 +21,6 @@
#include "soc/syscon_reg.h"
#include "soc/rtc_periph.h"
#include "hal/wdt_hal.h"
#include "freertos/xtensa_api.h"
#include "soc/soc_memory_layout.h"
#include "esp32s3/rom/cache.h"
@ -68,7 +67,7 @@ void IRAM_ATTR esp_system_reset_modules_on_exit(void)
void IRAM_ATTR esp_restart_noos(void)
{
// Disable interrupts
xt_ints_off(0xFFFFFFFF);
esp_cpu_intr_disable(0xFFFFFFFF);
// Enable RTC watchdog for 1 second
wdt_hal_context_t rtc_wdt_ctx;

View File

@ -15,7 +15,7 @@
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/xtensa_api.h"
#include "xtensa_api.h" // Replace with interrupt allocator API (IDF-3891)
#include "esp_intr_alloc.h"
#include "esp_rom_sys.h"
#include "esp_rom_uart.h"

View File

@ -17,7 +17,7 @@
#include "freertos/semphr.h"
#include "freertos/event_groups.h"
#include "freertos/portmacro.h"
#include "freertos/xtensa_api.h"
#include "xtensa_api.h" // Replace with interrupt allocator API (IDF-3891)
#include "esp_types.h"
#include "esp_random.h"
#include "esp_mac.h"

View File

@ -17,7 +17,7 @@
#include "freertos/semphr.h"
#include "freertos/event_groups.h"
#include "freertos/portmacro.h"
#include "freertos/xtensa_api.h"
#include "xtensa_api.h" // Replace with interrupt allocator API (IDF-3891)
#include "esp_types.h"
#include "esp_random.h"
#include "esp_mac.h"

View File

@ -17,7 +17,7 @@
#include "freertos/semphr.h"
#include "freertos/event_groups.h"
#include "freertos/portmacro.h"
#include "freertos/xtensa_api.h"
#include "xtensa_api.h" // Replace with interrupt allocator API (IDF-3891)
#include "esp_types.h"
#include "esp_random.h"
#include "esp_mac.h"

View File

@ -424,7 +424,7 @@ portmacro.h. Therefore, we need to keep these headers around for now to allow th
#include "portbenchmark.h"
#include <limits.h>
#include <xtensa/config/system.h>
#include <xtensa/xtensa_api.h>
#include <xtensa_api.h>
/* [refactor-todo] introduce a port wrapper function to avoid including esp_timer.h into the public header */
#if CONFIG_FREERTOS_RUN_TIME_STATS_USING_ESP_TIMER

View File

@ -61,7 +61,7 @@
/* [refactor-todo] These includes are not directly used in this file. They are kept into to prevent a breaking change. Remove these. */
#include <limits.h>
#include <xtensa/config/system.h>
#include <xtensa/xtensa_api.h>
#include <xtensa_api.h>
/* [refactor-todo] introduce a port wrapper function to avoid including esp_timer.h into the public header */
#if CONFIG_FREERTOS_RUN_TIME_STATS_USING_ESP_TIMER

View File

@ -18,7 +18,7 @@
#include "test_utils.h"
#if CONFIG_IDF_TARGET_ARCH_XTENSA
#include "xtensa/hal.h"
#include "freertos/xtensa_api.h"
#include "xtensa_api.h" // Replace with interrupt allocator API (IDF-3891)
#define TEST_SET_INT_MASK(mask) xt_set_intset(mask)
#define TEST_CLR_INT_MASK(mask) xt_set_intclear(mask)
#elif CONFIG_IDF_TARGET_ARCH_RISCV

View File

@ -16,7 +16,7 @@
#if SOC_CPU_HAS_FPU && CONFIG_FREERTOS_FPU_IN_ISR
// We can use xtensa API here as currently, non of the RISC-V targets have an FPU
#include "xtensa/xtensa_api.h"
#include "xtensa_api.h" // Replace with interrupt allocator API (IDF-3891)
#include "esp_intr_alloc.h"
#define SW_ISR_LEVEL_1 7

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -15,10 +15,7 @@
#include "esp_random.h"
#include "unity.h"
#if CONFIG_IDF_TARGET_ARCH_XTENSA
#include "freertos/xtensa_api.h"
#ifdef CONFIG_ESP32_IRAM_AS_8BIT_ACCESSIBLE_MEMORY
#if CONFIG_IDF_TARGET_ARCH_XTENSA && CONFIG_ESP32_IRAM_AS_8BIT_ACCESSIBLE_MEMORY
TEST_CASE("LoadStore Exception handler", "[freertos]")
{
int32_t val0 = 0xDEADBEEF;
@ -128,5 +125,4 @@ TEST_CASE("LoadStore Exception handler", "[freertos]")
TEST_ASSERT_TRUE(heap_caps_check_integrity_all(true));
heap_caps_free(arr);
}
#endif // CONFIG_ESP32_IRAM_AS_8BIT_ACCESSIBLE_MEMORY
#endif // CONFIG_IDF_TARGET_ARCH_XTENSA
#endif // CONFIG_IDF_TARGET_ARCH_XTENSA && CONFIG_ESP32_IRAM_AS_8BIT_ACCESSIBLE_MEMORY

View File

@ -6,6 +6,6 @@
#pragma once
/* This header file has been moved, thus `#include <freertos/xtensa_api.h>` is deprecated. Please use `#include <xtensa_api.h>` instead */
/* Todo: IDF-7230 */
#include <xtensa/xtensa_api.h>
#warning "This header file has been moved, thus `#include <freertos/xtensa_api.h>` is deprecated. Please use `#include <xtensa_api.h>` instead"
#include <xtensa_api.h>

View File

@ -6,6 +6,6 @@
#pragma once
/* This header file has been moved, thus `#include <xtensa/xtensa_api.h>` is deprecated. Please use `#include <xtensa_api.h>` instead */
/* Todo: IDF-7230 */
#warning "This header file has been moved, thus `#include <xtensa/xtensa_api.h>` is deprecated. Please use `#include <xtensa_api.h>` instead"
#include <xtensa_api.h>

View File

@ -31,7 +31,7 @@
#include <xtensa/config/core.h>
#include "esp_attr.h"
#include "xtensa/xtensa_api.h"
#include "xtensa_api.h"
#include "sdkconfig.h"
#include "esp_rom_sys.h"

View File

@ -7,7 +7,6 @@
#include <stdint.h>
#include <string.h>
#include <stdbool.h>
#include "freertos/xtensa_api.h"
#include "freertos/FreeRTOSConfig.h"
#include "freertos/FreeRTOS.h"
#include "freertos/queue.h"

View File

@ -7,7 +7,6 @@
#include <stdint.h>
#include <string.h>
#include <stdbool.h>
#include "freertos/xtensa_api.h"
#include "freertos/FreeRTOSConfig.h"
#include "freertos/FreeRTOS.h"
#include "freertos/queue.h"

View File

@ -7,7 +7,6 @@
#include <stdint.h>
#include <string.h>
#include <stdbool.h>
#include "freertos/xtensa_api.h"
#include "freertos/FreeRTOSConfig.h"
#include "freertos/FreeRTOS.h"
#include "freertos/queue.h"

View File

@ -5,7 +5,6 @@
*/
#include "driver/uart.h"
#include "freertos/xtensa_api.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/queue.h"

View File

@ -7,7 +7,6 @@
#include <stdint.h>
#include <string.h>
#include <stdbool.h>
#include "freertos/xtensa_api.h"
#include "freertos/FreeRTOSConfig.h"
#include "freertos/FreeRTOS.h"
#include "freertos/queue.h"

View File

@ -7,7 +7,6 @@
#include <stdint.h>
#include <string.h>
#include <stdbool.h>
#include "freertos/xtensa_api.h"
#include "freertos/FreeRTOSConfig.h"
#include "freertos/FreeRTOS.h"
#include "freertos/queue.h"

View File

@ -7,7 +7,6 @@
#include <stdint.h>
#include <string.h>
#include <stdbool.h>
#include "freertos/xtensa_api.h"
#include "freertos/FreeRTOSConfig.h"
#include "freertos/FreeRTOS.h"
#include "freertos/queue.h"

View File

@ -7,7 +7,6 @@
#include <stdint.h>
#include <string.h>
#include <stdbool.h>
#include "freertos/xtensa_api.h"
#include "freertos/FreeRTOSConfig.h"
#include "freertos/FreeRTOS.h"
#include "freertos/queue.h"

View File

@ -7,7 +7,6 @@
#include <stdint.h>
#include <string.h>
#include <stdbool.h>
#include "freertos/xtensa_api.h"
#include "freertos/FreeRTOSConfig.h"
#include "freertos/FreeRTOS.h"
#include "freertos/queue.h"