diff --git a/components/freertos/FreeRTOS-Kernel-SMP/portable/riscv/include/freertos/portmacro.h b/components/freertos/FreeRTOS-Kernel-SMP/portable/riscv/include/freertos/portmacro.h index 5928bc3154..d63062ca52 100644 --- a/components/freertos/FreeRTOS-Kernel-SMP/portable/riscv/include/freertos/portmacro.h +++ b/components/freertos/FreeRTOS-Kernel-SMP/portable/riscv/include/freertos/portmacro.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2023-2026 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -27,10 +27,27 @@ uxPriority (4) #define PORT_OFFSET_PX_STACK 0x30 #endif /* #if CONFIG_FREERTOS_USE_LIST_DATA_INTEGRITY_CHECK_BYTES */ +#if ( configNUMBER_OF_CORES > 1 ) +#define PORT_TCB_CORE_FIELDS_SIZE 8 +#else +#define PORT_TCB_CORE_FIELDS_SIZE 0 +#endif + +#if ( configUSE_TASK_PREEMPTION_DISABLE == 1 ) +#define PORT_TCB_PREEMPT_DISABLE_FIELD_SIZE 4 +#else +#define PORT_TCB_PREEMPT_DISABLE_FIELD_SIZE 0 +#endif + +/* Align the value up to the nearest multiple of 4 */ +#define PORT_ALIGN_UP_TO_4(value) (((value) + 3) & ~3) + #define PORT_OFFSET_PX_END_OF_STACK ( \ PORT_OFFSET_PX_STACK \ + 4 /* StackType_t * pxStack */ \ - + CONFIG_FREERTOS_MAX_TASK_NAME_LEN /* pcTaskName[ configMAX_TASK_NAME_LEN ] */ \ + + PORT_TCB_CORE_FIELDS_SIZE /* BaseType_t xDummy23 + UBaseType_t uxDummy24 */ \ + + PORT_ALIGN_UP_TO_4(configMAX_TASK_NAME_LEN) /* pcTaskName[ configMAX_TASK_NAME_LEN ] */ \ + + PORT_TCB_PREEMPT_DISABLE_FIELD_SIZE /* BaseType_t xDummy25 */ \ ) #ifndef __ASSEMBLER__ diff --git a/components/freertos/FreeRTOS-Kernel/portable/riscv/include/freertos/portmacro.h b/components/freertos/FreeRTOS-Kernel/portable/riscv/include/freertos/portmacro.h index 08c7503240..b423e4eb44 100644 --- a/components/freertos/FreeRTOS-Kernel/portable/riscv/include/freertos/portmacro.h +++ b/components/freertos/FreeRTOS-Kernel/portable/riscv/include/freertos/portmacro.h @@ -6,7 +6,7 @@ * * SPDX-License-Identifier: MIT * - * SPDX-FileContributor: 2023-2025 Espressif Systems (Shanghai) CO LTD + * SPDX-FileContributor: 2023-2026 Espressif Systems (Shanghai) CO LTD * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in @@ -49,10 +49,13 @@ #define CORE_ID_SIZE 4 #endif +/* Align the value up to the nearest multiple of 4 */ +#define PORT_ALIGN_UP_TO_4(value) (((value) + 3) & ~3) + #define PORT_OFFSET_PX_END_OF_STACK ( \ PORT_OFFSET_PX_STACK \ + 4 /* void * pxDummy6 */ \ - + CONFIG_FREERTOS_MAX_TASK_NAME_LEN /* uint8_t ucDummy7[ configMAX_TASK_NAME_LEN ] */ \ + + PORT_ALIGN_UP_TO_4(configMAX_TASK_NAME_LEN) /* uint8_t ucDummy7[ configMAX_TASK_NAME_LEN ] */ \ + CORE_ID_SIZE /* BaseType_t xDummyCoreID */ \ ) diff --git a/components/freertos/test_apps/freertos/sdkconfig.defaults b/components/freertos/test_apps/freertos/sdkconfig.defaults index fc55992c99..fc38b73951 100644 --- a/components/freertos/test_apps/freertos/sdkconfig.defaults +++ b/components/freertos/test_apps/freertos/sdkconfig.defaults @@ -6,3 +6,4 @@ CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=7 CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=3000 CONFIG_FREERTOS_USE_TRACE_FACILITY=y CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK=y +CONFIG_FREERTOS_MAX_TASK_NAME_LEN=17