summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/coremuteximpl.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-2/+1
| | | | | | | | Initialize thread queue context early preferably outside the critical section. Remove implicit _Thread_queue_Context_initialize() from _Thread_Wait_acquire().
* score: Fix thread queue context initializationSebastian Huber2016-11-281-0/+1
| | | | | Initialize the thread queue context with invalid data in debug configurations to catch missing set up steps.
* score: Avoid _Scheduler_Get_by_CPU_index( 0 )Sebastian Huber2016-11-091-1/+1
| | | | Avoid use of processor index 0 which may have no scheduler assigned.
* score: Introduce thread resource count methodsSebastian Huber2016-11-031-5/+5
| | | | | This makes it easier to conditionally enable/disable the thread resource count usage.
* 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/+3
| | | | Update #2556.
* score: Unify CORE mutex seize/surrenderSebastian Huber2016-09-271-87/+6
| | | | | | Use the Thread_Control::resource_count for the no protocol mutexes. Merge the no protocol and priority inherit CORE mutex seize/surrender operations.
* score: Simplify CORE mutex seizeSebastian Huber2016-09-271-11/+3
| | | | | | Rename _CORE_mutex_Seize_no_protocol_slow() in _CORE_mutex_Seize_slow(). Remove previous _CORE_mutex_Seize_slow() since the protocol handling is now done in the thread queue operations.
* score: Rework thread priority managementSebastian Huber2016-09-211-77/+69
| | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+1
| | | | Avoid direct access to thread internal data fields.
* score: Introduce Thread_queue_Lock_contextSebastian Huber2016-09-081-2/+4
| | | | | | 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-8/+2
|
* score: Add _Thread_queue_Surrender()Sebastian Huber2016-08-111-11/+5
| | | | | Add _Thread_queue_Surrender() to unify the mutex surrender procedures which involve a thread queue operation.
* score: Priority inherit thread queue operationsSebastian Huber2016-07-271-0/+3
| | | | | | | | | 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.
* cpukit: Add and use Watchdog_Discipline.Gedare Bloom2016-07-251-8/+0
| | | | | | | | | 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-0/+42
| | | | | | | | | | | 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.
* rtems: Fix no protocol mutex releaseSebastian Huber2016-06-061-43/+11
| | | | | | | | | | | | | | | | The Classic binary semaphores without a locking protocol (RTEMS_BINARY_SEMAPHORE) could be released by everyone, e.g. in contrast to the POSIX mutexes (all variants) or the Classic binary semphores with priority inheritance or ceiling, there was no owner check in the release path. This behaviour was a bit unexpected and not documented. Add an owner check to the release path. Update sptests/sp42 accordingly. This change has nothing to do with the simple binary semaphores (RTEMS_SIMPLE_BINARY_SEMAPHORE) which have no owner at all. Update #2725
* score: Use owner of thread queue for CORE mutexSebastian Huber2016-05-301-3/+2
|
* score: Rework CORE inherit priority mutexSebastian Huber2016-05-301-155/+108
| | | | | Provide dedicated seize and surrender methods for inherit priority mutexes. This eliminates CORE_mutex_Attributes.
* score: Rework CORE priority ceiling mutexSebastian Huber2016-05-301-70/+180
| | | | | Rework seize and surrender methods to use CORE_ceiling_mutex_Control. This eliminates CORE_mutex_Disciplines.
* score: Add CORE mutex variantsSebastian Huber2016-05-301-19/+158
| | | | | | | | Add CORE_recursive_mutex_Control and CORE_ceiling_mutex_Control to avoid the run-time evaluation of attributes to figure out how a particular mutex methods should behave. Start with the no protocol variants. This eliminates the CORE_MUTEX_DISCIPLINES_FIFO and CORE_MUTEX_DISCIPLINES_PRIORITY disciplines.
* rtems: Simplify rtems_semaphore_delete()Sebastian Huber2016-05-301-14/+0
| | | | | Due to the unified status codes, we can now use a common flush and destroy method for semaphore and mutex variants.
* score: Simplify CORE mutexSebastian Huber2016-05-301-2/+0
| | | | | Remove superfluous support for simple binary semaphores. With this we can get rid of the CORE_MUTEX_NESTING_BLOCKS variant.
* score: _CORE_mutex_Check_dispatch_for_seize()Sebastian Huber2016-05-301-28/+5
| | | | | | | | | | | 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().
* score: Add Status_Control for all APIsSebastian Huber2016-05-261-102/+44
| | | | | | | | | | | 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-76/+59
| | | | | | | | 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: Get rid of mp_id parameterSebastian Huber2016-05-251-6/+0
| | | | | Get rid of the mp_id parameter used for some thread queue methods. Use THREAD_QUEUE_QUEUE_TO_OBJECT() instead.
* score: Fix CORE mutex initializationSebastian Huber2016-05-121-19/+0
| | | | | | | | | The priority inheritance and ceiling CORE mutexes wrongly used the FIFO queueing discipline. Delete misleading _CORE_mutex_Is_priority(). Bug introduced by 1e1a91ed11458ddbb27b94d0001d8f0fc2ef7a97. Add test sptests/spmutex01, since no existing uni-processor test covered the thread priority queueing discipline for CORE mutexes.
* score: __RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__Sebastian Huber2016-05-021-233/+158
| | | | | Delete __RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__ as a preparation to restructure the CORE mutex variants and reduce the branch complexity.
* score: Delete __RTEMS_STRICT_ORDER_MUTEX__Sebastian Huber2016-05-021-14/+0
| | | | | | Remove support for strict order mutexes. Close #2124.
* posix: Avoid Giant lock for condition variablesSebastian Huber2016-04-271-0/+8
| | | | Update #2555.
* score: Avoid Giant lock for CORE mtx/semSebastian Huber2016-04-221-16/+10
| | | | | | | Avoid Giant lock for CORE mutex and semaphore flush and delete operations. Update #2555.
* score: Introduce _Thread_queue_Flush_critical()Sebastian Huber2016-04-211-8/+28
| | | | | | | | Replace _Thread_queue_Flush() with _Thread_queue_Flush_critical() and add a filter function for customization of the thread queue flush operation. Update #2555.
* score: Add and use _CORE_mutex_Acquire_critical()Sebastian Huber2016-04-211-8/+24
| | | | Add and use _CORE_mutex_Release().
* score: Remove id parameter _CORE_mutex_Seize()Sebastian Huber2016-04-211-6/+2
| | | | Parameter was unused.
* score: Rework MP thread queue callout supportSebastian Huber2016-04-061-31/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The thread queue implementation was heavily reworked to support SMP. This broke the multiprocessing support of the thread queues. This is fixed by this patch. A thread proxy is unblocked due to three reasons 1) timeout, 2) request satisfaction, and 3) extraction. In case 1) no MPCI message must be sent. This is ensured via the _Thread_queue_MP_callout_do_nothing() callout set during _Thread_MP_Allocate_proxy(). In case 2) and 3) an MPCI message must be sent. In case we interrupt the blocking operation during _Thread_queue_Enqueue_critical(), then this message must be sent by the blocking thread. For this the new fields Thread_Proxy_control::thread_queue_callout and Thread_Proxy_control::thread_queue_id are used. Delete the individual API MP callout types and use Thread_queue_MP_callout throughout. This type is only defined in multiprocessing configurations. Prefix the multiprocessing parameters with mp_ to ease code review. Multiprocessing specific parameters are optional due to use of a similar macro pattern. There is no overhead for non-multiprocessing configurations.
* score: _Thread_queue_Flush() parameter changesSebastian Huber2016-04-061-17/+14
| | | | | | | | | | | | Change _Thread_queue_Flush() into a macro that invokes _Thread_queue_Do_flush() with the parameter set defined by RTEMS_MULTIPROCESSING. For multiprocessing configurations add the object identifier to avoid direct use of the thread wait information. Use mp_ prefix for multiprocessing related parameters. Rename Thread_queue_Flush_callout to Thread_queue_MP_callout since this type will be re-used later for other operations as well.
* score: Delete Thread_Wait_information::idSebastian Huber2016-04-061-1/+0
| | | | | | | | | | | This field was only by the monitor in non-multiprocessing configurations. Add new field Thread_Wait_information::remote_id in multiprocessing configurations and use it for the remote procedure call thread queue. Add _Thread_Wait_get_id() to obtain the object identifier for debug and system information tools. Ensure the object layout via static asserts. Add test cases to sptests/spthreadq01.
* score: Remove Thread_queue_Queue::operations fieldSebastian Huber2016-03-291-3/+3
| | | | | | | | | Remove the Thread_queue_Queue::operations field to reduce the size of this structure. Add a thread queue operations parameter to the _Thread_queue_First(), _Thread_queue_First_locked(), _Thread_queue_Enqueue(), _Thread_queue_Dequeue() and _Thread_queue_Flush() functions. This is a preparation patch to reduce the size of several synchronization objects.
* score: _Thread_Dispatch_disable_critical()Sebastian Huber2015-05-191-1/+1
| | | | | | | 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: Rework _Thread_Change_priority()Sebastian Huber2015-05-191-5/+1
| | | | | | | | | | | | | 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: Fine grained locking for mutexesSebastian Huber2015-05-191-21/+19
| | | | Update #2273.
* score: Add Thread_queue_Control::LockSebastian Huber2015-05-191-0/+5
| | | | | | | | | | | Move the complete thread queue enqueue procedure into _Thread_queue_Enqueue_critical(). It is possible to use the thread queue lock to protect state of the object embedding the thread queue. This enables per object fine grained locking in the future. Delete _Thread_queue_Enter_critical_section(). Update #2273.
* score: _CORE_mutex_Seize_interrupt_blocking()Sebastian Huber2015-04-231-6/+9
| | | | | Move some code into _CORE_mutex_Seize_interrupt_blocking() so that the thread queue handling is in one place.
* score: _Objects_Get_isr_disable()Sebastian Huber2015-04-211-22/+22
| | | | | | | Use ISR_lock_Context instead of ISR_Level to allow use of ISR locks for low-level locking. Update #2273.
* score: Add const qualifierSebastian Huber2015-04-161-1/+1
|
* coremuteximpl.h: Reorder macro names to match body and fix Doxygen warningsJoel Sherrill2015-03-061-7/+13
| | | | closes 2285.
* score: Delete CORE_mutex_Control::lockSebastian Huber2014-03-311-15/+5
| | | | | | | | The holder field is enough to determine if a mutex is locked or not. This leads also to better error status codes in case a rtems_semaphore_release() is done for a mutex without having the ownership.
* score: Delete CORE_mutex_Control::holder_idSebastian Huber2014-03-311-1/+0
| | | | We can use the holder pointer to get the identifier if necessary.