freertos: update freertos folder structure to match upstream
The following changes have been made: 1. All FreeRTOS kernel source files are now placed in the freertos/FreeRTOS-Kernel folder to match with the upstream folder structure. 2. All kernel include files are now placed in freertos/FreeRTOS-Kernel/include. 3. All port files are now placed in freertos/FreeRTOS-Kernel/portable. 4. All additions/customizations are placed in freertos/esp_additions. 5. All other miscellaneous files (README, License files etc.) are moved to freertos/FreeRTOS-Kernel folder to match with the upstream. 6. Updated esp-cryptoauthlib to latest commit to resolve FreeRTOS include dependencies. Signed-off-by: Sudeep Mohanty <sudeep.mohanty@espressif.com>
This commit is contained in:
@@ -8,64 +8,64 @@ idf_build_get_property(target IDF_TARGET)
|
||||
|
||||
if(CONFIG_IDF_TARGET_ARCH_XTENSA)
|
||||
set(srcs
|
||||
"port/xtensa/port.c"
|
||||
"port/xtensa/portasm.S"
|
||||
"port/xtensa/xtensa_context.S"
|
||||
"port/xtensa/xtensa_init.c"
|
||||
"port/xtensa/xtensa_overlay_os_hook.c"
|
||||
"port/xtensa/xtensa_vector_defaults.S"
|
||||
"port/xtensa/xtensa_vectors.S")
|
||||
"FreeRTOS-Kernel/portable/xtensa/port.c"
|
||||
"FreeRTOS-Kernel/portable/xtensa/portasm.S"
|
||||
"FreeRTOS-Kernel/portable/xtensa/xtensa_context.S"
|
||||
"FreeRTOS-Kernel/portable/xtensa/xtensa_init.c"
|
||||
"FreeRTOS-Kernel/portable/xtensa/xtensa_overlay_os_hook.c"
|
||||
"FreeRTOS-Kernel/portable/xtensa/xtensa_vector_defaults.S"
|
||||
"FreeRTOS-Kernel/portable/xtensa/xtensa_vectors.S")
|
||||
|
||||
set(include_dirs
|
||||
include
|
||||
include/esp_additions/freertos # For files with #include "FreeRTOSConfig.h"
|
||||
port/xtensa/include # For including arch-specific FreeRTOSConfig_arch.h in port/<arch>/include
|
||||
include/esp_additions) # For files with #include "freertos/FreeRTOSConfig.h"
|
||||
FreeRTOS-Kernel/include
|
||||
esp_additions/include/freertos # For files with #include "FreeRTOSConfig.h"
|
||||
FreeRTOS-Kernel/portable/xtensa/include # For arch-specific FreeRTOSConfig_arch.h in portable/<arch>/include
|
||||
esp_additions/include) # For files with #include "freertos/FreeRTOSConfig.h"
|
||||
|
||||
set(private_include_dirs
|
||||
port/xtensa/include/freertos
|
||||
port/xtensa
|
||||
port/priv_include
|
||||
FreeRTOS-Kernel/portable/xtensa/include/freertos
|
||||
FreeRTOS-Kernel/portable/xtensa
|
||||
FreeRTOS-Kernel/portable/priv_include
|
||||
.)
|
||||
|
||||
elseif(CONFIG_IDF_TARGET_ARCH_RISCV)
|
||||
set(srcs
|
||||
"port/riscv/port.c"
|
||||
"port/riscv/portasm.S")
|
||||
"FreeRTOS-Kernel/portable/riscv/port.c"
|
||||
"FreeRTOS-Kernel/portable/riscv/portasm.S")
|
||||
|
||||
set(include_dirs
|
||||
include
|
||||
include/esp_additions/freertos # For files with #include "FreeRTOSConfig.h"
|
||||
port/riscv/include # For including arch-specific FreeRTOSConfig_arch.h in port/<arch>/include
|
||||
include/esp_additions) # For files with #include "freertos/FreeRTOSConfig.h"
|
||||
FreeRTOS-Kernel/include
|
||||
esp_additions/include/freertos # For files with #include "FreeRTOSConfig.h"
|
||||
FreeRTOS-Kernel/portable/riscv/include # For arch-specific FreeRTOSConfig_arch.h in portable/<arch>/include
|
||||
esp_additions/include) # For files with #include "freertos/FreeRTOSConfig.h"
|
||||
|
||||
set(private_include_dirs
|
||||
port/riscv/include/freertos
|
||||
port/riscv
|
||||
port/priv_include
|
||||
FreeRTOS-Kernel/portable/riscv/include/freertos
|
||||
FreeRTOS-Kernel/portable/riscv
|
||||
FreeRTOS-Kernel/portable/priv_include
|
||||
.)
|
||||
|
||||
endif()
|
||||
|
||||
list(APPEND srcs
|
||||
"esp_additions/task_snapshot.c"
|
||||
"port/port_common.c"
|
||||
"port/port_systick.c"
|
||||
"croutine.c"
|
||||
"event_groups.c"
|
||||
"list.c"
|
||||
"queue.c"
|
||||
"tasks.c"
|
||||
"timers.c"
|
||||
"stream_buffer.c"
|
||||
"FreeRTOS-Kernel/portable/port_common.c"
|
||||
"FreeRTOS-Kernel/portable/port_systick.c"
|
||||
"FreeRTOS-Kernel/croutine.c"
|
||||
"FreeRTOS-Kernel/event_groups.c"
|
||||
"FreeRTOS-Kernel/list.c"
|
||||
"FreeRTOS-Kernel/queue.c"
|
||||
"FreeRTOS-Kernel/tasks.c"
|
||||
"FreeRTOS-Kernel/timers.c"
|
||||
"FreeRTOS-Kernel/stream_buffer.c"
|
||||
"FreeRTOS-openocd.c"
|
||||
"freertos_v8_compat.c")
|
||||
"esp_additions/freertos_v8_compat.c")
|
||||
|
||||
list(APPEND private_include_dirs
|
||||
"include/freertos")
|
||||
"FreeRTOS-Kernel/include/freertos")
|
||||
|
||||
if(CONFIG_ESP32_IRAM_AS_8BIT_ACCESSIBLE_MEMORY)
|
||||
list(APPEND srcs "port/xtensa/xtensa_loadstore_handler.S")
|
||||
list(APPEND srcs "FreeRTOS-Kernel/portable/xtensa/xtensa_loadstore_handler.S")
|
||||
endif()
|
||||
|
||||
# esp_timer is required by FreeRTOS because we use esp_tiemr_get_time() to do profiling
|
||||
|
||||
@@ -4,19 +4,10 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* Copyright 2015-2018 Espressif Systems (Shanghai) PTE LTD
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO 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-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* File adapted to use on IDF FreeRTOS component, extracted
|
||||
@@ -6,9 +6,9 @@ ifdef CONFIG_FREERTOS_DEBUG_OCDAWARE
|
||||
COMPONENT_ADD_LDFLAGS += -Wl,--undefined=uxTopUsedPriority
|
||||
endif
|
||||
|
||||
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/
|
||||
COMPONENT_ADD_INCLUDEDIRS := FreeRTOS-Kernel/include esp_additions/include esp_additions/include/freertos FreeRTOS-Kernel/portable/xtensa/include
|
||||
COMPONENT_PRIV_INCLUDEDIRS := esp_additions/include esp_additions/include/freertos FreeRTOS-Kernel/include/freertos FreeRTOS-Kernel/portable/xtensa/include/freertos FreeRTOS-Kernel/portable/xtensa FreeRTOS-Kernel/portable/priv_include .
|
||||
COMPONENT_SRCDIRS += FreeRTOS-Kernel FreeRTOS-Kernel/portable FreeRTOS-Kernel/portable/xtensa esp_additions/
|
||||
|
||||
ifndef CONFIG_ESP32_IRAM_AS_8BIT_ACCESSIBLE_MEMORY
|
||||
COMPONENT_OBJEXCLUDE := xtensa/xtensa_loadstore_handler.o
|
||||
|
||||
25
components/freertos/esp_additions/freertos_v8_compat.c
Normal file
25
components/freertos/esp_additions/freertos_v8_compat.c
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include "FreeRTOS.h"
|
||||
#include "queue.h"
|
||||
#include "semphr.h"
|
||||
|
||||
/* This API is kept for backward ABI compatibility with prebuilt libraries against FreeRTOS v8/v9 in ESP-IDF */
|
||||
BaseType_t xQueueGenericReceive( QueueHandle_t xQueue, void * const pvBuffer, TickType_t xTicksToWait, const BaseType_t xPeek )
|
||||
{
|
||||
if ( xPeek == pdTRUE )
|
||||
{
|
||||
return xQueuePeek( xQueue, pvBuffer, xTicksToWait );
|
||||
}
|
||||
|
||||
if ( pvBuffer == NULL )
|
||||
{
|
||||
return xQueueSemaphoreTake( xQueue, xTicksToWait );
|
||||
}
|
||||
|
||||
return xQueueReceive( xQueue, pvBuffer, xTicksToWait );
|
||||
}
|
||||
@@ -1,16 +1,8 @@
|
||||
// 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.
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
@@ -1,16 +1,8 @@
|
||||
// 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.
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
// Copyright 2020 Espressif Systems (Shanghai) Co., 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.
|
||||
|
||||
#include "FreeRTOS.h"
|
||||
#include "queue.h"
|
||||
#include "semphr.h"
|
||||
|
||||
/* This API is kept for backward ABI compatibility with prebuilt libraries against FreeRTOS v8/v9 in ESP-IDF */
|
||||
BaseType_t xQueueGenericReceive( QueueHandle_t xQueue, void * const pvBuffer, TickType_t xTicksToWait, const BaseType_t xPeek )
|
||||
{
|
||||
if ( xPeek == pdTRUE )
|
||||
{
|
||||
return xQueuePeek( xQueue, pvBuffer, xTicksToWait );
|
||||
}
|
||||
|
||||
if ( pvBuffer == NULL )
|
||||
{
|
||||
return xQueueSemaphoreTake( xQueue, xTicksToWait );
|
||||
}
|
||||
|
||||
return xQueueReceive( xQueue, pvBuffer, xTicksToWait );
|
||||
}
|
||||
@@ -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/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
|
||||
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/esp_additions/include -I $(COMPONENTS_DIR)/freertos/esp_additions/include/freertos -I $(COMPONENTS_DIR)/freertos/FreeRTOS-Kernel/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/FreeRTOS-Kernel/portable/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
|
||||
|
||||
@@ -18,9 +18,9 @@ CFLAGS=-g -Wno-unused-value -Wno-missing-declarations -Wno-pointer-bool-conversi
|
||||
-I$(COMPONENTS_DIR)/esp_system/include \
|
||||
-I$(COMPONENTS_DIR)/esp_timer/include \
|
||||
-I$(COMPONENTS_DIR)/esp_wifi/include \
|
||||
-I$(COMPONENTS_DIR)/freertos \
|
||||
-I$(COMPONENTS_DIR)/freertos/include \
|
||||
-I$(COMPONENTS_DIR)/freertos/port/xtensa/include \
|
||||
-I$(COMPONENTS_DIR)/freertos/FreeRTOS-Kernel \
|
||||
-I$(COMPONENTS_DIR)/freertos/FreeRTOS-Kernel/include \
|
||||
-I$(COMPONENTS_DIR)/freertos/FreeRTOS-Kernel/portable/xtensa/include \
|
||||
-I$(COMPONENTS_DIR)/hal/include \
|
||||
-I$(COMPONENTS_DIR)/hal/esp32/include \
|
||||
-I$(COMPONENTS_DIR)/heap/include \
|
||||
|
||||
@@ -57,9 +57,9 @@ idf_component_get_property(mbedtls_dir mbedtls COMPONENT_DIR)
|
||||
${esp_hw_support_dir}/include/esp_random.h
|
||||
${esp_system_dir}/include/esp_system.h
|
||||
${esp_tls_dir}/esp_tls.h
|
||||
${freertos_dir}/include/freertos/queue.h
|
||||
${freertos_dir}/include/freertos/task.h
|
||||
${freertos_dir}/include/freertos/event_groups.h
|
||||
${freertos_dir}/FreeRTOS-Kernel/include/freertos/queue.h
|
||||
${freertos_dir}/FreeRTOS-Kernel/include/freertos/task.h
|
||||
${freertos_dir}/FreeRTOS-Kernel/include/freertos/event_groups.h
|
||||
${log_dir}/include/esp_log.h
|
||||
${nghttp_dir}/port/include/http_parser.h
|
||||
)
|
||||
@@ -103,7 +103,7 @@ idf_component_get_property(mbedtls_dir mbedtls COMPONENT_DIR)
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/host_test/mocks/include
|
||||
${tcp_transport_dir}/include
|
||||
${esp_tls_dir}
|
||||
${freertos_dir}/include
|
||||
${freertos_dir}/FreeRTOS-Kernel/include
|
||||
${esp_event_dir}/include
|
||||
${esp_system_dir}/include
|
||||
${esp_common_dir}/include
|
||||
@@ -115,7 +115,7 @@ idf_component_get_property(mbedtls_dir mbedtls COMPONENT_DIR)
|
||||
${mbedtls_dir}/port/include
|
||||
${nghttp_dir}/port/include
|
||||
${mbedtls_dir}/mbedtls/include
|
||||
${freertos_dir}/include/freertos
|
||||
${freertos_dir}/FreeRTOS-Kernel/include/freertos
|
||||
esp-mqtt/lib/include
|
||||
${MOCK_GEN_DIR}
|
||||
)
|
||||
|
||||
@@ -37,7 +37,7 @@ if(CONFIG_TINYUSB)
|
||||
"tinyusb/src/"
|
||||
"additions/include"
|
||||
# The FreeRTOS API include convention in tinyusb is different from esp-idf
|
||||
"${freertos_component_dir}/include/freertos"
|
||||
"${freertos_component_dir}/FreeRTOS-Kernel/include/freertos"
|
||||
)
|
||||
|
||||
list(APPEND srcs
|
||||
|
||||
Reference in New Issue
Block a user