summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/threadinitialize.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* score: Help static analysis in thread initSebastian Huber2023-01-281-2/+5
| | | | | | | | Add an assert to _Thread_Initialize_scheduler_and_wait_nodes() which may help a static analyzer. Use a do/while loop since we have at least one scheduler. Update #4832.
* score: Add CPU_THREAD_LOCAL_STORAGE_VARIANTSebastian Huber2022-10-141-5/+1
| | | | Update #3835.
* score: Use priority inheritance for thread joinSebastian Huber2022-07-281-0/+1
| | | | | | | | | | | | | | | | | | | | | Threads may join the thread termination of another thread using the pthread_join() or rtems_task_delete() directives. The thread cancel operation used a special case priority boosting mechanism implemented by _Thread_Raise_real_priority(). The problem was that this approach * is not transitive, * does not account for priority adjustments of the calling task while waiting for the join, * does not support clustered scheduling, and * does not detect deadlocks. All these problems are fixed by using a priority inheritance thread queue for the join operation. Close #4679.
* score/src/[t-z]*.c: Change license to BSD-2Joel Sherrill2022-02-281-3/+22
| | | | Updates #3053.
* score: Simplify thread wait state handlingSebastian Huber2021-11-231-1/+1
| | | | | | | | | | Remove the THREAD_WAIT_STATE_READY_AGAIN and simply use the initial value to indicate that a thread does not wait on something. Rename THREAD_WAIT_FLAGS_INITIAL to THREAD_WAIT_STATE_READY. This change is necessary so that _Thread_Continue() can be called for threads which never waited on something (for example dormant threads). Update #4546.
* score: Introduce CPU budget operationsSebastian Huber2021-11-151-7/+5
| | | | | | | | | | | | | | This patch set replaces the CPU budget algorithm enumeration with a set of CPU budget operations which implement a particular CPU budget algorithm. This helps to hide the CPU budget algorithm implementation details from the general thread handling. The CPU budget callouts are turned into CPU budget operations. This slightly reduces the size of the thread control block. All schedulers used the default scheduler tick implementation. The tick scheduler operation is removed and the CPU budget operations are directly used in _Watchdog_Tick() if the executing thread uses a CPU budget algorithm. This is performance improvement for all threads which do not use a CPU budget algorithm (default behaviour).
* score: Improve variable names in thread initSebastian Huber2021-09-221-25/+25
|
* score: Simplify _Thread_Try_initialize()Sebastian Huber2021-09-221-72/+108
| | | | | Move a code block to its own new function _Thread_Initialize_scheduler_and_wait_nodes(). Add comments.
* score: Fix task stack initializationSebastian Huber2021-03-271-1/+0
| | | | | | | | | Do not adjust the stack area begin address since this may confuse the stack allocator and result in failed stack frees. Account for the alignment overhead in the stack space size estimate. Check that the stack size is in the expected interval.
* score: Add Thread_Configuration::cpu_time_budgetSebastian Huber2021-03-161-17/+1
| | | | | Move the CPU time budget to the thread configuration. This simplifies _Thread_Initialize().
* score: Ensure stack alignment requirementSebastian Huber2021-03-051-0/+5
| | | | | | | | Make sure that a user-provided stack size is the minimum size allocated for the stack. Make sure we meet the stack alignment requirement also for CPU ports with CPU_STACK_ALIGNMENT > CPU_HEAP_ALIGNMENT.
* score: Fix thread initializationSebastian Huber2021-02-261-52/+115
| | | | | | | | Close the thread object if a thread create extension fails. Also call the delete extension to avoid resource leaks in early extensions if a late extension fails. Close #4270.
* score: Remove _Objects_Open()Sebastian Huber2021-02-241-4/+1
| | | | | Use the type safe _Objects_Open_u32() instead. Return the object identifier to enforce a common usage pattern.
* score: Canonicalize Doxygen @file commentsSebastian Huber2020-12-021-3/+5
| | | | | | Use common phrases for the file brief descriptions. Update #3706.
* score: Fix _Thread_Initialize()Sebastian Huber2020-09-111-5/+6
| | | | | | Fix an error cleanup path in SMP configurations to avoid a NULL pointer access. Update #3959.
* score: Add stack free handler to TCBSebastian Huber2020-08-311-16/+14
| | | | | | | This avoids a dependency to the stack free function in the thread destruction. Update #3959.
* score: Use _Freechain_Push()Sebastian Huber2020-08-311-1/+1
| | | | | | The nodes are never NULL. Update #3959.
* score: Add <rtems/score/freechainimpl.h>Sebastian Huber2020-08-311-0/+1
| | | | | | Hide implementation details. Update #3959.
* Canonicalize config.h includeSebastian Huber2020-04-161-1/+1
| | | | | | | | Use the following variant which was already used by most source files: #ifdef HAVE_CONFIG_H #include "config.h" #endif
* score: Fix label defined but not used warningSebastian Huber2020-02-251-0/+2
| | | | Update #3835.
* score: _Scheduler_Is_non_preempt_mode_supported()Sebastian Huber2020-02-251-1/+4
| | | | | | | | If the non-preempt mode for threads is supported depends on the scheduler implementation. Add _Scheduler_Is_non_preempt_mode_supported() to indicate this. Update #3876.
* score: Add _SMP_Need_inter_processor_interrupts()Sebastian Huber2020-02-251-1/+1
| | | | | | | Test for the proper system condition instead of using the rtems_configuration_is_smp_enabled() workaround. Update #3876.
* score: Simplify _Thread_Initialize()Sebastian Huber2020-02-121-9/+2
| | | | | | | | Allocate new thread queue heads during objects information extend. This removes an error case and the last dependency on the workspace in _Thread_Initialize(). Update #3835.
* score: Move thread stack allocationSebastian Huber2020-02-121-34/+19
| | | | | | Move thread stack allocation to caller side of _Thread_Initialize(). Update #3835.
* score: Add _Stack_Extend_size()Sebastian Huber2020-02-121-10/+3
| | | | Update #3835.
* score: Add Thread_ConfigurationSebastian Huber2020-02-121-37/+33
| | | | | | | | | Add the Thread_Configuration structure to reduce the parameter count of _Thread_Initialize(). This makes it easier to add more parameters in the future. It simplifies the code generation since most architectures do not have that many registers available for function parameters. Update #3835.
* score: Simplify TLS area allocationSebastian Huber2020-02-121-15/+15
| | | | | | Use the stack area to allocate the TLS area. Update #3835.
* score: Simplify FP context allocationSebastian Huber2020-02-121-22/+17
| | | | | | | | | | | Use the stack area to allocate the FP context. This considerably simplifies the application configuration since the task count no longer influences the configured work space size. With this change the stack space size is overestimated since an FP context for each thread is accounted. Memory constraint applications can use the stack size for fine tuning. Update #3835.
* score: Simplify thread stack freeSebastian Huber2020-02-121-18/+9
| | | | Update #3835.
* score: Simplify thread stack allocationSebastian Huber2020-02-121-15/+14
| | | | | | Remove superfluous Thread_Control::Start::stack member. Update #3835.
* doxygen: Rename Score* groups in RTEMSScore*Sebastian Huber2019-04-041-1/+1
| | | | Update #3706
* Adjust interrupt mode tests for some CPU portsSebastian Huber2019-01-091-1/+3
| | | | | | | In case the robust thread dispatch is enabled by the CPU port, then the interrupt level must not be changed through the task mode. Update #3000.
* Separate task mode checksSebastian Huber2019-01-091-8/+11
| | | | Update #3000.
* score: Static Objects_Information initializationSebastian Huber2018-12-141-3/+3
| | | | | | | | | | | Statically allocate the objects information together with the initial set of objects either via <rtems/confdefs.h>. Provide default object informations with zero objects via librtemscpu.a. This greatly simplifies the workspace size estimate. RTEMS applications which do not use the unlimited objects option are easier to debug since all objects reside now in statically allocated objects of the right types. Close #3621.
* score: Rename Objects_Information::sizeSebastian Huber2018-12-071-1/+1
| | | | | | | | Rename Objects_Information::size to Objects_Information::object_size. Change its type from size_t to uint16_t and move it to reduce the size of Objects_Information. Update #3621.
* score: Add thread pin/unpin supportSebastian Huber2018-09-101-1/+1
| | | | | | | | | Add support to temporarily pin a thread to its current processor. This may be used to access per-processor data structures in critical sections with enabled thread dispatching, e.g. a pinned thread is allowed to block. Update #3508.
* score: Remove CPU_set_ControlSebastian Huber2017-10-111-1/+0
| | | | | | Use Processor_mask instead. Update #2514.
* score: Introduce _SMP_Get_online_processors()Sebastian Huber2017-07-071-1/+4
| | | | Update #3059.
* score: Move processor affinity to Thread_ControlSebastian Huber2017-07-071-0/+1
| | | | Update #3059.
* score: Fix warningSebastian Huber2017-02-151-0/+2
|
* score: Add _Thread_queue_Object_nameSebastian Huber2017-01-311-2/+1
| | | | | | | | | | | | | Add the special thread queue name _Thread_queue_Object_name to mark thread queues embedded in an object with identifier. Using the special thread state STATES_THREAD_QUEUE_WITH_IDENTIFIER is not reliable for this purpose since the thread wait information and thread state are protected by different SMP locks in separate critical sections. Remove STATES_THREAD_QUEUE_WITH_IDENTIFIER. Add and use _Thread_queue_Object_initialize(). Update #2858.
* score: Fix _Thread_Initialize()Sebastian Huber2017-01-311-2/+2
|
* score: Delete _CPU_Context_Fp_start()Sebastian Huber2017-01-261-1/+0
| | | | | | | | | | Since the FP area pointer is passed by reference in _CPU_Context_Initialize_fp() the optional FP area adjustment via _CPU_Context_Fp_start() is superfluous. It is also wrong with respect to memory management, e.g. pointer passed to _Workspace_Free() may be not the one returned by _Workspace_Allocate(). Close #1400.
* score: Restrict task interrupt level to 0 on SMPSebastian Huber2016-11-181-2/+8
| | | | Update #2811.
* rtems: Add scheduler processor add/removeSebastian Huber2016-11-101-1/+8
| | | | Update #2797.
* score: Introduce Thread_Scheduler_control::homeSebastian Huber2016-11-021-2/+1
| | | | | | | | Replace Thread_Scheduler_control::control and Thread_Scheduler_control::own_control with new Thread_Scheduler_control::home. Update #2556.
* score: Delete Thread_Scheduler_control::own_nodeSebastian Huber2016-11-021-2/+1
| | | | Update #2556.
* score: Delete Thread_Scheduler_control::nodeSebastian Huber2016-11-021-1/+0
| | | | Update #2556.
* score: Delete _Scheduler_Ask_for_help_if_necessarySebastian Huber2016-11-021-2/+0
| | | | | | Delete Thread_Control::Resource_node. Update #2556.
* score: Add scheduler node requestsSebastian Huber2016-11-021-0/+4
| | | | | | | Add the ability to add/remove scheduler nodes to/from the set of scheduler nodes available to the schedulers for a particular thread. Update #2556.