summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include (follow)
Commit message (Collapse)AuthorAgeFilesLines
* 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: Maybe fix _Thread_Lock_acquire()Sebastian Huber2016-06-022-42/+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: Use owner of thread queue for CORE mutexSebastian Huber2016-05-302-13/+8
|
* score: Rework CORE inherit priority mutexSebastian Huber2016-05-303-205/+109
| | | | | Provide dedicated seize and surrender methods for inherit priority mutexes. This eliminates CORE_mutex_Attributes.
* score: Rework CORE priority ceiling mutexSebastian Huber2016-05-302-94/+180
| | | | | Rework seize and surrender methods to use CORE_ceiling_mutex_Control. This eliminates CORE_mutex_Disciplines.
* score: Add CORE mutex variantsSebastian Huber2016-05-302-32/+188
| | | | | | | | 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-302-28/+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-302-9/+0
| | | | | Remove superfluous support for simple binary semaphores. With this we can get rid of the CORE_MUTEX_NESTING_BLOCKS variant.
* score: Add semaphore variantsSebastian Huber2016-05-302-43/+28
|
* score: Use thread queue lock for MrsPSebastian Huber2016-05-302-10/+17
| | | | | | 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: _CORE_mutex_Check_dispatch_for_seize()Sebastian Huber2016-05-306-46/+59
| | | | | | | | | | | 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 _Thread_queue_Context_set_MP_callout()Sebastian Huber2016-05-303-26/+38
| | | | | | 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: Adjust thread queue layoutSebastian Huber2016-05-302-12/+21
| | | | | | Adjust thread queue layout according to Newlib. This makes it possible to use the same implementation for <sys/lock.h> and CORE mutexes in the future.
* score: Add Status_Control for all APIsSebastian Huber2016-05-2613-376/+281
| | | | | | | | | | | 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.
* Fix semaphore post overflow statusSebastian Huber2016-05-261-1/+2
| | | | Close #2720.
* posix: Fix pthread_spin_unlock() error statusSebastian Huber2016-05-251-6/+2
| | | | Close #2719.
* score: Move thread queue MP callout to contextSebastian Huber2016-05-259-702/+434
| | | | | | | | 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-256-92/+8
| | | | | Get rid of the mp_id parameter used for some thread queue methods. Use THREAD_QUEUE_QUEUE_TO_OBJECT() instead.
* score: Move thread queue object supportSebastian Huber2016-05-252-20/+27
|
* mpci: Fix thread queue flush methodSebastian Huber2016-05-252-49/+30
| | | | | | | We must call the MP callout for proxies if we unblock them after a thread queue extraction. This was missing in _Thread_queue_Flush_critical(). Move thread remove timer and unblock code to new function _Thread_Remove_timer_and_unblock().
* score: Fix blocking _CORE_message_queue_Submit()Sebastian Huber2016-05-241-3/+1
| | | | Close #2718.
* score: _CORE_message_queue_Seize()Sebastian Huber2016-05-241-3/+0
| | | | Delete unused parameter.
* score: _CORE_semaphore_Seize()Sebastian Huber2016-05-201-2/+0
| | | | Delete unused parameter.
* Replace *_Get_interrupt_disable() with *_Get()Sebastian Huber2016-05-201-1/+1
| | | | | Uniformly use *_Get() to get an object by identifier with a lock context.
* score: Rename _Objects_Get_local()Sebastian Huber2016-05-202-2/+2
| | | | | | Rename _Objects_Get_local() into _Objects_Get(). Confusions with the previous _Objects_Get() function are avoided since the Objects_Locations parameter is gone.
* score: Delete unused _Objects_Get_isr_disable()Sebastian Huber2016-05-201-42/+0
| | | | Delete now unused Objects_Locations.
* mpci: Simplify _Objects_MP_Is_remote()Sebastian Huber2016-05-202-11/+11
|
* score: Add const to _RBTree_Find_inline()Sebastian Huber2016-05-201-8/+18
|
* score: Delete unused _Objects_Get_local_object()Sebastian Huber2016-05-201-27/+0
|
* score: Use _RBTree_Insert_inline()Sebastian Huber2016-05-201-15/+0
| | | | | | Use _RBTree_Insert_inline() for priority thread queues. Update #2556.
* score: Add per scheduler instance maximum prioritySebastian Huber2016-05-206-8/+22
| | | | | | | | | | | The priority values are only valid within a scheduler instance. Thus, the maximum priority value must be defined per scheduler instance. The first scheduler instance defines PRIORITY_MAXIMUM. This implies that RTEMS_MAXIMUM_PRIORITY and POSIX_SCHEDULER_MAXIMUM_PRIORITY are only valid for threads of the first scheduler instance. Further API/implementation changes are necessary to fix this. Update #2556.
* score: Remove the Giant lockSebastian Huber2016-05-202-181/+0
| | | | Update #2555.
* score: Rename _ISR_Flash() into _ISR_Local_flash()Sebastian Huber2016-05-202-3/+3
| | | | | | This is a preparation to remove the Giant lock. Update #2555.
* score: Rename _ISR_Disable() and _ISR_Enable()Sebastian Huber2016-05-207-83/+57
| | | | | | | | | Rename _ISR_Disable() into _ISR_Local_disable(). Rename _ISR_Enable() into _ISR_Local_enable(). Remove _Debug_Is_owner_of_giant(). This is a preparation to remove the Giant lock. Update #2555.
* score: Rename _ISR_Disable_without_giant()Sebastian Huber2016-05-207-22/+22
| | | | | | | | | 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: _Thread_Dispatch_increment_disable_level()Sebastian Huber2016-05-201-0/+12
| | | | | | | | | | Avoid _Thread_Dispatch_increment_disable_level() and _Thread_Dispatch_decrement_disable_level() and thus the Giant lock. This is a preparation to remove the Giant lock. Update #2555.
* score: Delete unused _Objects_Get()Sebastian Huber2016-05-202-101/+17
| | | | Update #2555.
* score: Delete unused _Thread_Get()Sebastian Huber2016-05-201-26/+0
| | | | Update #2555.
* posix: Rework thread cancellationSebastian Huber2016-05-202-1/+9
| | | | | | | | Add Thread_Life_state::THREAD_LIFE_CHANGE_DEFERRED and rework the POSIX thread cancellation to use the thread life states. Update #2555. Update #2626.
* score: Avoid Giant lock for _Thread_Start()Sebastian Huber2016-05-202-17/+3
| | | | Update #2555.
* posix: Rework pthread_join()Sebastian Huber2016-05-203-3/+39
| | | | | | | | | Rework pthread_join() to use _Thread_Join(). Close #2402. Update #2555. Update #2626. Close #2714.
* score: Simplify _Thread_Life_action_handler()Sebastian Huber2016-05-201-1/+0
| | | | | | | | Use _Thread_Change_life_locked() to avoid duplicated code. Avoid Giant lock in _Thread_Life_action_handler(). Update #2555. Update #2626.
* score: Rework _Thread_Restart_other()Sebastian Huber2016-05-202-2/+7
| | | | | | | | | Rework _Thread_Restart_other() to use _Thread_Change_life_locked(). Cope with concurrent change requests by means of a pending request counter. Update #2555. Update #2626.
* score: Split _Thread_Restart()Sebastian Huber2016-05-201-27/+9
| | | | | | | | | | | Split _Thread_Restart() into _Thread_Restart_self() and _Thread_Restart_other(). Move content of existing _Thread_Restart_self() into new _Thread_Restart_self(). Avoid Giant lock for thread restart. _Thread_Restart_self() is a no-return function and used by _Thread_Global_construction(). Update #2555. Update #2626.
* score: Add _Thread_Dispatch_disable_with_CPU()Sebastian Huber2016-05-201-5/+23
| | | | | Update #2555. Update #2626.
* score: Add _Thread_Clear_state_locked()Sebastian Huber2016-05-201-0/+5
| | | | | | | | This makes it possible to do thread state and thread life changes together under protection of the thread state lock. Update #2555. Update #2626.
* score: Add _Thread_Set_state_locked()Sebastian Huber2016-05-201-0/+5
| | | | | | | | This makes it possible to do thread state and thread life changes together under protection of the thread state lock. Update #2555. Update #2626.
* score: Add _Thread_Join() and _Thread_Cancel()Sebastian Huber2016-05-203-11/+9
| | | | | | | | Split _Thread_Close() into _Thread_Join() and _Thread_Cancel() to prepare for a re-use in pthread_join() and pthread_cancel(). Update #2555. Update #2626.
* score: Add Thread_Change_life()Sebastian Huber2016-05-203-7/+7
| | | | | | | | | 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.