summaryrefslogtreecommitdiffstats
path: root/cpukit/include/rtems/score/coremuteximpl.h (unfollow)
Commit message (Collapse)AuthorFilesLines
2019-04-04doxygen: Rename Score* groups in RTEMSScore*Sebastian Huber1-2/+2
Update #3706
2018-01-25Remove make preinstallChris Johns1-0/+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.
2017-10-10score: Add _Thread_queue_Dispatch_disable()Sebastian Huber1-3/+1
2017-01-31score: Add _Thread_queue_Object_nameSebastian Huber1-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.
2016-12-02score: Initialize thread queue context earlySebastian Huber1-2/+1
Initialize thread queue context early preferably outside the critical section. Remove implicit _Thread_queue_Context_initialize() from _Thread_Wait_acquire().
2016-11-28score: Fix thread queue context initializationSebastian Huber1-0/+1
Initialize the thread queue context with invalid data in debug configurations to catch missing set up steps.
2016-11-09score: Avoid _Scheduler_Get_by_CPU_index( 0 )Sebastian Huber1-1/+1
Avoid use of processor index 0 which may have no scheduler assigned.
2016-11-03score: Introduce thread resource count methodsSebastian Huber1-5/+5
This makes it easier to conditionally enable/disable the thread resource count usage.
2016-11-02score: Introduce Thread_Scheduler_control::homeSebastian Huber1-1/+1
Replace Thread_Scheduler_control::control and Thread_Scheduler_control::own_control with new Thread_Scheduler_control::home. Update #2556.
2016-11-02score: Delete Thread_Scheduler_control::own_nodeSebastian Huber1-3/+3
Update #2556.
2016-09-27score: Unify CORE mutex seize/surrenderSebastian Huber1-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.
2016-09-27score: Simplify CORE mutex seizeSebastian Huber1-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.
2016-09-21score: Rework thread priority managementSebastian Huber1-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.
2016-09-08score: Introduce _Thread_Get_priority()Sebastian Huber1-1/+1
Avoid direct access to thread internal data fields.
2016-09-08score: Introduce Thread_queue_Lock_contextSebastian Huber1-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.
2016-09-08score: Simplify thread queue acquire/releaseSebastian Huber1-8/+2
2016-08-11score: Add _Thread_queue_Surrender()Sebastian Huber1-11/+5
Add _Thread_queue_Surrender() to unify the mutex surrender procedures which involve a thread queue operation.
2016-07-27score: Priority inherit thread queue operationsSebastian Huber1-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.
2016-07-25cpukit: Add and use Watchdog_Discipline.Gedare Bloom1-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
2016-06-22score: Introduce map priority scheduler operationSebastian Huber1-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.
2016-06-06rtems: Fix no protocol mutex releaseSebastian Huber1-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
2016-05-30score: Use owner of thread queue for CORE mutexSebastian Huber1-3/+2
2016-05-30score: Rework CORE inherit priority mutexSebastian Huber1-155/+108
Provide dedicated seize and surrender methods for inherit priority mutexes. This eliminates CORE_mutex_Attributes.
2016-05-30score: Rework CORE priority ceiling mutexSebastian Huber1-70/+180
Rework seize and surrender methods to use CORE_ceiling_mutex_Control. This eliminates CORE_mutex_Disciplines.
2016-05-30score: Add CORE mutex variantsSebastian Huber1-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.
2016-05-30rtems: Simplify rtems_semaphore_delete()Sebastian Huber1-14/+0
Due to the unified status codes, we can now use a common flush and destroy method for semaphore and mutex variants.
2016-05-30score: Simplify CORE mutexSebastian Huber1-2/+0
Remove superfluous support for simple binary semaphores. With this we can get rid of the CORE_MUTEX_NESTING_BLOCKS variant.
2016-05-30score: _CORE_mutex_Check_dispatch_for_seize()Sebastian Huber1-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().
2016-05-26score: Add Status_Control for all APIsSebastian Huber1-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.
2016-05-25score: Move thread queue MP callout to contextSebastian Huber1-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.
2016-05-25score: Get rid of mp_id parameterSebastian Huber1-6/+0
Get rid of the mp_id parameter used for some thread queue methods. Use THREAD_QUEUE_QUEUE_TO_OBJECT() instead.
2016-05-12score: Fix CORE mutex initializationSebastian Huber1-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.
2016-05-02score: __RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__Sebastian Huber1-233/+158
Delete __RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__ as a preparation to restructure the CORE mutex variants and reduce the branch complexity.
2016-05-02score: Delete __RTEMS_STRICT_ORDER_MUTEX__Sebastian Huber1-14/+0
Remove support for strict order mutexes. Close #2124.
2016-04-27posix: Avoid Giant lock for condition variablesSebastian Huber1-0/+8
Update #2555.
2016-04-22score: Avoid Giant lock for CORE mtx/semSebastian Huber1-16/+10
Avoid Giant lock for CORE mutex and semaphore flush and delete operations. Update #2555.
2016-04-21score: Introduce _Thread_queue_Flush_critical()Sebastian Huber1-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.
2016-04-21score: Add and use _CORE_mutex_Acquire_critical()Sebastian Huber1-8/+24
Add and use _CORE_mutex_Release().
2016-04-21score: Remove id parameter _CORE_mutex_Seize()Sebastian Huber1-6/+2
Parameter was unused.
2016-04-06score: Rework MP thread queue callout supportSebastian Huber1-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.
2016-04-06score: _Thread_queue_Flush() parameter changesSebastian Huber1-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.
2016-04-06score: Delete Thread_Wait_information::idSebastian Huber1-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.
2016-03-29score: Remove Thread_queue_Queue::operations fieldSebastian Huber1-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.
2015-05-19score: _Thread_Dispatch_disable_critical()Sebastian Huber1-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.
2015-05-19score: Rework _Thread_Change_priority()Sebastian Huber1-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.
2015-05-19score: Fine grained locking for mutexesSebastian Huber1-21/+19
Update #2273.
2015-05-19score: Add Thread_queue_Control::LockSebastian Huber1-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.
2015-04-23score: _CORE_mutex_Seize_interrupt_blocking()Sebastian Huber1-6/+9
Move some code into _CORE_mutex_Seize_interrupt_blocking() so that the thread queue handling is in one place.
2015-04-21score: _Objects_Get_isr_disable()Sebastian Huber1-22/+22
Use ISR_lock_Context instead of ISR_Level to allow use of ISR locks for low-level locking. Update #2273.
2015-04-16score: Add const qualifierSebastian Huber1-1/+1