summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/threaddispatch.h (unfollow)
Commit message (Collapse)AuthorFilesLines
2018-08-20score: Fix ISR enable in _Thread_Dispatch_enable()Sebastian Huber1-2/+1
This bug had probably no effect since the interrupt enable is idempotent on all CPU ports. Close #3497.
2015-05-19score: _Thread_Dispatch_disable_critical()Sebastian Huber1-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.
2015-04-21score: Modify _Thread_Dispatch_disable_critical()Sebastian Huber1-7/+9
Return the current processor to be in line with _Thread_Disable_dispatch().
2015-03-06Fix a number of minor Doxygen formatting issuesJoel Sherrill1-1/+1
2015-03-05score: Thread dispatch dis/enable without GiantSebastian Huber1-22/+82
Update #2273.
2015-03-05score: Add and use _Thread_Do_dispatch()Sebastian Huber1-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.
2015-03-04score: Add and use _Thread_Enable_dispatch_body()Sebastian Huber1-2/+7
Update #2273.
2015-03-04score: Inline _Thread_Disable_dispatch() for SMPSebastian Huber1-2/+1
2015-03-04score: Add parameter to Giant acquire/releaseSebastian Huber1-5/+13
Update #2273.
2014-03-21Change all references of rtems.com to rtems.org.Chris Johns1-1/+1
2014-03-14score: Add per-CPU profilingSebastian Huber1-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.
2014-03-11score: Add local context to SMP lock APISebastian Huber1-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.
2014-03-06score: Delete _Thread_Dispatch_set_disable_level()Sebastian Huber1-20/+0
This function was only used in some tests and can be replaced with other functions.
2014-03-06score: Add and use _Giant_Drop()Sebastian Huber1-0/+12
New test smptests/smpfatal03.
2013-08-30smp: Add and use _Assert_Owner_of_giant()Sebastian Huber1-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.
2013-08-09score: Per-CPU thread dispatch disable levelSebastian Huber1-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).
2013-07-17smp: Add and use _CPU_SMP_Get_current_processor()Sebastian Huber1-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.
2013-06-14score: Add and use _Thread_Dispatch_is_enabled()Sebastian Huber1-32/+13
Delete _Thread_Dispatch_in_critical_section() and _Thread_Is_dispatching_enabled().
2013-06-12score: Add missing includeSebastian Huber1-0/+1
2013-06-07score: Move thread dispatch content to new fileSebastian Huber1-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.