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-24Update for unpaired critical section in vTaskSuspend (#959)HEADmainchinglee-iot
* Move the taskEXIT_CRITICAL out of the configNUMBER_OF_CORES macro block to improve readability.
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-23Update unpaired critical section in vTaskDelete for readability (#958)chinglee-iot
* Modify unpaired critical section for readability * Move prvDeleteTCB out of critical section for SMP --------- Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com> Co-authored-by: Gaurav Aggarwal <aggarg@amazon.com>
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-18Make configSUPPORT_STATIC_ALLOCATION==1 an error for MPU ports (#953)IsaacDynamo
* Error when configSUPPORT_STATIC_ALLOCATION is set for MPU ports * Uncrustify: triggered by comment. --------- Co-authored-by: GitHub Action <action@github.com> Co-authored-by: Soren Ptak <ptaksoren@gmail.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-09Assign idle task to each core before SMP scheduler start (#945)chinglee-iot
Co-authored-by: Rahul Kar <118818625+kar-rahul-aws@users.noreply.github.com>
2024-01-08Add new common words to the cSpellWordList.txt (#946)Soren Ptak
2024-01-04Added ability to change task notification index for streambuffers (#939)Gabriele Monaco
* Added possibility to change notification index for streambuffers * Uncrustify: triggered by comment. * Minor code review suggestions. Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com> --------- Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com> Co-authored-by: GitHub Action <action@github.com> Co-authored-by: Aniruddha Kanhere <60444055+AniruddhaKanhere@users.noreply.github.com> Co-authored-by: Gaurav Aggarwal <aggarg@amazon.com>
2024-01-03Fix documentation for xQueueTakeMutexRecursive (#943)Eric Jackson
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-26Export MPU Section Attributes (#931)Soren Ptak
Export the PRIVILEGED_FUNCTION, PRIVILEGED_DATA, and FREERTOS_SYSTEM_CALL attributes to make it easier for end users to add their own privileged functions and system calls.
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-21Update History.txt for V11.0.1 (#932)Rahul Kar
* Update History for V11.0.1
2023-12-18Update History.txt for v11.0.0 (#926)chinglee-iot
* Update History.txt for v11.0.0
2023-12-18Rename sample configuration to template configuration (#927)Rahul Kar
* Rename sample configuration to template configuration * Rename sample configuration to template configuration in cmake example file
2023-12-15Update comments related to portYIELD_FROM_ISR() in queue.h #925 Soren Ptak
2023-12-15Update sample configuration file (#923)Rahul Kar
* Update sample configuration file in the examples folder * Add SMP Configuration definitions * Fix build issue in cmake example * Add CoRoutine Configuration definitions * Code review suggestions Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com> * Fix formatting Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com> --------- Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com> Co-authored-by: Gaurav Aggarwal <aggarg@amazon.com>
2023-12-13Remove the sample smp configuration folder (#922)chinglee-iot
* Remove the sample smp configuration folder
2023-12-11Add portTASK_SWITCH_HOOK (#867)Darian
This commit adds a portTASK_SWITCH_HOOK() macro which allows ports to inject behavior immediately after a context switch. For example, this macro could be used by ports that need to set an end of stack watchpoint after a context swtich. Co-authored-by: Rahul Kar <118818625+kar-rahul-aws@users.noreply.github.com> Co-authored-by: Soren Ptak <ptaksoren@gmail.com> Co-authored-by: chinglee-iot <61685396+chinglee-iot@users.noreply.github.com> Co-authored-by: Tony Josi <tonyjosi@amazon.com> Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
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-08Remove lint suppression comment (#920)chinglee-iot
Remove lint suppression comment
2023-12-08Add constanst suffix to prevent potential type conversion (#921)chinglee-iot
Co-authored-by: Ubuntu <ubuntu@ip-172-31-34-245.ap-northeast-1.compute.internal>
2023-12-07Add coverity example (#870)chinglee-iot
* Add coverity example * Update for CI * Fix for CI 2 * Update kernel_misra.config * Rename coverity example to coverity * Update FreeRTOSConfig.h for coverity project * Update MISRA.md * Move coverity config to coverity_misra.config * Update coverity misra config * Add README.md file * Update FreeRTOSConfig.h for coverity * Fix uncrustify and spell * Update README.md for relative link path Update README.md for relative link path * Update README.md for relative link 2 * Update MISRA.md for relateive path * Fix for format * Update coverity_misra.config * Update configuration folder * Update README.md for link * Code review suggestions Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com> --------- Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com> Co-authored-by: Ubuntu <ubuntu@ip-172-31-34-245.ap-northeast-1.compute.internal> Co-authored-by: Rahul Kar <118818625+kar-rahul-aws@users.noreply.github.com> Co-authored-by: Soren Ptak <ptaksoren@gmail.com> Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com> Co-authored-by: Gaurav Aggarwal <aggarg@amazon.com>
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-07Suppress MISRA C:2012 rule 21.6 for snprintf (#877)chinglee-iot
Suppress MISRA C:2012 rule 21.6 for snprintf
2023-12-07Fix MISRA C 2012 Rule 11.1 deviations (#856)chinglee-iot
* Update callback function prototype to align with definition * Suppress unused function pointer parameter --------- Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com> Co-authored-by: Ubuntu <ubuntu@ip-172-31-34-245.ap-northeast-1.compute.internal> Co-authored-by: GitHub Action <action@github.com> 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> Co-authored-by: Gaurav Aggarwal <aggarg@amazon.com>