summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/threaddispatch.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* score: Prevent thread_dispatch_disable_level < 0.Christian Mauderer2016-12-121-0/+2
|
* score: Robust thread dispatchSebastian Huber2016-11-231-1/+18
| | | | | | | | | | | | On SMP configurations, it is a fatal error to call blocking operating system with interrupts disabled, since this prevents delivery of inter-processor interrupts. This could lead to executing threads which are not allowed to execute resulting in undefined behaviour. The ARM Cortex-M port has a similar problem, since the interrupt state is not a part of the thread context. Update #2811.
* score: Add and use _Thread_Dispatch_direct()Sebastian Huber2016-11-181-0/+14
| | | | | | | | | | This function is useful for operations which synchronously block, e.g. self restart, self deletion, yield, sleep. It helps to detect if these operations are called in the wrong context. Since the thread dispatch necessary indicator is not used, this is more robust in some SMP situations. Update #2751.
* score: Remove obsolete definesSebastian Huber2016-11-181-11/+0
| | | | The thread dispatch inline option is no longer used.
* score: Fix SMP message handlingSebastian Huber2016-06-291-0/+24
| | | | | | | | 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: Remove the Giant lockSebastian Huber2016-05-201-175/+0
| | | | Update #2555.
* score: Rename _ISR_Disable() and _ISR_Enable()Sebastian Huber2016-05-201-4/+4
| | | | | | | | | 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-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: _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: Add _Thread_Dispatch_disable_with_CPU()Sebastian Huber2016-05-201-5/+23
| | | | | Update #2555. Update #2626.
* score: _Thread_Dispatch_disable_critical()Sebastian Huber2015-05-191-9/+17
| | | | | | | 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: Modify _Thread_Dispatch_disable_critical()Sebastian Huber2015-04-211-7/+9
| | | | | Return the current processor to be in line with _Thread_Disable_dispatch().
* Fix a number of minor Doxygen formatting issuesJoel Sherrill2015-03-061-1/+1
|
* score: Thread dispatch dis/enable without GiantSebastian Huber2015-03-051-22/+82
| | | | Update #2273.
* score: Add and use _Thread_Do_dispatch()Sebastian Huber2015-03-051-16/+55
| | | | | | | | | | | | The _Thread_Dispatch() function is quite complex and the time to set up and tear down the stack frame is significant. Split this function into two parts. The complex part is now in _Thread_Do_dispatch(). Call _Thread_Do_dispatch() in _Thread_Enable_dispatch() only if necessary. This increases the average case performance. Simplify _Thread_Handler() for SMP configurations. Update #2273.
* score: Add and use _Thread_Enable_dispatch_body()Sebastian Huber2015-03-041-2/+7
| | | | Update #2273.
* score: Inline _Thread_Disable_dispatch() for SMPSebastian Huber2015-03-041-2/+1
|
* score: Add parameter to Giant acquire/releaseSebastian Huber2015-03-041-5/+13
| | | | Update #2273.
* Change all references of rtems.com to rtems.org.Chris Johns2014-03-211-1/+1
|
* score: Add per-CPU profilingSebastian Huber2014-03-141-8/+29
| | | | | | | Add per-CPU profiling stats API. Implement the thread dispatch disable level profiling. The interrupt profiling must be implemented in CPU port specific parts (mostly assembler code). Add a support function _Profiling_Outer_most_interrupt_entry_and_exit() for this purpose.
* score: Add local context to SMP lock APISebastian Huber2014-03-111-4/+3
| | | | | | | | | | | Add a local context structure to the SMP lock API for acquire and release pairs. This context can be used to store the ISR level and profiling information. It may be later used to enable more sophisticated lock algorithms, e.g. MCS locks. There is only one lock that cannot be used with a local context. This is the per-CPU lock since here we would have to transfer the local context through a context switch which is very complicated.
* score: Delete _Thread_Dispatch_set_disable_level()Sebastian Huber2014-03-061-20/+0
| | | | | This function was only used in some tests and can be replaced with other functions.
* score: Add and use _Giant_Drop()Sebastian Huber2014-03-061-0/+12
| | | | New test smptests/smpfatal03.
* smp: Add and use _Assert_Owner_of_giant()Sebastian Huber2013-08-301-2/+2
| | | | | | | | | | | | | | Add and use _ISR_Disable_without_giant() and _ISR_Enable_without_giant() if RTEMS_SMP is defined. On single processor systems the ISR disable/enable was the big hammer which ensured system-wide mutual exclusion. On SMP configurations this no longer works since other processors do not care about disabled interrupts on this processor and continue to execute freely. On SMP in addition to ISR disable/enable an SMP lock must be used. Currently we have only the Giant lock so we can check easily that ISR disable/enable is used only in the right context.
* score: Per-CPU thread dispatch disable levelSebastian Huber2013-08-091-47/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use a per-CPU thread dispatch disable level. So instead of one global thread dispatch disable level we have now one instance per processor. This is a major performance improvement for SMP. On non-SMP configurations this may simplifiy the interrupt entry/exit code. The giant lock is still present, but it is now decoupled from the thread dispatching in _Thread_Dispatch(), _Thread_Handler(), _Thread_Restart_self() and the interrupt entry/exit. Access to the giant lock is now available via _Giant_Acquire() and _Giant_Release(). The giant lock is still implicitly acquired via _Thread_Dispatch_decrement_disable_level(). The giant lock is only acquired for high-level operations in interrupt handlers (e.g. release of a semaphore, sending of an event). As a side-effect this change fixes the lost thread dispatch necessary indication bug in _Thread_Dispatch(). A per-CPU thread dispatch disable level greatly simplifies the SMP support for the interrupt entry/exit code since no spin locks have to be acquired in this area. It is only necessary to get the current processor index and use this to calculate the address of the own per-CPU control. This reduces the interrupt latency considerably. All elements for the interrupt entry/exit code are now part of the Per_CPU_Control structure: thread dispatch disable level, ISR nest level and thread dispatch necessary. Nothing else is required (except CPU port specific stuff like on SPARC).
* smp: Add and use _CPU_SMP_Get_current_processor()Sebastian Huber2013-07-171-2/+2
| | | | | | | | | | Add and use _SMP_Get_current_processor() and rtems_smp_get_current_processor(). Delete bsp_smp_interrupt_cpu(). Change type of current processor index from int to uint32_t to match _SMP_Processor_count type.
* score: Add and use _Thread_Dispatch_is_enabled()Sebastian Huber2013-06-141-32/+13
| | | | | Delete _Thread_Dispatch_in_critical_section() and _Thread_Is_dispatching_enabled().
* score: Add missing includeSebastian Huber2013-06-121-0/+1
|
* score: Move thread dispatch content to new fileSebastian Huber2013-06-071-0/+264
Move thread dispatch declarations and inline functions to new header <rtems/score/threaddispatch.h> to make it independent of the Thread_Control structure. This avoids a cyclic dependency in case thread dispatch functions are used for the object implementation.