summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/mrspimpl.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* score: Add _Thread_queue_Object_nameSebastian Huber2017-01-311-1/+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: Initialize thread queue context earlySebastian Huber2016-12-021-1/+1
| | | | | | | | Initialize thread queue context early preferably outside the critical section. Remove implicit _Thread_queue_Context_initialize() from _Thread_Wait_acquire().
* score: Constify _MRSP_Get_owner()Sebastian Huber2016-11-181-1/+3
|
* score: Fix _MRSP_Initialize()Sebastian Huber2016-11-091-4/+4
| | | | | The ceiling priorities must be initialized by scheduler index. Do not confuse it with a processor index.
* score: Introduce Thread_Scheduler_control::homeSebastian Huber2016-11-021-1/+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-3/+6
| | | | Update #2556.
* score: First part of new MrsP implementationSebastian Huber2016-11-021-205/+79
| | | | Update #2556.
* score: Use scheduler instance specific locksSebastian Huber2016-11-021-2/+2
| | | | Update #2556.
* score: Rework thread priority managementSebastian Huber2016-09-211-111/+144
| | | | | | | | | | | | | | | | | | | | | | | | | 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-2/+2
| | | | Avoid direct access to thread internal data fields.
* score: Introduce Thread_queue_Lock_contextSebastian Huber2016-09-081-7/+13
| | | | | | 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-5/+2
|
* score: Fix for RTEMS_DEBUGSebastian Huber2016-09-081-0/+1
|
* cpukit: Add and use Watchdog_Discipline.Gedare Bloom2016-07-251-3/+2
| | | | | | | | | 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: Introduce map priority scheduler operationSebastian Huber2016-06-221-16/+30
| | | | | | | | | | | 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: Use thread queue lock for MrsPSebastian Huber2016-05-301-4/+8
| | | | | | Replace the ISR lock in MRSP_Control with a thread queue. This simplifies the Classic semaphore implementation. Only the lock part of the thread queue is used.
* score: Add _Thread_queue_Context_set_MP_callout()Sebastian Huber2016-05-301-1/+1
| | | | | | Add _Thread_queue_Context_set_MP_callout() to simplify _Thread_queue_Context_initialize(). This makes it possible to more easily add additional fields to Thread_queue_Context.
* score: Add Status_Control for all APIsSebastian Huber2016-05-261-21/+28
| | | | | | | | | | | Unify the status codes of the Classic and POSIX API to use the new enum Status_Control. This eliminates the Thread_Control::Wait::timeout_code field and the timeout parameter of _Thread_queue_Enqueue_critical() and _MPCI_Send_request_packet(). It gets rid of the status code translation tables and instead uses simple bit operations to get the status for a particular API. This enables translation of status code constants at compile time. Add _Thread_Wait_get_status() to avoid direct access of thread internal data structures.
* score: Move thread queue MP callout to contextSebastian Huber2016-05-251-48/+49
| | | | | | | | Drop the multiprocessing (MP) dependent callout parameter from the thread queue extract, dequeue, flush and unblock methods. Merge this parameter with the lock context into new structure Thread_queue_Context. This helps to gets rid of the conditionally compiled method call helpers.
* score: Rename _ISR_Disable_without_giant()Sebastian Huber2016-05-201-4/+4
| | | | | | | | | Rename _ISR_Disable_without_giant() into _ISR_Local_disable(). Rename _ISR_Enable_without_giant() into _ISR_Local_enable(). This is a preparation to remove the Giant lock. Update #2555.
* score: Add Thread_Change_life()Sebastian Huber2016-05-201-3/+3
| | | | | | | | | Add _Thread_Change_life_locked() as a general function to alter the thread life state. Use it to implement _Thread_Set_life_protection() as a first step. Update #2555. Update #2626.
* score: Avoid Giant lock for CORE mtx/semSebastian Huber2016-04-221-10/+31
| | | | | | | Avoid Giant lock for CORE mutex and semaphore flush and delete operations. Update #2555.
* score: Rename _MRSP_Obtain()Sebastian Huber2016-04-211-2/+2
| | | | | | Rename _MRSP_Obtain() into _MRSP_Seize(). Rename _MRSP_Release() into _MRSP_Surrender(). This avoids confusion with the ISR lock acquire and release.
* score: Close semaphore object before flushSebastian Huber2016-04-211-3/+6
| | | | | This prevents use of the object after the flush on uni-processor configurations.
* score: Replace watchdog handler implementationSebastian Huber2016-03-041-16/+16
| | | | | | | | | Use a red-black tree instead of delta chains. Close #2344. Update #2554. Update #2555. Close #2606.
* score: _Thread_Dispatch_disable_critical()Sebastian Huber2015-05-191-3/+3
| | | | | | | Thread dispatching is disabled in case interrupts are disabled. To get an accurate thread dispatch disabled time it is important to use the interrupt disabled instant in case a transition from an interrupt disabled section to a thread dispatch level section happens.
* score: Fine grained locking for MrsPSebastian Huber2015-05-191-38/+98
| | | | Update #2273.
* score: Rework _Thread_Change_priority()Sebastian Huber2015-05-191-16/+20
| | | | | | | | | | | | | Move the writes to Thread_Control::current_priority and Thread_Control::real_priority into _Thread_Change_priority() under the protection of the thread lock. Add a filter function to _Thread_Change_priority() to enable specialized variants. Avoid race conditions during a thread priority restore with the new Thread_Control::priority_restore_hint for an important average case optimizations used by priority inheritance mutexes. Update #2273.
* score: Add header to _Watchdog_Remove()Sebastian Huber2015-05-191-1/+1
| | | | | | | | Add watchdog header parameter to _Watchdog_Remove() to be in line with the other operations. Add _Watchdog_Remove_ticks() and _Watchdog_Remove_seconds() for convenience. Update #2307.
* score: Fix scheduler helping protocolSebastian Huber2015-05-111-2/+2
| | | | | | Account for priority changes of threads executing in a foreign partition. Exchange idle threads in case a victim node uses an idle thread and the new scheduled node needs an idle thread.
* score: Fix MrsP ISR/task sychronizationSebastian Huber2015-03-241-9/+12
|
* smp: Fix timeout for MrsP semaphoresSebastian Huber2014-12-181-53/+58
| | | | | | | | The previous timeout handling was flawed. In case a waiting thread helped out the owner could use the scheduler node indefinitely long. Update the resource tree in _MRSP_Timeout() to avoid this issue. Bug reported by Luca Bonato.
* Add and use RTEMS_CONTAINER_OF()Sebastian Huber2014-08-051-1/+1
|
* score: Implement scheduler helping protocolSebastian Huber2014-07-091-24/+6
| | | | | | | | | | | | | | | | | | | | | | | | | The following scheduler operations return a thread in need for help - unblock, - change priority, and - yield. A thread in need for help is a thread that encounters a scheduler state change from scheduled to ready or a thread that cannot be scheduled in an unblock operation. Such a thread can ask threads which depend on resources owned by this thread for help. Add a new ask for help scheduler operation. This operation is used by _Scheduler_Ask_for_help() to help threads in need for help returned by the operations mentioned above. This operation is also used by _Scheduler_Thread_change_resource_root() in case the root of a resource sub-tree changes. A use case is the ownership change of a resource. In case it is not possible to schedule a thread in need for help, then the corresponding scheduler node will be placed into the set of ready scheduler nodes of the scheduler instance. Once a state change from ready to scheduled happens for this scheduler node it may be used to schedule the thread in need for help.
* score: Add _Scheduler_Help()Sebastian Huber2014-07-081-12/+20
| | | | Manage the help state of threads with respect to scheduling decisions.
* score: Fix MrsP resource root changeSebastian Huber2014-07-041-1/+4
| | | | | Use the root of the owner for the new root, since the owner may depend on a resource as well.
* score: Fix MrsP root node updateSebastian Huber2014-06-101-1/+1
| | | | Set the new root after the resource tree update.
* score: Use Resource Handler for MrsP semaphoresSebastian Huber2014-06-031-30/+103
| | | | | This enables proper resource dependency tracking and as a side-effect deadlock detection.
* score: Multiprocessor Resource Sharing ProtocolSebastian Huber2014-05-281-0/+283
Add basic support for the Multiprocessor Resource Sharing Protocol (MrsP). The Multiprocessor Resource Sharing Protocol (MrsP) is defined in A. Burns and A.J. Wellings, A Schedulability Compatible Multiprocessor Resource Sharing Protocol - MrsP, Proceedings of the 25th Euromicro Conference on Real-Time Systems (ECRTS 2013), July 2013. It is a generalization of the Priority Ceiling Protocol to SMP systems. Each MrsP semaphore uses a ceiling priority per scheduler instance. These ceiling priorities can be specified with rtems_semaphore_set_priority(). A task obtaining or owning a MrsP semaphore will execute with the ceiling priority for its scheduler instance as specified by the MrsP semaphore object. Tasks waiting to get ownership of a MrsP semaphore will not relinquish the processor voluntarily. In case the owner of a MrsP semaphore gets preempted it can ask all tasks waiting for this semaphore to help out and temporarily borrow the right to execute on one of their assigned processors. The help out feature is not implemented with this patch.