summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/threadcreateidle.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* score: Clarify code blockSebastian Huber2023-01-241-1/+1
| | | | | | Do not use a chained assignment for code clarity. Close #4818.
* score: INTERNAL_ERROR_IDLE_THREAD_STACK_TOO_SMALLSebastian Huber2022-10-141-0/+4
| | | | | | | Ensure that the IDLE storage allocator did allocate a suffiently large area. Update #3835. Update #4524.
* config: Add CONFIGURE_IDLE_TASK_STORAGE_SIZESebastian Huber2022-10-141-7/+16
| | | | | | | | | | | | By default, allocate the IDLE task storage areas from the RTEMS Workspace. This avoids having to estimate the thread-local storage size in the default configuration. Add the application configuration option CONFIGURE_IDLE_TASK_STORAGE_SIZE to request a static allocation of the task storage area for IDLE tasks. Update #3835. Update #4524.
* score: INTERNAL_ERROR_IDLE_THREAD_CREATE_FAILEDSebastian Huber2022-10-141-3/+9
| | | | | | Add the INTERNAL_ERROR_IDLE_THREAD_CREATE_FAILED fatal error in case the creation of an idle thread fails. This may happen due to a failing create extension provided by the application.
* config: Changeable size for IDLE stack allocatorSebastian Huber2022-10-141-2/+2
| | | | | | | | Allow the IDLE stack allocator to change the stack size. This can be used by applications with a very dynamic thread-local storage size to adjust the thread storage area of the IDLE tasks dynamically. Update #4524.
* score: Use RTEMS_SMP in _Thread_Create_idle()Sebastian Huber2022-07-071-1/+5
| | | | | | Conditional expressions with inline functions are not optimized away if optimization is disabled. Avoid such expressions to prevent dead branches.
* score: Add _CPU_Use_thread_local_storage()Sebastian Huber2022-07-041-0/+5
| | | | | | | | | | | | At some point during system initialization, the idle threads are created. Afterwards, the boot processor basically executes within the context of an idle thread with thread dispatching disabled. On some architectures, the thread-local storage area of the associated thread must be set in dedicated processor registers. Add the new CPU port function to do this: void _CPU_Use_thread_local_storage( const Context_Control *context ) Close #4672.
* score/src/[t-z]*.c: Change license to BSD-2Joel Sherrill2022-02-281-3/+22
| | | | Updates #3053.
* score: Introduce CPU budget operationsSebastian Huber2021-11-151-1/+0
| | | | | | | | | | | | | | 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).
* Add support for IDLE Thread stack allocatorJoel Sherrill2021-10-111-3/+9
| | | | | | | | Add a stack allocator hook specifically for allocation of IDLE thread stacks. This allows the user to decide if IDLE thread stacks are statically allocated or handled by the same custom allocator mechanism as other thread stacks. Closes #4524.
* score: Simplify _Thread_Create_idle_for_CPU()Sebastian Huber2021-08-181-7/+1
| | | | Online processors have a scheduler assigned.
* score: Fix thread initializationSebastian Huber2021-02-261-4/+3
| | | | | | | | 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-1/+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.
* 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 context switch extensions (SMP)Sebastian Huber2020-02-281-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In uniprocessor and SMP configurations, the context switch extensions were called during _Thread_Do_dispatch(): void _Thread_Do_dispatch( Per_CPU_Control *cpu_self, ISR_Level level ) { Thread_Control *executing; executing = cpu_self->executing; ... do { Thread_Control *heir; heir = _Thread_Get_heir_and_make_it_executing( cpu_self ); ... _User_extensions_Thread_switch( executing, heir ); ... _Context_Switch( &executing->Registers, &heir->Registers ); ... } while ( cpu_self->dispatch_necessary ); ... } In uniprocessor configurations, this is fine and the context switch extensions are called for all thread switches except the very first thread switch to the initialization thread. However, in SMP configurations, the context switch may be invalidated and updated in the low-level _Context_Switch() routine. See: https://docs.rtems.org/branches/master/c-user/symmetric_multiprocessing_services.html#thread-dispatch-details In case such an update happens, a thread will execute on the processor which was not seen in the previous call of the context switch extensions. This can confuse for example event record consumers which use events generated by a context switch extension. Fixing this is not straight forward. The context switch extensions call must move after the low-level context switch. The problem here is that we may end up in _Thread_Handler(). Adding the context switch extensions call to _Thread_Handler() covers now also the thread switch to the initialization thread. We also have to save the last executing thread (ancestor) of the processor. Registers or the stack cannot be used for this purpose. We have to add it to the per-processor information. Existing extensions may be affected, since now context switch extensions use the stack of the heir thread. The stack checker is affected by this. Calling the thread switch extensions in the low-level context switch is difficult since at this point an intermediate stack is used which is only large enough to enable servicing of interrupts. Update #3885.
* config: Add _Thread_Idle_bodySebastian Huber2020-02-251-2/+1
| | | | | | | | | Move the idle thread body configuration constant out of the configuration table. Provide a default definition of the idle thread body constant. Update #3875.
* config: Add _Thread_Idle_stack_sizeSebastian Huber2020-02-251-1/+2
| | | | | | | | | | Move the idle thread stack size configuration constant out of the configuration table. Add THREAD_IDLE_STACK_SIZE_DEFAULT and use it to provide a default definition of the idle thread stack size constant. Update #3875.
* score: Statically allocate idle/MPCI stacksSebastian Huber2020-02-121-6/+5
| | | | | | | Place idle and MPCI stacks into extra linker sections. This can be optionally used by applications to control the placement of the stacks. Update #3835.
* score: Move thread stack allocationSebastian Huber2020-02-121-4/+13
| | | | | | Move thread stack allocation to caller side of _Thread_Initialize(). Update #3835.
* score: Add Thread_ConfigurationSebastian Huber2020-02-121-20/+17
| | | | | | | | | 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: Remove _Stack_Ensure_minimum() callSebastian Huber2020-02-121-2/+1
| | | | | | This call is superfluous since _Thread_Initialize() will do this also. Update #3835.
* score: Rename _SMP_Get_processor_count()Sebastian Huber2019-04-111-2/+3
| | | | | | | Rename _SMP_Get_processor_count() in _SMP_Get_processor_maximum() to be in line with the API level rtems_scheduler_get_processor_maximum(). Update #3732.
* doxygen: Rename Score* groups in RTEMSScore*Sebastian Huber2019-04-041-1/+1
| | | | Update #3706
* score: Static Objects_Information initializationSebastian Huber2018-12-141-1/+1
| | | | | | | | | | | 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: Add and use Thread_Control::is_idleSebastian Huber2016-11-091-0/+1
| | | | Update #2797.
* score: Introduce map priority scheduler operationSebastian Huber2016-06-221-1/+3
| | | | | | | | | | | Introduce map/unmap priority scheduler operations to map thread priority values from/to the user domain to/from the scheduler domain. Use the map priority operation to validate the thread priority. The EDF schedulers use this new operation to distinguish between normal priorities and priorities obtain through a job release. Update #2173. Update #2556.
* score: _Thread_Create_idle_for_CPU()Sebastian Huber2016-06-141-12/+12
| | | | Use priority maximum of scheduler instance.
* score: Rename Per_CPU_Control::startedSebastian Huber2016-03-041-1/+1
| | | | | Rename Per_CPU_Control::started into Per_CPU_Control::online to match standard nomenclature.
* score: Create idle threads via linker setSebastian Huber2016-02-031-0/+3
| | | | | | This allows a more fine grained rtems_initialize_data_structures(). Update #2408.
* score: Simplify _Thread_Start()Sebastian Huber2016-01-111-11/+20
|
* score: Introduce Thread_Entry_informationSebastian Huber2016-01-111-8/+9
| | | | | | | This avoids potential dead code in _Thread_Handler(). It gets rid of the dangerous function pointer casts. Update #2514.
* score: Use common names for per-CPU variablesSebastian Huber2014-04-221-11/+11
| | | | | | | | | | | | | | | | Use "cpu" for an arbitrary Per_CPU_Control variable. Use "cpu_self" for the Per_CPU_Control of the current processor. Use "cpu_index" for an arbitrary processor index. Use "cpu_index_self" for the processor index of the current processor. Use "cpu_count" for the processor count obtained via _SMP_Get_processor_count(). Use "cpu_max" for the processor maximum obtained by rtems_configuration_get_maximum_processors().
* score: Add clustered/partitioned schedulingSebastian Huber2014-04-151-1/+5
| | | | | | | | | | | | | | | Clustered/partitioned scheduling helps to control the worst-case latencies in the system. The goal is to reduce the amount of shared state in the system and thus prevention of lock contention. Modern multi-processor systems tend to have several layers of data and instruction caches. With clustered/partitioned scheduling it is possible to honour the cache topology of a system and thus avoid expensive cache synchronization traffic. We have clustered scheduling in case the set of processors of a system is partitioned into non-empty pairwise-disjoint subsets. These subsets are called clusters. Clusters with a cardinality of one are partitions. Each cluster is owned by exactly one scheduler instance.
* Change all references of rtems.com to rtems.org.Chris Johns2014-03-211-1/+1
|
* smp: Add and use _Per_CPU_Get()Sebastian Huber2013-07-301-1/+1
| | | | | | Add and use _Per_CPU_Get_by_index() and _Per_CPU_Get_index(). Add _Per_CPU_Send_interrupt(). This avoids direct access of _Per_CPU_Information.
* score: Create thread implementation headerSebastian Huber2013-07-261-12/+1
| | | | | | | | Move implementation specific parts of thread.h and thread.inl into new header file threadimpl.h. The thread.h contains now only the application visible API. Remove superfluous header file includes from various files.
* score: Merge sysstate API into one fileSebastian Huber2013-07-241-1/+0
|
* score: Create stack implementation headerSebastian Huber2013-07-231-0/+1
| | | | | | Move implementation specific parts of stack.h and stack.inl into new header file stackimpl.h. The stack.h contains now only the application visible API.
* scheduler: Add start idle thread operationSebastian Huber2013-06-141-1/+2
| | | | Add and use _Scheduler_Start_idle().
* score: Simplify _Thread_Create_idle()Sebastian Huber2013-06-141-23/+12
|
* score: Rename rtems_smp_get_number_of_processors()Sebastian Huber2013-06-141-1/+1
| | | | | | | | | Rename in rtems_smp_get_processor_count(). Always provide <rtems/score/smp.h> and <rtems/rtems/smp.h>. Add _SMP_Get_processor_count(). This function will be a compile time constant defined to be one on uni-processor configurations. This allows iterations over all processors without overhead on uni-processor configurations.
* score: Simplify _Thread_Create_idle_helper()Sebastian Huber2013-06-071-9/+0
| | | | | The _Thread_Initialize() function has nothing to do with thread dispatching it simply initializes the thread control.
* score: Remove idle field of Per_CPU_ControlSebastian Huber2013-05-311-5/+6
| | | | | | This field is unused except for special case simulator clock drivers. In these places use an alternative. Add and use _Thread_Set_global_exit_status() and _Thread_Get_global_exit_status().
* score misc: Score misc: Clean up Doxygen #5Alex Ivanov2012-11-291-3/+7
|
* score: Add and use <rtems/score/userextimpl.h>Sebastian Huber2012-11-221-1/+0
| | | | | This file contains the parts of <rtems/score/userext.h> that are only necessary for the RTEMS implementation.
* sapi: Use rtems_configuration_get_idle_taskSebastian Huber2012-11-071-1/+1
|
* sapi: Use rtems_config*_get_idle_task_stack_sizeSebastian Huber2012-11-071-1/+1
|
* Remove All CVS Id Strings Possible Using a ScriptJoel Sherrill2012-05-111-2/+0
| | | | | | | | | | | | Script does what is expected and tries to do it as smartly as possible. + remove occurrences of two blank comment lines next to each other after Id string line removed. + remove entire comment blocks which only exited to contain CVS Ids + If the processing left a blank line at the top of a file, it was removed.
* Remove white-spaces.Ralf Corsepius2011-05-241-1/+1
|