Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FreeRTOS/FreeRTOS-Kernel.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-01-23Add check for if the scheduler is running to MPU ports (#954)Soren Ptak
* In the ARM_CM3_MPU and ARM_CM4_MPU Port function xPortIsAuthorizedToAccessBuffer() grant access to the buffer if xSchedulerRunning is false.
2024-01-18Posix port - set name for threads (#950)Mikhail Paulyshka
Co-authored-by: jasonpcarroll <23126711+jasonpcarroll@users.noreply.github.com>
2024-01-18MPU assert for ARM_CM3_MPU (#952)IsaacDynamo
* Add runtime check to see if the target even has a MPU * Add missing extern symbols for __ARMCC_VERSION support * Add default for configTOTAL_MPU_REGIONS and change a runtime assert to compile time error * Simplify check and link to reference documentation Co-authored-by: Soren Ptak <ptaksoren@gmail.com> --------- Co-authored-by: Soren Ptak <ptaksoren@gmail.com> Co-authored-by: jasonpcarroll <23126711+jasonpcarroll@users.noreply.github.com>
2024-01-17Add mpu_wrappers_v2_asm.c to MPU ports (#951)IsaacDynamo
Co-authored-by: Soren Ptak <ptaksoren@gmail.com>
2024-01-13Fix -Werror=unused-parameter in GCC posix prvTimerTickHandler() (#949)Tony Josi
2024-01-11POSIX port - Switch from allowing the user to specify the stack memory ↵Chris Morgan
itself, to allowing them to specify the stack size Change from pthread_attr_setstack() to pthread_attr_setstacksize(), and automatically adjust the stack size to be at least PTHREAD_STACK_MIN if it wasn't already, removing the size warning. This permits the user to increase the pthread stack size beyond the PTHREAD_STACK_MIN default of 16384 if desired, without producing a warning in the typical case where stacks are minimized for RAM limited targets. Continue to store thread paramters on the provided stack, for consistency with the MCU targets. Previously pthread_attr_setstack() was used to enable user defined stacks. Note that: 1. The stack size can still be specified by the user. 2. pxPortInitialiseStack(), and pthread_addr_setstack() was failing on stacks of typical size, as these are smaller than PTHREAD_STACK_MIN (16384) bytes, and printing out a series of warnings. Improve usability by having the posix port automatically increase the stack size to be at least PTHREAD_STACK_MIN as posix platforms have enough memory for this not to be a concern. 3. Reuse of stack memory will also result in valgrind 'invalid write' errors to what is demonstrably valid memory. Root cause is that Valgrind is tracking a stack pointer as the stack is used. Reuse of a stack buffer results in the stack being used at its start, in an area that Valgrind thinks is far away from the start of the stack. There are ways to notify Valgrind of these changes however this would require linking against and calling Valgrind functions from the FreeRTOS application using the posix port, https://valgrind.org/docs/manual/manual-core-adv.html#manual-core-adv.clientreq. Also, apparently it isn't permitted by posix to reuse stack memory once its been used in a pthread via pthread_attr_setstack(), see https://stackoverflow.com/a/5422134
2024-01-11Revert pthread_attr_setstacksizeChing-Hsin Lee
2024-01-11Revert timer tick functionChing-Hsin,Lee
2024-01-11Add back event signalChing-Hsin,Lee
2024-01-11Remove redundent cancellation pointChing-Hsin,Lee
2024-01-11format and header fileChing-Hsin,Lee
2024-01-11Add back heap setup codeChing-Hsin,Lee
2024-01-11UPdate formatChing-Hsin,Lee
2024-01-11Add back the pthread stack fitChing-Hsin Lee
2024-01-11Fix potential race conditionChing-Hsin,Lee
2024-01-11POSIX port - Cancel and join all FreeRTOS managed pthreads upon shutdownChris Morgan
For a clean shutdown where memory is freed, it is necessary for all pthreads to be joined at shutdown. Previously there was explicit cancellation of the idle task and timer daemon task, however there may be a number of other tasks in the system, both system created and user created, and those tasks/threads were being left at shutdown. This change calls pthread_cancel()/pthread_join() on all FreeRTOS managed pthreads upon shutdown.
2024-01-11POSIX - Switch from posix timers to a timer thread to fix signal handling ↵Chris Morgan
with non-FreeRTOS pthreads Improve upon the elegant approach of using signals to cause task/pthreads suspension and scheduler execution by using directed signals. This fixes: - Deadlocks in non-FreeRTOS pthreads - Multiple FreeRTOS tasks(pthreads) incorrectly running at the same time By directing the signals using pthread_kill() the signal handler in the presently running FreeRTOS task/pthread will be called, ensuring that the scheduler runs both in the context of a FreeRTOS task/pthread and from the presently executing FreeRTOS task/pthread. Details ============== The POSIX port uses signals to preempt FreeRTOS tasks (implemented as pthreads), a very neat and elegant approach to forcing tasks/pthreads to suspend and run the scheduler. Signal handlers are process global. Posix timers generate signals when the timer expires, and the signal is sent to the currently running pthread. In systems where there are pthreads that are NOT a result of creating FreeRTOS tasks, such as the entry point thread that calls main(), or user created pthreads, this poses a serious issue. While the POSIX port only allows a single FreeRTOS pthread to run at once, by causing all suspended threads to not be scheduled due to their waiting on a pthread condition variable, this isn't the case with non-FreeRTOS pthreads. Thus it is possible that a non-FreeRTOS pthread is running when the timer expires and the signal is generated. This results in the signal handler running in the non-FreeRTOS thread. The sequence of events results in these events from signal handler context: - vPortSystemTickHandler() being called - The scheduler running - Selecting another FreeRTOS task to run and switching the active task - The newly selected task released from suspension by pthread_cond_signal() - The presently active thread calling event_wait() - The pthread calling pthread_cond_wait(), suspending the thread and allowing the host OS scheduler to schedule another thread to run. If this occurs from a non-FreeRTOS thread this results in: - The active FreeRTOS pthread (Task A/Thread A) continuing to run (as the signal handler that calls event_wait() ran instead in a non-FreeRTOS pthread. - The pthread where the signal handler did run (Thread B) will call event_wait() and pthread_cond_wait(), but on the condition variable of the previously active FreeRTOS task, oops. This causes the non-FreeRTOS pthread to block unexpectedly relative to what the developer might have expected. - The newly selected FreeRTOS Task (Task C/Thread C) will resume and start running. At this point Task A/Thread A is running concurrently with Task C/Thread C. While this may not necessarily be an issue, it does not replicate the expected behavior of a single Task running at once. Note that Thread B will resume if/when Task A/ThreadA is switched to. However, this could be delayed by an arbitrary amount of time, or could never occur. Also note that if there are multiple non-FreeRTOS pthreads that Thread D, E, F...etc could suffer the same fate as Thread B, if the scheduler were to suspend Task C/Thread C and resume Task E/Thread E. Implementation ============== Timer details ------------- A standalone pthread for the signal generation thread was chosen, rather than using a posix timer_settime() handler function because the latter creates a temporary pthread for each handler callback. This makes debugging much more difficult due to gdb detecting the creation and destruction of these temporary threads. Signal delivery -------------- While signal handlers are per-thread, it is possible for pthreads to selectively block signals, rather than using thread directed signals. However, the approach of blocking signals in non-FreeRTOS pthreads adds complexity to each of these non-FreeRTOS pthreads including ensuring that these signals are blocked at thread creation, prior to the thread starting up. Directed signals removes the requirement for non-FreeRTOS pthreads to be aware of and take action to protect against these signals, reducing complexity.
2024-01-10Revert #768 on the XCC/Xtensa portable files (#948)Soren Ptak
2024-01-03Fix portSET_INTERRUPT_MASK_FROM_ISR definition for atomic operation (#940)chinglee-iot
* Introduce portHAS_NESTED_INTERRUPTS to identify if port has nested interrupt or not. * Update atomic.h to use portHAS_NESTED_INTERRUPTS instead of portSET_INTERRUPT_MASK_FROM_ISR definition. --------- Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com> Co-authored-by: ActoryOu <jay2002824@gmail.com>
2024-01-03RP2040: Fix removal of idle_task_static_memory.c (#935)dps.lwk
Co-authored-by: Rahul Kar <118818625+kar-rahul-aws@users.noreply.github.com>
2023-12-29Fix build error for MSP430 and Cortex A with IAR (#937)Jeff Tenney
* fix whitespace in asm macros * Revert formatting ARM_CA5_No_GIC and ARM_CA9
2023-12-26RP2040: FreeRTOS-Kernel-Static use configKERNEL_PROVIDED_STATIC_MEMORY (#934)dps.lwk
Remove the idle_task_static_memory.c and use the new default implementations to allows for FreeRTOS-Kernel-Static to be used with configNUMBER_OF_CORES > 1
2023-12-23Fix build with modern GCC (#933)Forty-Bot
* GCC: MSP430F449: Add missing attributes Apparently at some point in the past, GCC (or TI's GCC) used to define these attributes. Define them ourselves so that we can compile the demo application. * GCC: MSP430F449: Make interrupts return void If a return type of a function is not specified, it defaults to int. Set the return type of interrupts to void to avoid warnings. * GCC: MSP430F449: Define portPOINTER_SIZE_TYPE portPOINTER_SIZE_TYPE defaults to uint32_t if undefined. Define it to uint16_t, which is correct for this port.
2023-12-11Detect more startup config errors on Cortex M (#832)Jeff Tenney
Verify that the application has correctly installed PendSV and SVCall handlers. The application can choose to disable these checks by setting configCHECK_HANDLER_INSTALLATION to 0 in their FreeRTOSConfig.h.
2023-12-09Update the memory alignment within the Cortex-A9 port asm code (#426)RichardBarry
Update alignment in ARM_CA9 port.
2023-12-07Revert Portable/BCC formatting (#828)Soren Ptak
Revert Portable/BCC formatting
2023-12-07Revert Portable/oWatcom formatting (#829)Soren Ptak
Revert the formatting on oWatcom ports
2023-12-07Revert Portable/Paradigm formatting (#830)Soren Ptak
Revert the formatting on Paradigm ports
2023-12-07Revert Portable/CodeWarrior formatting (#831)Soren Ptak
Revert the formatting on CodeWarrior ports
2023-12-07Update partner and community supported port submodule pointer (#919)chinglee-iot
2023-12-04Add SMP template port and example (#900)chinglee-iot
* Add SMP template port and example * Add readme file for smp configuration * Update SMP build flow and add CI build --------- Co-authored-by: Soren Ptak <ptaksoren@gmail.com> Co-authored-by: Rahul Kar <118818625+kar-rahul-aws@users.noreply.github.com>
2023-11-30Fix prototype of MPU_vTimerSetReloadMode (#913)Rahul Kar
2023-11-29Fix typo in comment (#910)Legend
Co-authored-by: Tony Josi <tonyjosi@amazon.com> Co-authored-by: Soren Ptak <ptaksoren@gmail.com> Co-authored-by: Rahul Kar <118818625+kar-rahul-aws@users.noreply.github.com> Co-authored-by: Nikhil Kamath <110539926+amazonKamath@users.noreply.github.com>
2023-11-29Add portMEMORY_BARRIER() to RX MCU ports (#864)Soren Ptak
* Add portMEMORY_BARRIER() to RX MCU ports * Remove the memory barrier from the SH2A_FPU portable directory --------- Co-authored-by: Rahul Kar <118818625+kar-rahul-aws@users.noreply.github.com>
2023-11-28Upgrade msvc port to winsock2 (#895)Soren Ptak
* Add the changes needed to the MSVC windows port to get it to build with winsock2.h * Rely upon the WIN32_LEAN_AND_MEAN define to include winsock2.h
2023-11-28Revert Portable/Renesas formatting (#876)Soren Ptak
* Revert the formatting on Renesas ports
2023-11-23Revert Portable/WizC Formatting (#888)Soren Ptak
* Revert formatting on WizC ports * Fix spelling mistakes --------- Co-authored-by: Rahul Kar <118818625+kar-rahul-aws@users.noreply.github.com> Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
2023-11-23Revert formatting on Tasking ports (#887)Soren Ptak
Co-authored-by: Rahul Kar <118818625+kar-rahul-aws@users.noreply.github.com> Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
2023-11-23Revert Portable/Softune Formatting (#886)Soren Ptak
* Revert formatting on Softune ports * Fix spelling mistakes --------- Co-authored-by: Rahul Kar <118818625+kar-rahul-aws@users.noreply.github.com> Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
2023-11-23Revert formatting on SDCC ports (#885)Soren Ptak
Co-authored-by: Rahul Kar <118818625+kar-rahul-aws@users.noreply.github.com> Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
2023-11-23Revert formatting on Rowley ports (#884)Soren Ptak
Co-authored-by: Rahul Kar <118818625+kar-rahul-aws@users.noreply.github.com> Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
2023-11-23Revert Portable/MPLAB Formatting (#883)Soren Ptak
* Revert the formatting PR * Fix spelling mistakes --------- Co-authored-by: Rahul Kar <118818625+kar-rahul-aws@users.noreply.github.com> Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
2023-11-23Revert the formatting changes on MikroC ports. (#882)Soren Ptak
Co-authored-by: Rahul Kar <118818625+kar-rahul-aws@users.noreply.github.com> Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
2023-11-23Revert formatting on CCS port files (#881)Soren Ptak
Co-authored-by: Rahul Kar <118818625+kar-rahul-aws@users.noreply.github.com> Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
2023-11-23Update system call entry mechanism (#898)Gaurav-Aggarwal-AWS
Earlier the System Call entry from an unprivileged task looked like: 1. SVC for entering system call. 2. System call implementation. 3. SVC for exiting system call. Now, the system call entry needs to make only one SVC call and everything else is handled internally. This PR also makes the following changes: 1. Update the Access Control List (ACL) mechanism to grant access to all the kernel objects before the scheduler is started. 2. Add one struct param for system calls with 5 parameters. This removes the need for special handling for system calls with 5 parameters. 3. Remove raise privilege SVC when MPU wrapper v2 is used. 4. Add additional run time parameter checks to MPU wrappers for xTaskGenericNotify and xQueueTakeMutexRecursive APIs.
2023-11-18fix IAR/CM0/portmacro.h missing semicolon (#894)Ha Thach
Co-authored-by: Rahul Kar <118818625+kar-rahul-aws@users.noreply.github.com>
2023-10-31aarch64: Rename ARM_CA53_64_BIT/_SRE to Arm_AARCH64/_SRE (#822)Devaraj Ranganna
The Cortex-A53 ports are generic and can be used as a starting point for other Armv8-A application processors. Therefore, rename `ARM_CA53_64_BIT` to `Arm_AARCH64` and `ARM_CA53_64_BIT_SRE` to `Arm_AARCH64_SRE`. With this renaming, existing projects that use old port, should migrate to renamed port as follows: * `ARM_CA53_64_BIT` -> `Arm_AARCH64` * `ARM_CA53_64_BIT_SRE` -> `Arm_AARCH64_SRE` Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com> Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
2023-10-27Support configurable RISC-V chip extension (#773)Joe Benczarski
* Support configurable RISC-V chip extension Added the FREERTOS_RISCV_EXTENSION option to allow the user to select which chip extension they want included. Removed the port for pulpino to instead use the new option. * Add port GCC_RISC_V_GENERIC and IAR_RISC_V_GENERIC * Add two rics-v generic ports to support FREERTOS_RISCV_EXTENSION config --------- Co-authored-by: Joe Benczarski <jbenczarski@trijicon.com> Co-authored-by: chinglee-iot <61685396+chinglee-iot@users.noreply.github.com> Co-authored-by: Ching-Hsin Lee <chinglee@amazon.com> Co-authored-by: kar-rahul-aws <118818625+kar-rahul-aws@users.noreply.github.com> Co-authored-by: Soren Ptak <ptaksoren@gmail.com>
2023-10-23Update example cmake project path (#851)Tony Josi
* fix build on 64 bit platform * moving sample cmake project to a separate root level dir * moving sample cmake project to a separate root level dir * updating paths for the sample cmake project * rename example folder * use configKERNEL_PROVIDED_STATIC_MEMORY * update comments * update comments * rename folder to examples * fix formatting
2023-10-20Covert object type check to runtime check (#846)Gaurav-Aggarwal-AWS
* Covert object type check to runtime check It was checked using assert earlier. --------- Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>