From 0912df611fec72842bd917a41acd178c17a06eb4 Mon Sep 17 00:00:00 2001 From: Sudeep Mohanty Date: Wed, 8 Sep 2021 14:23:57 +0530 Subject: [PATCH] freertos: updated the location of FreeRTOSConfig.h Moved FreeRTOSConfig.h from include/freertos to include/esp_additions/freertos. Updated FreeRTOS.h file to include FreeRTOSConfig.h without the freertos/ prefix to match with the upstream file. Renamed architecture specific FreeRTOSConfig.h files to FreeRTOSConfig_arch.h Signed-off-by: Sudeep Mohanty --- components/freertos/CMakeLists.txt | 11 ++++++----- components/freertos/component.mk | 4 ++-- .../{ => esp_additions}/freertos/FreeRTOSConfig.h | 4 ++-- components/freertos/include/freertos/FreeRTOS.h | 3 ++- .../{FreeRTOSConfig.h => FreeRTOSConfig_arch.h} | 0 .../{FreeRTOSConfig.h => FreeRTOSConfig_arch.h} | 0 .../{FreeRTOSConfig.h => FreeRTOSConfig_arch.h} | 0 components/lwip/test_afl_host/Makefile | 2 +- tools/mocks/freertos/CMakeLists.txt | 3 ++- 9 files changed, 15 insertions(+), 12 deletions(-) rename components/freertos/include/{ => esp_additions}/freertos/FreeRTOSConfig.h (99%) rename components/freertos/port/linux/include/freertos/{FreeRTOSConfig.h => FreeRTOSConfig_arch.h} (100%) rename components/freertos/port/riscv/include/freertos/{FreeRTOSConfig.h => FreeRTOSConfig_arch.h} (100%) rename components/freertos/port/xtensa/include/freertos/{FreeRTOSConfig.h => FreeRTOSConfig_arch.h} (100%) diff --git a/components/freertos/CMakeLists.txt b/components/freertos/CMakeLists.txt index 95613dafda..bd5acf5a2f 100644 --- a/components/freertos/CMakeLists.txt +++ b/components/freertos/CMakeLists.txt @@ -18,7 +18,9 @@ if(CONFIG_IDF_TARGET_ARCH_XTENSA) set(include_dirs include - port/xtensa/include) + include/esp_additions/freertos # For files with #include "FreeRTOSConfig.h" + port/xtensa/include # For including arch-specific FreeRTOSConfig_arch.h in port//include + include/esp_additions) # For files with #include "freertos/FreeRTOSConfig.h" set(private_include_dirs port/xtensa/include/freertos @@ -33,7 +35,9 @@ elseif(CONFIG_IDF_TARGET_ARCH_RISCV) set(include_dirs include - port/riscv/include) + include/esp_additions/freertos # For files with #include "FreeRTOSConfig.h" + port/riscv/include # For including arch-specific FreeRTOSConfig_arch.h in port//include + include/esp_additions) # For files with #include "freertos/FreeRTOSConfig.h" set(private_include_dirs port/riscv/include/freertos @@ -57,9 +61,6 @@ list(APPEND srcs "FreeRTOS-openocd.c" "freertos_v8_compat.c") -list(APPEND include_dirs - "include/esp_additions") - list(APPEND private_include_dirs "include/freertos") diff --git a/components/freertos/component.mk b/components/freertos/component.mk index e6b3a28dcf..2fd40c90ac 100644 --- a/components/freertos/component.mk +++ b/components/freertos/component.mk @@ -6,8 +6,8 @@ ifdef CONFIG_FREERTOS_DEBUG_OCDAWARE COMPONENT_ADD_LDFLAGS += -Wl,--undefined=uxTopUsedPriority endif -COMPONENT_ADD_INCLUDEDIRS := include port/xtensa/include include/esp_additions -COMPONENT_PRIV_INCLUDEDIRS := include/freertos port/xtensa/include/freertos port/xtensa port/priv_include . +COMPONENT_ADD_INCLUDEDIRS := include include/esp_additions include/esp_additions/freertos port/xtensa/include +COMPONENT_PRIV_INCLUDEDIRS := include/esp_additions include/esp_additions/freertos include/freertos port/xtensa/include/freertos port/xtensa port/priv_include . COMPONENT_SRCDIRS += port port/xtensa esp_additions/ ifndef CONFIG_ESP32_IRAM_AS_8BIT_ACCESSIBLE_MEMORY diff --git a/components/freertos/include/freertos/FreeRTOSConfig.h b/components/freertos/include/esp_additions/freertos/FreeRTOSConfig.h similarity index 99% rename from components/freertos/include/freertos/FreeRTOSConfig.h rename to components/freertos/include/esp_additions/freertos/FreeRTOSConfig.h index 3cef949666..a01a56e9fd 100644 --- a/components/freertos/include/freertos/FreeRTOSConfig.h +++ b/components/freertos/include/esp_additions/freertos/FreeRTOSConfig.h @@ -75,8 +75,8 @@ /* for likely and unlikely */ #include "esp_compiler.h" -// The arch-specific FreeRTOSConfig.h in port//include. -#include_next "freertos/FreeRTOSConfig.h" +// The arch-specific FreeRTOSConfig_arch.h in port//include. +#include "freertos/FreeRTOSConfig_arch.h" #if !(defined(FREERTOS_CONFIG_XTENSA_H) \ || defined(FREERTOS_CONFIG_RISCV_H) \ diff --git a/components/freertos/include/freertos/FreeRTOS.h b/components/freertos/include/freertos/FreeRTOS.h index 20e0d9e22a..5e6e248618 100644 --- a/components/freertos/include/freertos/FreeRTOS.h +++ b/components/freertos/include/freertos/FreeRTOS.h @@ -54,7 +54,8 @@ /* *INDENT-ON* */ /* Application specific configuration options. */ -#include "freertos/FreeRTOSConfig.h" +#include "FreeRTOSConfig.h" + /* Basic FreeRTOS definitions. */ #include "projdefs.h" diff --git a/components/freertos/port/linux/include/freertos/FreeRTOSConfig.h b/components/freertos/port/linux/include/freertos/FreeRTOSConfig_arch.h similarity index 100% rename from components/freertos/port/linux/include/freertos/FreeRTOSConfig.h rename to components/freertos/port/linux/include/freertos/FreeRTOSConfig_arch.h diff --git a/components/freertos/port/riscv/include/freertos/FreeRTOSConfig.h b/components/freertos/port/riscv/include/freertos/FreeRTOSConfig_arch.h similarity index 100% rename from components/freertos/port/riscv/include/freertos/FreeRTOSConfig.h rename to components/freertos/port/riscv/include/freertos/FreeRTOSConfig_arch.h diff --git a/components/freertos/port/xtensa/include/freertos/FreeRTOSConfig.h b/components/freertos/port/xtensa/include/freertos/FreeRTOSConfig_arch.h similarity index 100% rename from components/freertos/port/xtensa/include/freertos/FreeRTOSConfig.h rename to components/freertos/port/xtensa/include/freertos/FreeRTOSConfig_arch.h diff --git a/components/lwip/test_afl_host/Makefile b/components/lwip/test_afl_host/Makefile index 4d5e2e5d23..2eeda96a7d 100644 --- a/components/lwip/test_afl_host/Makefile +++ b/components/lwip/test_afl_host/Makefile @@ -2,7 +2,7 @@ COMPONENTS_DIR=../.. COMPILER_ICLUDE_DIR=$(shell echo `which xtensa-esp32-elf-gcc | xargs dirname | xargs dirname`/xtensa-esp32-elf) CFLAGS=-std=gnu99 -Og -ggdb -ffunction-sections -fdata-sections -nostdlib -Wall -Werror=all -Wno-int-to-pointer-cast -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-macro-redefined -Wno-constant-conversion -Wno-incompatible-pointer-types-discards-qualifiers -Wno-typedef-redefinition -Wno-incompatible-pointer-types -Wextra \ -Wno-unused-parameter -Wno-sign-compare -Wno-address -Wno-unused-variable -DESP_PLATFORM -D IDF_VER=\"v3.1\" -MMD -MP -DWITH_POSIX -DLWIP_NO_CTYPE_H=1 -INC_DIRS=-I . -I ./build/config -I $(COMPONENTS_DIR)/newlib/platform_include -I $(COMPONENTS_DIR)/newlib/include -I $(COMPONENTS_DIR)/driver/include -I $(COMPONENTS_DIR)/esp32/include -I $(COMPONENTS_DIR)/ethernet/include -I $(COMPONENTS_DIR)/freertos/include -I $(COMPONENTS_DIR)/heap/include -I $(COMPONENTS_DIR)/lwip/lwip/src/include -I $(COMPONENTS_DIR)/lwip/include/apps -I $(COMPONENTS_DIR)/lwip/lwip/src/include/netif -I $(COMPONENTS_DIR)/lwip/lwip/src/include/posix -I $(COMPONENTS_DIR)/lwip/port/esp32/include -I $(COMPONENTS_DIR)/lwip/lwip/src/include/posix -I $(COMPONENTS_DIR)/lwip/include/apps/ping -I $(COMPONENTS_DIR)/lwip/include/apps/sntp -I $(COMPONENTS_DIR)/soc/esp32/include -I $(COMPONENTS_DIR)/soc/include -I $(COMPONENTS_DIR)/tcpip_adapter/include -I $(COMPONENTS_DIR)/esp_rom/include -I $(COMPONENTS_DIR)/esp_common/include -I $(COMPONENTS_DIR)/esp_hw_support/include -I $(COMPONENTS_DIR)/xtensa/include -I $(COMPONENTS_DIR)/xtensa/esp32/include -I $(COMPONENTS_DIR)/esp_wifi/include -I $(COMPONENTS_DIR)/esp_event/include -I $(COMPONENTS_DIR)/freertos/port/xtensa/include -I $(COMPONENTS_DIR)/esp_system/include -I $(COMPONENTS_DIR)/esp_timer/include -I $(COMPONENTS_DIR)/soc/include -I $(COMPONENTS_DIR)/soc/include -I $(COMPONENTS_DIR)/soc/src/esp32/include -I $(COMPONENTS_DIR)/soc/esp32/include -I $(COMPONENTS_DIR)/esp_netif/include -I $(COMPONENTS_DIR)/esp_eth/include -I $(COMPONENTS_DIR)/esp_netif/lwip -I $(COMPONENTS_DIR)/hal/include -I $(COMPONENTS_DIR)/hal/esp32/include -I $(COMPILER_ICLUDE_DIR)/include +INC_DIRS=-I . -I ./build/config -I $(COMPONENTS_DIR)/newlib/platform_include -I $(COMPONENTS_DIR)/newlib/include -I $(COMPONENTS_DIR)/driver/include -I $(COMPONENTS_DIR)/esp32/include -I $(COMPONENTS_DIR)/ethernet/include -I $(COMPONENTS_DIR)/freertos/include/esp_additions -I $(COMPONENTS_DIR)/freertos/include/esp_additions/freertos -I $(COMPONENTS_DIR)/freertos/include -I $(COMPONENTS_DIR)/heap/include -I $(COMPONENTS_DIR)/lwip/lwip/src/include -I $(COMPONENTS_DIR)/lwip/include/apps -I $(COMPONENTS_DIR)/lwip/lwip/src/include/netif -I $(COMPONENTS_DIR)/lwip/lwip/src/include/posix -I $(COMPONENTS_DIR)/lwip/port/esp32/include -I $(COMPONENTS_DIR)/lwip/lwip/src/include/posix -I $(COMPONENTS_DIR)/lwip/include/apps/ping -I $(COMPONENTS_DIR)/lwip/include/apps/sntp -I $(COMPONENTS_DIR)/soc/esp32/include -I $(COMPONENTS_DIR)/soc/include -I $(COMPONENTS_DIR)/tcpip_adapter/include -I $(COMPONENTS_DIR)/esp_rom/include -I $(COMPONENTS_DIR)/esp_common/include -I $(COMPONENTS_DIR)/esp_hw_support/include -I $(COMPONENTS_DIR)/xtensa/include -I $(COMPONENTS_DIR)/xtensa/esp32/include -I $(COMPONENTS_DIR)/esp_wifi/include -I $(COMPONENTS_DIR)/esp_event/include -I $(COMPONENTS_DIR)/freertos/port/xtensa/include -I $(COMPONENTS_DIR)/esp_system/include -I $(COMPONENTS_DIR)/esp_timer/include -I $(COMPONENTS_DIR)/soc/include -I $(COMPONENTS_DIR)/soc/include -I $(COMPONENTS_DIR)/soc/src/esp32/include -I $(COMPONENTS_DIR)/soc/esp32/include -I $(COMPONENTS_DIR)/esp_netif/include -I $(COMPONENTS_DIR)/esp_eth/include -I $(COMPONENTS_DIR)/esp_netif/lwip -I $(COMPONENTS_DIR)/hal/include -I $(COMPONENTS_DIR)/hal/esp32/include -I $(COMPILER_ICLUDE_DIR)/include TEST_NAME=test FUZZ=afl-fuzz GEN_CFG=generate_config diff --git a/tools/mocks/freertos/CMakeLists.txt b/tools/mocks/freertos/CMakeLists.txt index 0df27f1f66..b96f65969d 100644 --- a/tools/mocks/freertos/CMakeLists.txt +++ b/tools/mocks/freertos/CMakeLists.txt @@ -6,8 +6,9 @@ idf_component_get_property(original_freertos_dir freertos COMPONENT_OVERRIDEN_DI set(include_dirs "${original_freertos_dir}/include" - "${original_freertos_dir}/include/freertos" # this is due to the way includes are generated in CMock "${original_freertos_dir}/include/esp_additions" + "${original_freertos_dir}/include/esp_additions/freertos" + "${original_freertos_dir}/include/freertos" # this is due to the way includes are generated in CMock "${original_freertos_dir}/port/linux/include") idf_component_mock(INCLUDE_DIRS ${include_dirs}