summaryrefslogtreecommitdiffstats
path: root/cpukit/score/Makefile.am (follow)
Commit message (Collapse)AuthorAgeFilesLines
* score: Add ISR lock to Objects_ControlSebastian Huber2015-03-051-0/+1
| | | | | | | | | This enables per-object SMP locks on SMP configurations and is the first step to support fine-grained locking. On uni-processor configuration there will be no overhead. The _Objects_Acquire() is intended to replace _Objects_Get_isr_disable(). Update #2273.
* score: Enable SMP barriers for all configurationsSebastian Huber2015-03-021-1/+1
|
* score: Make <rtems/score/atomic.h> availableSebastian Huber2015-02-191-2/+2
| | | | | | | | Make <rtems/score/atomic.h> available for all RTEMS configurations. Use inline functions instead of macros. Use ISR disable/enable on uni-processor configurations to ensure atomicity. Update #2273.
* score: Rework global constructionSebastian Huber2014-10-131-0/+1
| | | | | | Ensure that the global construction is performed in the context of the first initialization thread. On SMP this was not guaranteed in the previous implementation.
* Add _TOD_Adjust to SCORE TOD Handler.Joel Sherrill2014-07-231-2/+2
| | | | | | | | This lays the proper structure for doing future work on time adjustment algorithms. Any TOD adjustments should be requested at the API level and performed at the SCORE level. Additionally updated a test.
* Thread Queue: Merge discipline subroutines into main methodsJoel Sherrill2014-07-151-7/+3
| | | | | | | | | | | There was a lot of duplication between the discipline subroutines. With the transition to RBTrees for priority discipline, there were only a few lines of source code manipulating the data structure for FIFO and priority. Thus is made sense to fold these back into the main methods. As part of doing this all of the tests for discipline were changed to be in the same order.
* score: Implement scheduler helping protocolSebastian Huber2014-07-091-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | The following scheduler operations return a thread in need for help - unblock, - change priority, and - yield. A thread in need for help is a thread that encounters a scheduler state change from scheduled to ready or a thread that cannot be scheduled in an unblock operation. Such a thread can ask threads which depend on resources owned by this thread for help. Add a new ask for help scheduler operation. This operation is used by _Scheduler_Ask_for_help() to help threads in need for help returned by the operations mentioned above. This operation is also used by _Scheduler_Thread_change_resource_root() in case the root of a resource sub-tree changes. A use case is the ownership change of a resource. In case it is not possible to schedule a thread in need for help, then the corresponding scheduler node will be placed into the set of ready scheduler nodes of the scheduler instance. Once a state change from ready to scheduled happens for this scheduler node it may be used to schedule the thread in need for help.
* score: PR2181: Add _Thread_Yield()Sebastian Huber2014-06-121-0/+1
| | | | | | | | | | | | | | | | | | | The _Scheduler_Yield() was called by the executing thread with thread dispatching disabled and interrupts enabled. The rtems_task_suspend() is explicitly allowed in ISRs: http://rtems.org/onlinedocs/doc-current/share/rtems/html/c_user/Interrupt-Manager-Directives-Allowed-from-an-ISR.html#Interrupt-Manager-Directives-Allowed-from-an-ISR Unlike the other scheduler operations the locking was performed inside the operation. This lead to the following race condition. Suppose a ISR suspends the executing thread right before the yield scheduler operation. Now the executing thread is not longer in the set of ready threads. The typical scheduler operations did not check the thread state and will now extract the thread again and enqueue it. This corrupted data structures. Add _Thread_Yield() and do the scheduler yield operation with interrupts disabled. This has a negligible effect on the interrupt latency.
* Add SMP Priority Scheduler with AffinityJoel Sherrill2014-06-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This scheduler attempts to account for needed thread migrations caused as a side-effect of a thread state, affinity, or priority change operation. This scheduler has its own allocate_processor handler named _Scheduler_SMP_Allocate_processor_exact() because _Scheduler_SMP_Allocate_processor() attempts to prevent an executing thread from moving off its current CPU without considering affinity. Without this, the scheduler makes all the right decisions and then they are discarded at the end. ==Side Effects of Adding This Scheduler== Added Thread_Control * parameter to Scheduler_SMP_Get_highest_ready type so methods looking for the highest ready thread can filter by the processor on which the thread blocking resides. This allows affinity to be considered. Simple Priority SMP and Priority SMP ignore this parameter. + Added get_lowest_scheduled argument to _Scheduler_SMP_Enqueue_ordered(). + Added allocate_processor argument to the following methods: - _Scheduler_SMP_Block() - _Scheduler_SMP_Enqueue_scheduled_ordered() - _Scheduler_SMP_Enqueue_scheduled_ordered() + schedulerprioritysmpimpl.h is a new file with prototypes for methods which were formerly static in schedulerprioritysmp.c but now need to be public to be shared with this scheduler. NOTE: _Scheduler_SMP_Get_lowest_ready() appears to have a path which would allow it to return a NULL. Previously, _Scheduler_SMP_Enqueue_ordered() would have asserted on it. If it cannot return a NULL, _Scheduler_SMP_Get_lowest_ready() should have an assertions.
* score: _Per_CPU_State_wait_for_non_initial_state()Sebastian Huber2014-06-051-0/+1
| | | | | Replace _Per_CPU_State_wait_for_ready_to_start_multitasking() with _Per_CPU_State_wait_for_non_initial_state(). Implement this function.
* score: Replace _Scheduler_Allocate/Free()Sebastian Huber2014-06-041-3/+4
| | | | | | | | Replace _Scheduler_Allocate() with _Scheduler_Node_initialize(). Remove the return status and thus the node initialization must be always successful. Rename _Scheduler_Free() to _Scheduler_Node_destroy().
* score: Add Resource HandlerSebastian Huber2014-06-031-0/+3
| | | | | | | | | | A resource is something that has at most one owner at a time and may have multiple rivals in case an owner is present. The owner and rivals are impersonated via resource nodes. A resource is represented via the resource control structure. The resource controls and nodes are organized as trees. It is possible to detect deadlocks via such a resource tree. The _Resource_Iterate() function can be used to iterate through such a resource tree starting at a top node.
* score: Multiprocessor Resource Sharing ProtocolSebastian Huber2014-05-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | Add basic support for the Multiprocessor Resource Sharing Protocol (MrsP). The Multiprocessor Resource Sharing Protocol (MrsP) is defined in A. Burns and A.J. Wellings, A Schedulability Compatible Multiprocessor Resource Sharing Protocol - MrsP, Proceedings of the 25th Euromicro Conference on Real-Time Systems (ECRTS 2013), July 2013. It is a generalization of the Priority Ceiling Protocol to SMP systems. Each MrsP semaphore uses a ceiling priority per scheduler instance. These ceiling priorities can be specified with rtems_semaphore_set_priority(). A task obtaining or owning a MrsP semaphore will execute with the ceiling priority for its scheduler instance as specified by the MrsP semaphore object. Tasks waiting to get ownership of a MrsP semaphore will not relinquish the processor voluntarily. In case the owner of a MrsP semaphore gets preempted it can ask all tasks waiting for this semaphore to help out and temporarily borrow the right to execute on one of their assigned processors. The help out feature is not implemented with this patch.
* score: Make _Thread_queue_Requeue() staticSebastian Huber2014-05-151-1/+1
| | | | | | This function is only used by _Thread_Change_priority(). Make it static to avoid the function call overhead in the performance critical function _Thread_Change_priority().
* score: Add and use _Scheduler_SMP_Start_idle()Sebastian Huber2014-05-151-0/+1
|
* score: Add and use _Scheduler_default_Schedule()Sebastian Huber2014-05-151-0/+1
|
* score: Simplify _Thread_Change_priority()Sebastian Huber2014-05-151-12/+4
| | | | | | | | | | | | | | | | | | | | | | | | The function to change a thread priority was too complex. Simplify it with a new scheduler operation. This increases the average case performance due to the simplified logic. The interrupt disabled critical section is a bit prolonged since now the extract, update and enqueue steps are executed atomically. This should however not impact the worst-case interrupt latency since at least for the Deterministic Priority Scheduler this sequence can be carried out with a wee bit of instructions and no loops. Add _Scheduler_Change_priority() to replace the sequence of - _Thread_Set_transient(), - _Scheduler_Extract(), - _Scheduler_Enqueue(), and - _Scheduler_Enqueue_first(). Delete STATES_TRANSIENT, _States_Is_transient() and _Thread_Set_transient() since this state is now superfluous. With this change it is possible to get rid of the SCHEDULER_SMP_NODE_IN_THE_AIR state. This considerably simplifies the implementation of the new SMP locking protocols.
* score: Introduce scheduler nodesSebastian Huber2014-05-141-0/+2
| | | | | | | | | | | | Rename scheduler per-thread information into scheduler nodes using Scheduler_Node as the base type. Use inheritance for specialized schedulers. Move the scheduler specific states from the thread control block into the scheduler node structure. Validate the SMP scheduler node state transitions in case RTEMS_DEBUG is defined.
* score: Task get/set affinitySebastian Huber2014-04-151-0/+2
| | | | | Make rtems_task_get_affinity() and rtems_task_set_affinity() available on non-SMP configurations. Allow larger CPU sets.
* score: Simplify thread control initializationSebastian Huber2014-04-151-3/+0
| | | | | | | | | | | The thread control block contains fields that point to application configuration dependent memory areas, like the scheduler information, the API control blocks, the user extension context table, the RTEMS notepads and the Newlib re-entrancy support. Account for these areas in the configuration and avoid extra workspace allocations for these areas. This helps also to avoid heap fragementation and reduces the per thread memory due to a reduced heap allocation overhead.
* score: Add priority affinity smp scheduler.Jennifer Averett2014-04-031-0/+2
|
* score: score: Add get/set affinity to Scheduler Framework.Jennifer Averett2014-04-031-0/+2
|
* score: Move priority bit map to scheduler instanceSebastian Huber2014-04-031-2/+0
| | | | | | Delete global variables _Priority_Major_bit_map and _Priority_Bit_map. This makes it possible to use multiple priority scheduler instances for example with clustered/partitioned scheduling on SMP.
* score: Move __log2table to separate fileSebastian Huber2014-04-011-0/+1
|
* score: Thread life cycle re-implementationSebastian Huber2014-03-311-1/+1
| | | | | | | | | | | | | | | | | | | The thread deletion is now supported on SMP. This change fixes the following PRs: PR1814: SMP race condition between stack free and dispatch PR2035: psxcancel reveals NULL pointer access in _Thread_queue_Extract() The POSIX cleanup handler are now called in the right context (should be called in the context of the terminating thread). http://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_09.html Add a user extension the reflects a thread termination event. This is used to reclaim the Newlib reentrancy structure (may use file operations), the POSIX cleanup handlers and the POSIX key destructors.
* score: Move _Thread_Reset() and make staticSebastian Huber2014-03-311-1/+1
|
* score: Delete _Watchdog_Report()Sebastian Huber2014-03-251-1/+1
| | | | | | | Delete _Watchdog_Report_chain(). These two functions use printk() with thread dispatching and interrupts disabled. So they are pretty useless in real applications. They are not part of the application APIs. They are only used in one test and do nothing useful in this test.
* score: Unify pthread and gxx_wrapper once and move to score.Christian Mauderer2014-03-211-0/+2
|
* score: Add _Debug_Is_owner_of_allocator()Sebastian Huber2014-03-191-0/+1
|
* score: Delete _Assert_Thread_dispatching_repressedSebastian Huber2014-03-191-1/+1
| | | | | | | | Add _Debug_Is_thread_dispatching_allowed(). This makes it possible to assert the opposite. Use _ISR_Disable_without_giant()/_ISR_Enable_without_giant() to avoid misleading secondary assertion failures.
* score: Add SMP lock profiling supportSebastian Huber2014-03-141-0/+1
|
* score: Add per-CPU profilingSebastian Huber2014-03-141-0/+2
| | | | | | | 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 cpuset support to Score.Jennifer Averett2014-03-071-0/+4
| | | | | | This new Score Handler provides a structure to manage a cpu_set_t plus helper routines to validate the contents against the current system configuration.
* score: Rename rtems_smp_process_interrupt()Sebastian Huber2014-02-191-1/+0
| | | | | | Rename rtems_smp_process_interrupt() into _SMP_Inter_processor_interrupt_handler(). Delete unused header file <rtems/bspsmp.h>.
* score: Add and use <rtems/score/smpimpl.h>Sebastian Huber2014-02-191-0/+1
| | | | | Collect SMP implementation specific parts in the <rtems/score/smpimpl.h> header file.
* score: Add SMP barrierSebastian Huber2014-02-171-0/+2
|
* Require presence of <stdatomic.h> for SMP supportSebastian Huber2014-02-171-4/+2
|
* Add thread-local storage (TLS) supportSebastian Huber2014-02-041-0/+1
| | | | | Tested and implemented on ARM, m68k, PowerPC and SPARC. Other architectures need more work.
* cpukit/rtems: Add rtems_clock_get_uptime_nanoseconds to the RTEMS API.Chris Johns2013-12-241-3/+3
| | | | | | Add Timestamp support in the score to return a timestamp in nanoseconds. Add a test. Update the RTEMS API documentation.
* score/rbtree: Delete protected operationsSebastian Huber2013-11-211-2/+2
| | | | | The user of the red-black tree container must now ensure that at most one thread at once can access an instance.
* smp: Add Deterministic Priority SMP SchedulerSebastian Huber2013-08-201-0/+2
|
* smp: Rename _Scheduler_simple_smp_Start_idle()Sebastian Huber2013-08-201-0/+1
| | | | | Rename _Scheduler_simple_smp_Start_idle() to _Scheduler_SMP_Start_idle().
* smp: Replace Scheduler_simple_smp_ControlSebastian Huber2013-08-201-0/+2
| | | | | Replace Scheduler_simple_smp_Control with Scheduler_SMP_Control. Rename _Scheduler_simple_smp_Instance() to _Scheduler_SMP_Instance().
* score: _Priority_bit_map_Handler_initialization()Sebastian Huber2013-08-201-0/+1
| | | | | | | Delete _Priority_bit_map_Handler_initialization() and rely on BSS initialization. Move definition of _Priority_Major_bit_map and _Priority_Bit_map to separate file. Move definition of __log2table also to this file.
* score: PR2136: Fix _Thread_Change_priority()Sebastian Huber2013-08-201-0/+1
| | | | | | | | | | | | | | | Add call to _Scheduler_Schedule() in missing path after _Thread_Set_transient() in _Thread_Change_priority(). See also sptests/spintrcritical19. Add thread parameter to _Scheduler_Schedule(). This parameter is currently unused but may be used in future SMP schedulers. Do heir selection in _Scheduler_Schedule(). Use _Scheduler_Update_heir() for this in the particular scheduler implementation. Add and use _Scheduler_Generic_block().
* score: Per-CPU thread dispatch disable levelSebastian Huber2013-08-091-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
* score: Rename _Scheduler_simple_Update()Sebastian Huber2013-08-081-1/+2
| | | | Rename _Scheduler_simple_Update() in _Scheduler_default_Update().
* score: Rename _Scheduler_simple_Allocate(), etc.Sebastian Huber2013-08-081-0/+1
| | | | | Rename _Scheduler_simple_Allocate() in _Scheduler_default_Allocate(). Rename _Scheduler_simple_Free() in _Scheduler_default_Free().
* score: Rename _Scheduler_priority_Release_job()Sebastian Huber2013-08-081-1/+1
| | | | | Rename _Scheduler_priority_Release_job() into _Scheduler_default_Release_job().
* PR766: Delete __RTEMS_INSIDE__Sebastian Huber2013-08-081-2/+0
|