diff --git a/components/driver/can.c b/components/driver/can.c index 4ff728b800..68707285d8 100644 --- a/components/driver/can.c +++ b/components/driver/can.c @@ -17,7 +17,6 @@ #include "sdkconfig.h" #include "freertos/FreeRTOS.h" -#include "freertos/portmacro.h" #include "freertos/task.h" #include "freertos/queue.h" #include "freertos/semphr.h" diff --git a/components/driver/include/driver/sdio_slave.h b/components/driver/include/driver/sdio_slave.h index a67ad47ea4..20420d4779 100644 --- a/components/driver/include/driver/sdio_slave.h +++ b/components/driver/include/driver/sdio_slave.h @@ -16,7 +16,6 @@ #define _DRIVER_SDIO_SLAVE_H_ #include "freertos/FreeRTOS.h" -#include "freertos/portmacro.h" #include "esp_err.h" #include "sys/queue.h" diff --git a/components/driver/test/test_pcnt.c b/components/driver/test/test_pcnt.c index 1a4d45155a..9ad2baf1b6 100644 --- a/components/driver/test/test_pcnt.c +++ b/components/driver/test/test_pcnt.c @@ -11,7 +11,6 @@ */ #include #include "freertos/FreeRTOS.h" -#include "freertos/portmacro.h" #include "freertos/task.h" #include "freertos/queue.h" #include "driver/periph_ctrl.h" diff --git a/components/esp32/cpu_start.c b/components/esp32/cpu_start.c index aaf609089a..6ecd1eeb17 100644 --- a/components/esp32/cpu_start.c +++ b/components/esp32/cpu_start.c @@ -37,7 +37,6 @@ #include "freertos/task.h" #include "freertos/semphr.h" #include "freertos/queue.h" -#include "freertos/portmacro.h" #include "esp_heap_caps_init.h" #include "sdkconfig.h" diff --git a/components/esp32/crosscore_int.c b/components/esp32/crosscore_int.c index 24bb3fb26a..35ca8d3aeb 100644 --- a/components/esp32/crosscore_int.c +++ b/components/esp32/crosscore_int.c @@ -30,7 +30,6 @@ #include "freertos/task.h" #include "freertos/semphr.h" #include "freertos/queue.h" -#include "freertos/portmacro.h" #define REASON_YIELD BIT(0) diff --git a/components/esp32/dport_access.c b/components/esp32/dport_access.c index aa5b4913ff..04494ca672 100644 --- a/components/esp32/dport_access.c +++ b/components/esp32/dport_access.c @@ -37,7 +37,6 @@ #include "freertos/task.h" #include "freertos/semphr.h" #include "freertos/queue.h" -#include "freertos/portmacro.h" #include "xtensa/core-macros.h" diff --git a/components/esp32/task_wdt.c b/components/esp32/task_wdt.c index 6e309f32ea..c12926ec3c 100644 --- a/components/esp32/task_wdt.c +++ b/components/esp32/task_wdt.c @@ -18,7 +18,6 @@ #include #include #include "sdkconfig.h" -#include "freertos/FreeRTOSConfig.h" #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "freertos/queue.h" diff --git a/components/esp32s2/cpu_start.c b/components/esp32s2/cpu_start.c index 29fe77d12e..4d1d37e89e 100644 --- a/components/esp32s2/cpu_start.c +++ b/components/esp32s2/cpu_start.c @@ -41,7 +41,6 @@ #include "freertos/task.h" #include "freertos/semphr.h" #include "freertos/queue.h" -#include "freertos/portmacro.h" #include "esp_heap_caps_init.h" #include "esp_system.h" diff --git a/components/esp32s2/crosscore_int.c b/components/esp32s2/crosscore_int.c index 72c3b06666..65da6cd316 100644 --- a/components/esp32s2/crosscore_int.c +++ b/components/esp32s2/crosscore_int.c @@ -31,7 +31,6 @@ #include "freertos/task.h" #include "freertos/semphr.h" #include "freertos/queue.h" -#include "freertos/portmacro.h" #define REASON_YIELD BIT(0) diff --git a/components/esp32s2/task_wdt.c b/components/esp32s2/task_wdt.c index cd562e3b75..de5dd1b86b 100644 --- a/components/esp32s2/task_wdt.c +++ b/components/esp32s2/task_wdt.c @@ -18,7 +18,6 @@ #include #include #include "sdkconfig.h" -#include "freertos/FreeRTOSConfig.h" #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "freertos/queue.h" diff --git a/components/esp_event/test/test_event.c b/components/esp_event/test/test_event.c index 6cfaa961c0..25e4a18517 100644 --- a/components/esp_event/test/test_event.c +++ b/components/esp_event/test/test_event.c @@ -6,7 +6,6 @@ #include "freertos/FreeRTOS.h" #include "freertos/task.h" -#include "freertos/portmacro.h" #include "esp_log.h" #include "driver/periph_ctrl.h" #include "driver/timer.h" diff --git a/components/freemodbus/port/port.c b/components/freemodbus/port/port.c index 2a72d8015c..5eb09d4a0a 100644 --- a/components/freemodbus/port/port.c +++ b/components/freemodbus/port/port.c @@ -37,7 +37,6 @@ /* ----------------------- Modbus includes ----------------------------------*/ #include "freertos/FreeRTOS.h" -#include "freertos/portmacro.h" #include "sys/lock.h" #include "port.h" diff --git a/components/freemodbus/port/port.h b/components/freemodbus/port/port.h index 1337dfc8e7..815b2e3443 100644 --- a/components/freemodbus/port/port.h +++ b/components/freemodbus/port/port.h @@ -18,7 +18,6 @@ #include "freertos/FreeRTOS.h" #include "freertos/xtensa_api.h" -#include "freertos/portmacro.h" #include "esp_log.h" // for ESP_LOGE macro #define INLINE inline diff --git a/components/freertos/CMakeLists.txt b/components/freertos/CMakeLists.txt index d69d442816..f598e5ba6e 100644 --- a/components/freertos/CMakeLists.txt +++ b/components/freertos/CMakeLists.txt @@ -5,28 +5,40 @@ if(BOOTLOADER_BUILD) endif() set(srcs + "xtensa/port.c" + "xtensa/portasm.S" + "xtensa/xtensa_context.S" + "xtensa/xtensa_init.c" + "xtensa/xtensa_intr_asm.S" + "xtensa/xtensa_intr.c" + "xtensa/xtensa_overlay_os_hook.c" + "xtensa/xtensa_vector_defaults.S" + "xtensa/xtensa_vectors.S") + +list(APPEND srcs "croutine.c" "event_groups.c" "FreeRTOS-openocd.c" "list.c" - "port.c" - "portasm.S" "queue.c" "tasks.c" - "timers.c" - "xtensa_context.S" - "xtensa_init.c" - "xtensa_intr.c" - "xtensa_intr_asm.S" - "xtensa_overlay_os_hook.c" - "xtensa_vector_defaults.S" - "xtensa_vectors.S") + "timers.c") + +set(include_dirs + include + xtensa/include) + +set(private_include_dirs + include/freertos + xtensa/include/freertos + xtensa + .) # app_trace is required by FreeRTOS headers only when CONFIG_SYSVIEW_ENABLE=y, # but requirements can't depend on config options, so always require it. idf_component_register(SRCS "${srcs}" - INCLUDE_DIRS include - PRIV_INCLUDE_DIRS include/freertos . + INCLUDE_DIRS ${include_dirs} + PRIV_INCLUDE_DIRS ${private_include_dirs} LDFRAGMENTS linker.lf REQUIRES app_trace PRIV_REQUIRES soc) diff --git a/components/freertos/component.mk b/components/freertos/component.mk index 7969cc6c61..8a39282d8b 100644 --- a/components/freertos/component.mk +++ b/components/freertos/component.mk @@ -6,8 +6,9 @@ ifdef CONFIG_FREERTOS_DEBUG_OCDAWARE COMPONENT_ADD_LDFLAGS += -Wl,--undefined=uxTopUsedPriority endif -COMPONENT_ADD_INCLUDEDIRS := include -COMPONENT_PRIV_INCLUDEDIRS := include/freertos . +COMPONENT_ADD_INCLUDEDIRS := include xtensa/include +COMPONENT_PRIV_INCLUDEDIRS := include/freertos xtensa/include/freertos xtensa . +COMPONENT_SRCDIRS += xtensa tasks.o event_groups.o timers.o queue.o: CFLAGS += -D_ESP_FREERTOS_INTERNAL COMPONENT_ADD_LDFRAGMENTS += linker.lf diff --git a/components/freertos/include/freertos/FreeRTOS.h b/components/freertos/include/freertos/FreeRTOS.h index 98f5dfac7d..580c3731c2 100644 --- a/components/freertos/include/freertos/FreeRTOS.h +++ b/components/freertos/include/freertos/FreeRTOS.h @@ -98,7 +98,7 @@ extern "C" { #include "esp_compiler.h" /* Application specific configuration options. */ -#include "FreeRTOSConfig.h" +#include "freertos/FreeRTOSConfig.h" /* Basic FreeRTOS definitions. */ #include "projdefs.h" diff --git a/components/freertos/include/freertos/portable.h b/components/freertos/include/freertos/portable.h index b87495841c..d07ac2f73f 100644 --- a/components/freertos/include/freertos/portable.h +++ b/components/freertos/include/freertos/portable.h @@ -93,7 +93,7 @@ did not result in a portmacro.h header file being included - and it should be included here. In this case the path to the correct portmacro.h header file must be set in the compiler's include path. */ #ifndef portENTER_CRITICAL - #include "portmacro.h" + #include "freertos/portmacro.h" #endif #if portBYTE_ALIGNMENT == 8 diff --git a/components/freertos/include/freertos/task.h b/components/freertos/include/freertos/task.h index d7836c664d..cfea1f0a77 100644 --- a/components/freertos/include/freertos/task.h +++ b/components/freertos/include/freertos/task.h @@ -78,7 +78,7 @@ #include #include "list.h" -#include "portmacro.h" +#include "freertos/portmacro.h" #ifdef __cplusplus extern "C" { diff --git a/components/freertos/test/test_freertos_task_delay_until.c b/components/freertos/test/test_freertos_task_delay_until.c index e223b083a9..8bb2ce319f 100644 --- a/components/freertos/test/test_freertos_task_delay_until.c +++ b/components/freertos/test/test_freertos_task_delay_until.c @@ -8,7 +8,6 @@ #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "freertos/semphr.h" -#include "freertos/FreeRTOSConfig.h" #include "unity.h" #include "test_utils.h" diff --git a/components/freertos/include/freertos/FreeRTOSConfig.h b/components/freertos/xtensa/include/freertos/FreeRTOSConfig.h similarity index 99% rename from components/freertos/include/freertos/FreeRTOSConfig.h rename to components/freertos/xtensa/include/freertos/FreeRTOSConfig.h index fcd5993016..51cbcbce2e 100644 --- a/components/freertos/include/freertos/FreeRTOSConfig.h +++ b/components/freertos/xtensa/include/freertos/FreeRTOSConfig.h @@ -115,8 +115,7 @@ int xt_clock_freq(void) __attribute__((deprecated)); /* Required for configuration-dependent settings */ -#include "xtensa_config.h" - +#include /* configASSERT behaviour */ #ifndef __ASSEMBLER__ diff --git a/components/freertos/include/freertos/portbenchmark.h b/components/freertos/xtensa/include/freertos/portbenchmark.h similarity index 100% rename from components/freertos/include/freertos/portbenchmark.h rename to components/freertos/xtensa/include/freertos/portbenchmark.h diff --git a/components/freertos/include/freertos/portmacro.h b/components/freertos/xtensa/include/freertos/portmacro.h similarity index 99% rename from components/freertos/include/freertos/portmacro.h rename to components/freertos/xtensa/include/freertos/portmacro.h index 1ba84d68ab..5c2c5f8dca 100644 --- a/components/freertos/include/freertos/portmacro.h +++ b/components/freertos/xtensa/include/freertos/portmacro.h @@ -128,7 +128,6 @@ typedef unsigned portBASE_TYPE UBaseType_t; // portbenchmark #include "portbenchmark.h" - #include "sdkconfig.h" #include "esp_attr.h" diff --git a/components/freertos/include/freertos/xtensa_api.h b/components/freertos/xtensa/include/freertos/xtensa_api.h similarity index 100% rename from components/freertos/include/freertos/xtensa_api.h rename to components/freertos/xtensa/include/freertos/xtensa_api.h diff --git a/components/freertos/include/freertos/xtensa_config.h b/components/freertos/xtensa/include/freertos/xtensa_config.h similarity index 100% rename from components/freertos/include/freertos/xtensa_config.h rename to components/freertos/xtensa/include/freertos/xtensa_config.h diff --git a/components/freertos/include/freertos/xtensa_context.h b/components/freertos/xtensa/include/freertos/xtensa_context.h similarity index 100% rename from components/freertos/include/freertos/xtensa_context.h rename to components/freertos/xtensa/include/freertos/xtensa_context.h diff --git a/components/freertos/include/freertos/xtensa_rtos.h b/components/freertos/xtensa/include/freertos/xtensa_rtos.h similarity index 99% rename from components/freertos/include/freertos/xtensa_rtos.h rename to components/freertos/xtensa/include/freertos/xtensa_rtos.h index 25d42da59b..e0e4475959 100644 --- a/components/freertos/include/freertos/xtensa_rtos.h +++ b/components/freertos/xtensa/include/freertos/xtensa_rtos.h @@ -54,7 +54,7 @@ Should be included by all Xtensa generic and RTOS port-specific sources. /* Include any RTOS specific definitions that are needed by this header. */ -#include "FreeRTOSConfig.h" +#include "freertos/FreeRTOSConfig.h" /* Convert FreeRTOSConfig definitions to XTENSA definitions. diff --git a/components/freertos/include/freertos/xtensa_timer.h b/components/freertos/xtensa/include/freertos/xtensa_timer.h similarity index 99% rename from components/freertos/include/freertos/xtensa_timer.h rename to components/freertos/xtensa/include/freertos/xtensa_timer.h index fa4f96098c..473298352b 100644 --- a/components/freertos/include/freertos/xtensa_timer.h +++ b/components/freertos/xtensa/include/freertos/xtensa_timer.h @@ -49,7 +49,7 @@ and the Xtensa core configuration need not have a timer. #include "xtensa_rtos.h" /* in case this wasn't included directly */ -#include "FreeRTOSConfig.h" +#include "freertos/FreeRTOSConfig.h" /* Select timer to use for periodic tick, and determine its interrupt number diff --git a/components/freertos/port.c b/components/freertos/xtensa/port.c similarity index 100% rename from components/freertos/port.c rename to components/freertos/xtensa/port.c diff --git a/components/freertos/portasm.S b/components/freertos/xtensa/portasm.S similarity index 100% rename from components/freertos/portasm.S rename to components/freertos/xtensa/portasm.S diff --git a/components/freertos/portmacro_priv.h b/components/freertos/xtensa/portmacro_priv.h similarity index 100% rename from components/freertos/portmacro_priv.h rename to components/freertos/xtensa/portmacro_priv.h diff --git a/components/freertos/readme_xtensa.txt b/components/freertos/xtensa/readme_xtensa.txt similarity index 100% rename from components/freertos/readme_xtensa.txt rename to components/freertos/xtensa/readme_xtensa.txt diff --git a/components/freertos/xt_asm_utils.h b/components/freertos/xtensa/xt_asm_utils.h similarity index 100% rename from components/freertos/xt_asm_utils.h rename to components/freertos/xtensa/xt_asm_utils.h diff --git a/components/freertos/xtensa_context.S b/components/freertos/xtensa/xtensa_context.S similarity index 100% rename from components/freertos/xtensa_context.S rename to components/freertos/xtensa/xtensa_context.S diff --git a/components/freertos/xtensa_init.c b/components/freertos/xtensa/xtensa_init.c similarity index 100% rename from components/freertos/xtensa_init.c rename to components/freertos/xtensa/xtensa_init.c diff --git a/components/freertos/xtensa_intr.c b/components/freertos/xtensa/xtensa_intr.c similarity index 100% rename from components/freertos/xtensa_intr.c rename to components/freertos/xtensa/xtensa_intr.c diff --git a/components/freertos/xtensa_intr_asm.S b/components/freertos/xtensa/xtensa_intr_asm.S similarity index 100% rename from components/freertos/xtensa_intr_asm.S rename to components/freertos/xtensa/xtensa_intr_asm.S diff --git a/components/freertos/xtensa_overlay_os_hook.c b/components/freertos/xtensa/xtensa_overlay_os_hook.c similarity index 100% rename from components/freertos/xtensa_overlay_os_hook.c rename to components/freertos/xtensa/xtensa_overlay_os_hook.c diff --git a/components/freertos/xtensa_vector_defaults.S b/components/freertos/xtensa/xtensa_vector_defaults.S similarity index 100% rename from components/freertos/xtensa_vector_defaults.S rename to components/freertos/xtensa/xtensa_vector_defaults.S diff --git a/components/freertos/xtensa_vectors.S b/components/freertos/xtensa/xtensa_vectors.S similarity index 100% rename from components/freertos/xtensa_vectors.S rename to components/freertos/xtensa/xtensa_vectors.S diff --git a/components/newlib/locks.c b/components/newlib/locks.c index 0b7817efde..f50c650526 100644 --- a/components/newlib/locks.c +++ b/components/newlib/locks.c @@ -19,7 +19,6 @@ #include "soc/cpu.h" #include "freertos/FreeRTOS.h" #include "freertos/semphr.h" -#include "freertos/portmacro.h" #include "freertos/task.h" #include "freertos/portable.h" diff --git a/components/pthread/include/esp_pthread.h b/components/pthread/include/esp_pthread.h index 6d24d3ea99..cdff0519e5 100644 --- a/components/pthread/include/esp_pthread.h +++ b/components/pthread/include/esp_pthread.h @@ -15,7 +15,7 @@ #pragma once #include "esp_err.h" -#include +#include "freertos/FreeRTOSConfig.h" #ifdef __cplusplus extern "C" { diff --git a/components/xtensa/stdatomic.c b/components/xtensa/stdatomic.c index 2846ced402..bc5b7ba605 100644 --- a/components/xtensa/stdatomic.c +++ b/components/xtensa/stdatomic.c @@ -16,7 +16,6 @@ #include "sdkconfig.h" #include "freertos/FreeRTOS.h" -#include "freertos/portmacro.h" #include "xtensa/config/core-isa.h" diff --git a/examples/bluetooth/esp_ble_mesh/ble_mesh_node/onoff_client/components/button/include/iot_button.h b/examples/bluetooth/esp_ble_mesh/ble_mesh_node/onoff_client/components/button/include/iot_button.h index 6a2fa23c09..0a8564d683 100644 --- a/examples/bluetooth/esp_ble_mesh/ble_mesh_node/onoff_client/components/button/include/iot_button.h +++ b/examples/bluetooth/esp_ble_mesh/ble_mesh_node/onoff_client/components/button/include/iot_button.h @@ -20,6 +20,7 @@ extern "C" { #include "driver/gpio.h" #include "freertos/portmacro.h" + typedef void (* button_cb)(void*); typedef void* button_handle_t; diff --git a/tools/ci/check_public_headers_exceptions.txt b/tools/ci/check_public_headers_exceptions.txt index 7e6b38c74e..8b6c7e46c9 100644 --- a/tools/ci/check_public_headers_exceptions.txt +++ b/tools/ci/check_public_headers_exceptions.txt @@ -7,6 +7,8 @@ components/xtensa/esp32/include/xtensa/config/* components/newlib/platform_include/* components/freertos/include/freertos/* +components/freertos/xtensa/include/freertos/* + components/log/include/esp_log_internal.h diff --git a/tools/ci/test_build_system.sh b/tools/ci/test_build_system.sh index ebe459dd54..a5c0238fa3 100755 --- a/tools/ci/test_build_system.sh +++ b/tools/ci/test_build_system.sh @@ -183,7 +183,7 @@ function run_tests() # and therefore should rebuild assert_rebuilt newlib/syscall_table.o assert_rebuilt nvs_flash/src/nvs_api.o - assert_rebuilt freertos/xtensa_vectors.o + assert_rebuilt freertos/xtensa/xtensa_vectors.o print_status "Updating project Makefile triggers full recompile" make @@ -193,7 +193,7 @@ function run_tests() # similar to previous test assert_rebuilt newlib/syscall_table.o assert_rebuilt nvs_flash/src/nvs_api.o - assert_rebuilt freertos/xtensa_vectors.o + assert_rebuilt freertos/xtensa/xtensa_vectors.o print_status "print_flash_cmd target should produce one line of output" make diff --git a/tools/ci/test_build_system_cmake.sh b/tools/ci/test_build_system_cmake.sh index 339aa008e8..b4fa3f0986 100755 --- a/tools/ci/test_build_system_cmake.sh +++ b/tools/ci/test_build_system_cmake.sh @@ -220,7 +220,7 @@ function run_tests() # and therefore should rebuild assert_rebuilt esp-idf/newlib/CMakeFiles/${IDF_COMPONENT_PREFIX}_newlib.dir/syscall_table.c.obj assert_rebuilt esp-idf/nvs_flash/CMakeFiles/${IDF_COMPONENT_PREFIX}_nvs_flash.dir/src/nvs_api.cpp.obj - assert_rebuilt esp-idf/freertos/CMakeFiles/${IDF_COMPONENT_PREFIX}_freertos.dir/xtensa_vectors.S.obj + assert_rebuilt esp-idf/freertos/CMakeFiles/${IDF_COMPONENT_PREFIX}_freertos.dir/xtensa/xtensa_vectors.S.obj mv sdkconfig.bak sdkconfig print_status "Updating project CMakeLists.txt triggers full recompile" @@ -235,7 +235,7 @@ function run_tests() # similar to previous test assert_rebuilt esp-idf/newlib/CMakeFiles/${IDF_COMPONENT_PREFIX}_newlib.dir/syscall_table.c.obj assert_rebuilt esp-idf/nvs_flash/CMakeFiles/${IDF_COMPONENT_PREFIX}_nvs_flash.dir/src/nvs_api.cpp.obj - assert_rebuilt esp-idf/freertos/CMakeFiles/${IDF_COMPONENT_PREFIX}_freertos.dir/xtensa_vectors.S.obj + assert_rebuilt esp-idf/freertos/CMakeFiles/${IDF_COMPONENT_PREFIX}_freertos.dir/xtensa/xtensa_vectors.S.obj mv sdkconfig.bak sdkconfig print_status "Can build with Ninja (no idf.py)" diff --git a/tools/unit-test-app/components/test_utils/ccomp_timer_impl.c b/tools/unit-test-app/components/test_utils/ccomp_timer_impl.c index c260f46b4f..9fb0098c71 100644 --- a/tools/unit-test-app/components/test_utils/ccomp_timer_impl.c +++ b/tools/unit-test-app/components/test_utils/ccomp_timer_impl.c @@ -21,7 +21,6 @@ #include "esp_attr.h" #include "eri.h" #include "freertos/FreeRTOS.h" -#include "freertos/portmacro.h" #include "esp_freertos_hooks.h" #include "perfmon.h" #include "xtensa/core-macros.h" diff --git a/tools/unit-test-app/components/test_utils/test/ccomp_timer_test_inst.c b/tools/unit-test-app/components/test_utils/test/ccomp_timer_test_inst.c index 4db9f85e90..bd26f057e7 100644 --- a/tools/unit-test-app/components/test_utils/test/ccomp_timer_test_inst.c +++ b/tools/unit-test-app/components/test_utils/test/ccomp_timer_test_inst.c @@ -7,7 +7,6 @@ #include "ccomp_timer.h" #include "freertos/FreeRTOS.h" -#include "freertos/portmacro.h" #include "unity.h"