summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/threadimpl.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Remove make preinstallChris Johns2018-01-251-1969/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A speciality of the RTEMS build system was the make preinstall step. It copied header files from arbitrary locations into the build tree. The header files were included via the -Bsome/build/tree/path GCC command line option. This has at least seven problems: * The make preinstall step itself needs time and disk space. * Errors in header files show up in the build tree copy. This makes it hard for editors to open the right file to fix the error. * There is no clear relationship between source and build tree header files. This makes an audit of the build process difficult. * The visibility of all header files in the build tree makes it difficult to enforce API barriers. For example it is discouraged to use BSP-specifics in the cpukit. * An introduction of a new build system is difficult. * Include paths specified by the -B option are system headers. This may suppress warnings. * The parallel build had sporadic failures on some hosts. This patch removes the make preinstall step. All installed header files are moved to dedicated include directories in the source tree. Let @RTEMS_CPU@ be the target architecture, e.g. arm, powerpc, sparc, etc. Let @RTEMS_BSP_FAMILIY@ be a BSP family base directory, e.g. erc32, imx, qoriq, etc. The new cpukit include directories are: * cpukit/include * cpukit/score/cpu/@RTEMS_CPU@/include * cpukit/libnetworking The new BSP include directories are: * bsps/include * bsps/@RTEMS_CPU@/include * bsps/@RTEMS_CPU@/@RTEMS_BSP_FAMILIY@/include There are build tree include directories for generated files. The include directory order favours the most general header file, e.g. it is not possible to override general header files via the include path order. The "bootstrap -p" option was removed. The new "bootstrap -H" option should be used to regenerate the "headers.am" files. Update #3254.
* score: Simplify global constructionSebastian Huber2017-11-221-13/+10
| | | | Update #3243.
* score: Add _Thread_Continue()Sebastian Huber2017-10-241-2/+16
| | | | | Update #3117. Update #3182.
* score: Add _Thread_Add_timeout_ticks()Sebastian Huber2017-10-241-6/+5
| | | | | | | | Replace _Thread_Timer_insert_monotonic() with _Thread_Add_timeout_ticks(). Update #3117. Update #3182.
* score: Rename _Watchdog_Per_CPU_insert_monotonic()Sebastian Huber2017-10-171-1/+1
| | | | | | | | Rename _Watchdog_Per_CPU_insert_monotonic() in _Watchdog_Per_CPU_insert_ticks(). Update #3117. Update #3182.
* score: Rename watchdog variantsSebastian Huber2017-10-171-7/+7
| | | | | | | | | | | Rename PER_CPU_WATCHDOG_RELATIVE in PER_CPU_WATCHDOG_MONOTONIC to highlight the corresponding POSIX CLOCK_MONOTONIC. Rename PER_CPU_WATCHDOG_ABSOLUTE in PER_CPU_WATCHDOG_REALTIME to highlight the corresponding POSIX CLOCK_REALTIME. Update #3117. Update #3182.
* score: Remove unused function declarationSebastian Huber2017-10-121-15/+0
|
* score: Rename to _Scheduler_ControlSebastian Huber2017-09-271-1/+1
| | | | | | | Rename struct Scheduler_Control to _Scheduler_Control to allow its use in standard header files, e.g. <pthread.h>. Update #3112.
* score: Move _Thread_Scheduler_ask_for_help()Sebastian Huber2017-02-031-2/+0
| | | | | Move _Thread_Scheduler_ask_for_help(), rename it to _Thread_Ask_for_help() and make it static.
* score: Add _Thread_Set_name()Sebastian Huber2017-01-131-0/+5
| | | | | | Add configuration option CONFIGURE_MAXIMUM_THREAD_NAME_SIZE. Update #2858.
* score: Add and use _Thread_Get_name()Sebastian Huber2017-01-131-1/+7
| | | | Update #2858.
* score: Initialize thread queue context earlySebastian Huber2016-12-021-3/+0
| | | | | | | | Initialize thread queue context early preferably outside the critical section. Remove implicit _Thread_queue_Context_initialize() from _Thread_Wait_acquire().
* score: Add thread queue enqueue calloutSebastian Huber2016-11-231-1/+10
| | | | | | | Replace the expected thread dispatch disable level with a thread queue enqueue callout. This enables the use of _Thread_Dispatch_direct() in the thread queue enqueue procedure. This avoids impossible exection paths, e.g. Per_CPU_Control::dispatch_necessary is always true.
* score: Conditionally enable thread resource countSebastian Huber2016-11-031-0/+10
| | | | | Maintain the thread resource count only in debug configurations. This is a performance optimization for non-debug configurations.
* score: Introduce thread resource count methodsSebastian Huber2016-11-031-0/+14
| | | | | This makes it easier to conditionally enable/disable the thread resource count usage.
* score: Introduce Thread_Scheduler_control::homeSebastian Huber2016-11-021-0/+12
| | | | | | | | 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-12/+1
| | | | Update #2556.
* score: Second part of new MrsP implementationSebastian Huber2016-11-021-0/+7
| | | | Update #2556.
* score: Delete _Scheduler_Ask_for_help_if_necessarySebastian Huber2016-11-021-17/+2
| | | | | | Delete Thread_Control::Resource_node. Update #2556.
* score: First part of new MrsP implementationSebastian Huber2016-11-021-0/+11
| | | | Update #2556.
* score: Add new SMP scheduler helping protocolSebastian Huber2016-11-021-0/+24
| | | | Update #2556.
* score: Add _Thread_Scheduler_process_requests()Sebastian Huber2016-11-021-0/+2
| | | | Update #2556.
* score: Add scheduler node requestsSebastian Huber2016-11-021-1/+46
| | | | | | | 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.
* score: Add thread scheduler lockSebastian Huber2016-11-021-0/+16
| | | | Update #2556.
* score: Add _Thread_Scheduler_remove_wait_node()Sebastian Huber2016-11-021-0/+9
| | | | Update #2556.
* score: Add _Thread_Scheduler_add_wait_node()Sebastian Huber2016-11-021-0/+13
| | | | Update #2556.
* rtems: Add rtems_task_iterate()Sebastian Huber2016-11-021-0/+7
| | | | Update #2423.
* score: Scheduler node awareness for thread queuesSebastian Huber2016-09-211-8/+37
| | | | | | | | Maintain the priority of a thread for each scheduler instance via the thread queue enqueue, extract, priority actions and surrender operations. This replaces the primitive priority boosting. Update #2556.
* score: Add scheduler node table for each threadSebastian Huber2016-09-211-1/+17
| | | | Update #2556.
* score: Rework thread priority managementSebastian Huber2016-09-211-94/+167
| | | | | | | | | | | | | | | | | | | | | | | | | Add priority nodes which contribute to the overall thread priority. The actual priority of a thread is now an aggregation of priority nodes. The thread priority aggregation for the home scheduler instance of a thread consists of at least one priority node, which is normally the real priority of the thread. The locking protocols (e.g. priority ceiling and priority inheritance), rate-monotonic period objects and the POSIX sporadic server add, change and remove priority nodes. A thread changes its priority now immediately, e.g. priority changes are not deferred until the thread releases its last resource. Replace the _Thread_Change_priority() function with * _Thread_Priority_perform_actions(), * _Thread_Priority_add(), * _Thread_Priority_remove(), * _Thread_Priority_change(), and * _Thread_Priority_update(). Update #2412. Update #2556.
* score: Introduce _Thread_Get_priority()Sebastian Huber2016-09-081-0/+18
| | | | Avoid direct access to thread internal data fields.
* score: Add scheduler node implementation headerSebastian Huber2016-09-081-0/+1
| | | | Update #2556.
* score: Move thread wait node to scheduler nodeSebastian Huber2016-09-081-6/+0
| | | | Update #2556.
* score: Introduce Thread_queue_Lock_contextSebastian Huber2016-09-081-35/+45
| | | | | | Introduce Thread_queue_Lock_context to contain the context necessary for thread queue lock and thread wait lock acquire/release operations to reduce the Thread_Control size.
* score: Simplify thread queue acquire/releaseSebastian Huber2016-09-081-4/+6
|
* score: Remove superfluous SMP debug supportSebastian Huber2016-09-071-13/+0
| | | | This information turned out to be useless in the last couple of months.
* score: Fix and simplify thread wait locksSebastian Huber2016-08-031-63/+72
| | | | | | | | | | There was a subtile race condition in _Thread_queue_Do_extract_locked(). It must first update the thread wait flags and then restore the default thread wait state. In the previous implementation this could lead under rare timing conditions to an ineffective _Thread_Wait_tranquilize() resulting to a corrupt system state. Update #2556.
* score: Turn thread lock into thread wait lockSebastian Huber2016-07-271-212/+306
| | | | | | | | | The _Thread_Lock_acquire() function had a potentially infinite run-time due to the lack of fairness at atomic operations level. Update #2412. Update #2556. Update #2765.
* score: Priority inherit thread queue operationsSebastian Huber2016-07-271-31/+0
| | | | | | | | | Move the priority change due to priority interitance to the thread queue enqueue operation to simplify the locking on SMP configurations. Update #2412. Update #2556. Update #2765.
* score: Split _Thread_Change_priority()Sebastian Huber2016-07-271-0/+10
| | | | | | Update #2412. Update #2556. Update #2765.
* score: FormatSebastian Huber2016-07-261-7/+6
|
* cpukit: Add and use Watchdog_Discipline.Gedare Bloom2016-07-251-4/+7
| | | | | | | | | Clock disciplines may be WATCHDOG_RELATIVE, WATCHDOG_ABSOLUTE, or WATCHDOG_NO_TIMEOUT. A discipline of WATCHDOG_RELATIVE with a timeout of WATCHDOG_NO_TIMEOUT is equivalent to a discipline of WATCHDOG_NO_TIMEOUT. updates #2732
* score: Next try to fix thread lock on SMPSebastian Huber2016-07-011-6/+16
|
* score: Avoid atomic fences for thread wait flagsSebastian Huber2016-06-301-12/+30
| | | | | The use of atomic fences is brittle and may break due to changes in different areas which is hard to manage.
* score: Fix thread lock on SMP configurationsSebastian Huber2016-06-301-8/+26
|
* score: Fix SMP message handlingSebastian Huber2016-06-291-14/+2
| | | | | | | | According to the C11 standard only atomic read-modify-write operations guarantee that the last value written in modification order is read, see "7.17.3 Order and consistency". Thus we must use a read-modify-write in _SMP_Inter_processor_interrupt_handler() to make sure we read an up-to-date message.
* score: Add thread priority to scheduler nodesSebastian Huber2016-06-221-0/+5
| | | | | | | | | | | | | | | | | | The thread priority is manifest in two independent areas. One area is the user visible thread priority along with a potential thread queue. The other is the scheduler. Currently, a thread priority update via _Thread_Change_priority() first updates the user visble thread priority and the thread queue, then the scheduler is notified if necessary. The priority is passed to the scheduler via a local variable. A generation counter ensures that the scheduler discards out-of-date priorities. This use of a local variable ties the update in these two areas close together. For later enhancements and the OMIP locking protocol implementation we need more flexibility. Add a thread priority information block to Scheduler_Node and synchronize priority value updates via a sequence lock on SMP configurations. Update #2556.
* score: Maybe fix _Thread_Lock_acquire()Sebastian Huber2016-06-021-37/+7
| | | | | | | The approach with the generation number was broken. The load/store of the current lock, the thread queue and the thread queue operations were not properly synchronized. Under certain conditions on a PowerPC T4240 old thread queue operations operated on a new thread queue (NULL pointer).
* score: Fix _Thread_Lock_acquire()Sebastian Huber2016-06-011-11/+12
| | | | | | | | | A read-modify-write operation is necessary to read the last value written. See for example C11 standard or Power ISA 2.07, Book II: Power ISA Virtual Environment Architecture, Section 1.6.3 Memory Coherence Required [Category: Memory Coherence] and Section 1.7.3 Atomic Update.
* score: _CORE_mutex_Check_dispatch_for_seize()Sebastian Huber2016-05-301-4/+4
| | | | | | | | | | | Move the safety check performed by _CORE_mutex_Check_dispatch_for_seize() out of the performance critical path and generalize it. Blocking on a thread queue with an unexpected thread dispatch disabled level is illegal in all system states. Add the expected thread dispatch disable level (which may be 1 or 2 depending on the operation) to Thread_queue_Context and use it in _Thread_queue_Enqueue_critical().