From ce39ebe45b56942b1ba59512f380cc32b2aec10f Mon Sep 17 00:00:00 2001 From: RichardBarry <3073890+RichardBarry@users.noreply.github.com> Date: Fri, 28 Aug 2020 14:14:29 -0700 Subject: [PATCH 1/4] Update history.txt (#150) * Update History.txt ready for the 10.4.0 release. --- History.txt | 43 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/History.txt b/History.txt index f870b0e7e..9535f998f 100644 --- a/History.txt +++ b/History.txt @@ -1,13 +1,52 @@ Documentation and download available at https://www.FreeRTOS.org/ +Changes between FreeRTOS V10.4.0 and FreeRTOS V10.3.1 released September 1 2020 + + See https://www.FreeRTOS.org/FreeRTOS-V10.4.x.html + + Major enhancements: + + + Task notifications: Prior to FreeRTOS V10.4.0 each created task had a + single direct to task notification. From FreeRTOS V10.4.0 each task has + an array of notifications. The direct to task notification API has been + extended with API functions postfixed with "Indexed" to enable the API to + operate on a task notification at any array index. See + https://www.freertos.org/RTOS-task-notifications.html for more information. + + Kernel ports that support memory protection units (MPUs): The ARMv7-M and + ARMv8-M MPU ports now support a privilege access only heap. The ARMv7-M + MPU ports now support devices that have 16 MPU regions, have the ability + to override default memory attributes for privileged code and data + regions, and have the ability to place the FreeRTOS kernel code outside of + the Flash memory. The ARMv8-M MPU ports now support tickless idle mode. + See https://www.freertos.org/FreeRTOS-MPU-memory-protection-unit.html + for more information. + + Additional noteworthy updates: + + + Code formatting is now automated to facilitate the increase in + collaborative development in Git. The auto-formated code is not identical + to the original formatting conventions. Most notably spaces are now used + in place of tabs. + + The prototypes for callback functions (those that start with "Application", + such as vApplicationStackOverflowHook()) are now in the FreeRTOS header + files, removing the need for application writers to add prototypes into + the C files in which they define the functions. + + New Renesas RXv3 port layer. + + Updates to the Synopsys ARC code, including support for EM and HS cores, + and updated BSP. + + Added new POSIX port layer that allows FreeRTOS to run on Linux hosts in + the same way the Windows port layer enables FreeRTOS to run on Windows + hosts. + + Many other minor optimisations and enhancements. For full details + see https://github.com/FreeRTOS/FreeRTOS-Kernel/commits/master + + Changes between FreeRTOS V10.3.0 and FreeRTOS V10.3.1 released February 18 2020 See https://www.FreeRTOS.org/FreeRTOS-V10.3.x.html + ./FreeRTOS-Labs directory was removed from this file. The libraries it contained are now available as a separate download. - + Replaced the single task notification per task with an array of - notificatinos per task. Changes between FreeRTOS V10.2.1 and FreeRTOS V10.3.0 released February 7 2020 From 58ffcb1a6d221e11978770a677ddc4c4297bb94a Mon Sep 17 00:00:00 2001 From: Ming Yue Date: Fri, 28 Aug 2020 14:17:29 -0700 Subject: [PATCH 2/4] Revert "Fix race condition when tracing is enabled (#95)" (#149) This reverts commit 61635d5b8b7ae1e783026f37eb66757509010130. --- portable/GCC/ARM_CR5/port.c | 35 +---------------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/portable/GCC/ARM_CR5/port.c b/portable/GCC/ARM_CR5/port.c index 970b304a5..8b9933fb3 100644 --- a/portable/GCC/ARM_CR5/port.c +++ b/portable/GCC/ARM_CR5/port.c @@ -146,20 +146,6 @@ #define portTASK_RETURN_ADDRESS prvTaskExitError #endif - -/* Adding the necessary stuff in order to be able to determine from C code wheter or not the IRQs are enabled at the processor level (not interrupt controller level) */ -#define GET_CPSR() \ - ( { u32 rval = 0U; \ - __asm__ __volatile__ ( \ - "mrs %0, cpsr\n"\ - : "=r" ( rval ) \ - ); \ - rval; \ - } ) - -#define CPSR_IRQ_ENABLE_MASK 0x80U - -#define IS_IRQ_DISABLED() ( { unsigned int val = 0; val = ( GET_CPSR() & CPSR_IRQ_ENABLE_MASK ) ? 1 : 0; val; } ) /*-----------------------------------------------------------*/ /* @@ -481,12 +467,6 @@ void vPortClearInterruptMask( uint32_t ulNewMaskValue ) uint32_t ulPortSetInterruptMask( void ) { uint32_t ulReturn; - uint32_t wasIRQDisabled; - - /* We keep track of if the IRQ are enabled in the CPU (as opposed to interrupts masked in the interrupt controller, like the intend of this function). - * This is very important because when the CPU is interrupted, among other things, the hardware clears the IRQ Enable bit in the CPSR of the IRQ CPU Mode in which - * we enter. */ - wasIRQDisabled = IS_IRQ_DISABLED(); /* Interrupt in the CPU must be turned off while the ICCPMR is being * updated. */ @@ -505,20 +485,7 @@ uint32_t ulPortSetInterruptMask( void ) "isb \n"::: "memory" ); } - /* Just like this function returns a value of wether or not the interrupts where masked in the interrupt controller in order to avoid race condition when - * calling its matching vPortClearInterruptMask function, we needed a 'wasIRQDisabled' variable holding the state of the IRQ Enable bit in the CPSR in order - * to leave that bit in it's original state. Like mentioned above, hardware automatically clear the IRQEnable bit upon trapping into IRQ Mode, so the programmer - * cannot make assumption about it's state. Very rare, but very important race condition is avoided with this when this function is called in an ISR. The race - * condition in question was discovered when integrating tracealyzer code. Inside the function 'void vTaskSwitchContext( void )' in tasks.c, there is a macro 'traceTASK_SWITCHED_IN();' - * which gets replaced by something when using the tracing capabilities. That macro protects some critical section with matching calls to 'ulPortSetInterruptMask' - * and 'vPortClearInterruptMask'. At the time of calling those functions, the interrupt mask is not set in the interrupt controller, thus the only protecting barrier - * against the CPU traping into recursive interrupt was the IRQ Enable bit in the CPSR. By not taking it into acount, the very code that protects the CPU against - * critical section violation just enabled it to happen : A SysTick was waiting to happen, and calling 'portCPU_IRQ_ENABLE' would enable it to occur... Thus triggering a - * switch of context while already performing a switch context. */ - if( !wasIRQDisabled ) - { - portCPU_IRQ_ENABLE(); - } + portCPU_IRQ_ENABLE(); return ulReturn; } From 148c81a7bcf78dedf7b8c18319585b3232565c39 Mon Sep 17 00:00:00 2001 From: alfred gedeon Date: Fri, 28 Aug 2020 14:19:31 -0700 Subject: [PATCH 3/4] Revert "Fix: Add Parenthesis around if-statement in macro (#138)" (#148) This reverts commit 45e97bd246e115ca9ebdd6538939478c6c6e6343. --- portable/GCC/ARM_CM4F/portmacro.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/portable/GCC/ARM_CM4F/portmacro.h b/portable/GCC/ARM_CM4F/portmacro.h index 173c7cb80..ebc96431f 100644 --- a/portable/GCC/ARM_CM4F/portmacro.h +++ b/portable/GCC/ARM_CM4F/portmacro.h @@ -90,12 +90,7 @@ #define portNVIC_INT_CTRL_REG ( *( ( volatile uint32_t * ) 0xe000ed04 ) ) #define portNVIC_PENDSVSET_BIT ( 1UL << 28UL ) - - #define portEND_SWITCHING_ISR( xSwitchRequired ) \ - do { \ - if( (xSwitchRequired) != pdFALSE ) portYIELD(); \ - } while (0) - + #define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired != pdFALSE ) portYIELD() #define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x ) /*-----------------------------------------------------------*/ From 82fdc1c3ee4c5e8a1f10e2a2370c81088506e905 Mon Sep 17 00:00:00 2001 From: Ming Yue Date: Fri, 28 Aug 2020 14:59:30 -0700 Subject: [PATCH 4/4] Change the header file name into lower case so it can work on GNU/Linux for MinGW cross-compiling. (#144) --- portable/MSVC-MingW/portmacro.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/portable/MSVC-MingW/portmacro.h b/portable/MSVC-MingW/portmacro.h index 83b13b19e..38128785e 100644 --- a/portable/MSVC-MingW/portmacro.h +++ b/portable/MSVC-MingW/portmacro.h @@ -28,8 +28,8 @@ #ifndef PORTMACRO_H #define PORTMACRO_H -#include -#include +#include +#include /****************************************************************************** Defines