summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* score: Add function to send a SMP message to a set of CPUsDaniel Cederman2014-08-221-0/+15
|
* rbtree: Simplify insert and extractSebastian Huber2014-08-072-56/+41
| | | | | | | Simplify _RBTree_Insert() and _RBTree_Extract(). Remove more superfluous NULL pointer checks. Change _RBTree_Is_root() to use only the node. Add parent parameter to _RBTree_Sibling(). Delete _RBTree_Grandparent() and _RBTree_Parent_sibling().
* rbtree: Simplify _RBTree_Rotate()Sebastian Huber2014-08-071-17/+61
| | | | Add and use _RBTree_Direction().
* rbtree: Add and use RBTree_Compare_resultSebastian Huber2014-08-054-6/+17
|
* Add and use RTEMS_CONTAINER_OF()Sebastian Huber2014-08-056-27/+21
|
* rbtree: Rename find header in find controlSebastian Huber2014-07-291-10/+19
| | | | Simplify _RBTree_Find_control(). Avoid superfluous NULL pointer checks.
* rbtree: Simplify off-tree handlingSebastian Huber2014-07-291-17/+20
| | | | | | | Only use the parent pointer, since this pointer is never NULL for nodes which are part of a tree. Rename functions from *_off_rbtree() to *_off_tree().
* Delete unused *_Is_null() functionsSebastian Huber2014-07-263-42/+0
|
* rbtree: Update maximum node in LIFO orderSebastian Huber2014-07-261-7/+9
| | | | | | The test sptests/sp35 showed a NULL pointer access due to an invalid maximum node field (e.g. a tree with one element and NULL as the maximum node).
* todimpl.h: Add missing DoxygenJoel Sherrill2014-07-231-0/+10
|
* Add _TOD_Adjust to SCORE TOD Handler.Joel Sherrill2014-07-231-0/+12
| | | | | | | | 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.
* rbtree: Do not set node off-tree in extractSebastian Huber2014-07-221-2/+9
|
* rbtree: Remove superfluous NULL pointer checksSebastian Huber2014-07-221-17/+23
|
* Use Shared Method for Thread Unblock CleanupJoel Sherrill2014-07-151-0/+18
| | | | | | | | | | | When a thread is removed from a thread queue or is unblocked by receiving an event, the same actions are required. + timeout watchdog canceled, + thread must be unblocked, and + (MP only) proxy cleaned up This patch makes sure there is only one copy of this code.
* Thread Queue: Merge discipline subroutines into main methodsJoel Sherrill2014-07-152-136/+27
| | | | | | | | | | | 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.
* Thread Queue Priority Discipline Reimplemented with RBTreeJoel Sherrill2014-07-153-60/+38
|
* rbtree: Reduce RBTree_Control sizeSebastian Huber2014-07-152-61/+62
| | | | | | | | | | | | Remove compare function and is unique indicator from the control structure. Rename RBTree_Compare_function to RBTree_Compare. Rename rtems_rbtree_compare_function to rtems_rbtree_compare. Provide C++ compatible initializers. Add compare function and is unique indicator to _RBTree_Find(), _RBTree_Insert(), rtems_rbtree_find() and rtems_rbtree_insert(). Remove _RBTree_Is_unique() and rtems_rbtree_is_unique(). Remove compare function and is unique indicator from _RBTree_Initialize_empty() and rtems_rbtree_initialize_empty().
* rbtree: Delete unused functionsSebastian Huber2014-07-151-50/+0
|
* score: Fix scheduler helping implementationSebastian Huber2014-07-103-62/+23
| | | | | Do not extract the idle threads from the ready set so that there is always a thread available for comparison.
* score: Fix assertionsSebastian Huber2014-07-102-5/+4
|
* score: _Scheduler_Thread_get_own_node()Sebastian Huber2014-07-091-1/+5
| | | | Provide this function also for uni-processor configurations.
* score: Implement scheduler helping protocolSebastian Huber2014-07-0915-104/+1052
| | | | | | | | | | | | | | | | | | | | | | | | | 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: Need for help indicator for scheduler opsSebastian Huber2014-07-0810-50/+137
| | | | | | | | | | | | | Return a thread in need for help for the following scheduler operations - 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.
* score: Add _Scheduler_Help()Sebastian Huber2014-07-084-14/+159
| | | | Manage the help state of threads with respect to scheduling decisions.
* score: Rename *_Node_get() to *_Thread_get_node()Sebastian Huber2014-07-086-19/+19
| | | | | | This emphasizes that the scheduler node of a thread is returned and this is not a function working with scheduler nodes like the other *_Node_*() functions.
* score: Simplify SMP processor allocationSebastian Huber2014-07-081-15/+46
| | | | Avoid copy and paste and set the scheduler node state in one place.
* score: Rename _Scheduler_SMP_Update_heir()Sebastian Huber2014-07-082-32/+34
| | | | | | Rename and move _Scheduler_SMP_Update_heir() to _Thread_Dispatch_update_heir() since this function is not scheduler specific.
* score: Fix warningSebastian Huber2014-07-071-1/+1
|
* score: Fix MrsP resource root changeSebastian Huber2014-07-041-1/+4
| | | | | Use the root of the owner for the new root, since the owner may depend on a resource as well.
* score: Add PER_CPU_OFFSET_EXECUTINGSebastian Huber2014-07-011-17/+21
| | | | | Add PER_CPU_OFFSET_HEIR. Move Per_CPU_Control::executing and Per_CPU_Control::heir for easy offset calculation.
* score: Workaround for GCC 4.9 for atomic opsSebastian Huber2014-06-302-784/+346
| | | | | | | | | The GCC 4.9 ships its own <stdatomic.h> which is not C++ compatible. The suggested solution was to include <atomic> in case C++ is used. This works at least with GCC 4.9. See also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60932 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60940
* score: Decouple thread and scheduler nodes on SMPSebastian Huber2014-06-236-132/+223
| | | | | | | Add a chain node to the scheduler node to decouple the thread and scheduler nodes. It is now possible to enqueue a thread in a thread wait queue and use its scheduler node at the same for other threads, e.g. a resouce owner.
* score: Use chain nodes for ready queue supportSebastian Huber2014-06-232-30/+31
| | | | | This reduces the API to the minimum data structures to maximize the re-usability.
* score: Collect scheduler related fields in TCBSebastian Huber2014-06-234-31/+42
| | | | | Add Thread_Scheduler_control to collect scheduler related fields of the TCB.
* score: Remove scheduler parameter from most opsSebastian Huber2014-06-231-47/+46
| | | | | | | | | | | | | Remove the scheduler parameter from most high level scheduler operations like - _Scheduler_Block(), - _Scheduler_Unblock(), - _Scheduler_Change_priority(), - _Scheduler_Update_priority(), - _Scheduler_Release_job(), and - _Scheduler_Yield(). This simplifies the scheduler operations usage.
* score: Use default get/set affinity operationSebastian Huber2014-06-207-16/+15
| | | | Add and use SCHEDULER_OPERATION_DEFAULT_GET_SET_AFFINITY.
* score: Delete _Thread_Set_transient()Sebastian Huber2014-06-131-16/+0
|
* score: _Scheduler_priority_Get_scheduler_info()Sebastian Huber2014-06-131-6/+0
| | | | Delete _Scheduler_priority_Get_scheduler_info().
* score: PR2181: Add _Thread_Yield()Sebastian Huber2014-06-122-0/+23
| | | | | | | | | | | | | | | | | | | 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.
* score: Make functions inlineSebastian Huber2014-06-121-23/+114
| | | | | | These functions are used only via the function pointers in the generic SMP scheduler implementation. Provide them as static inline so that the compiler can optimize more easily.
* score: Move NULL pointer check to order functionSebastian Huber2014-06-121-15/+4
| | | | This helps to avoid untestable code for the normal SMP schedulers.
* score: FormatSebastian Huber2014-06-121-43/+43
|
* score: Add missing inlineSebastian Huber2014-06-121-2/+2
|
* Add SMP Priority Scheduler with AffinityJoel Sherrill2014-06-113-45/+220
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Fix MrsP root node updateSebastian Huber2014-06-101-1/+1
| | | | Set the new root after the resource tree update.
* score: _Per_CPU_State_wait_for_non_initial_state()Sebastian Huber2014-06-051-24/+15
| | | | | Replace _Per_CPU_State_wait_for_ready_to_start_multitasking() with _Per_CPU_State_wait_for_non_initial_state(). Implement this function.
* score: Avoid NULL pointer accessSebastian Huber2014-06-051-2/+3
| | | | | | Check that the executing thread is not NULL in _Scheduler_Tick(). It may be NULL in case the processor has an optional scheduler assigned and the system was not able to start the processor.
* score: Delete SMP_FATAL_SHUTDOWN_EARLYSebastian Huber2014-06-051-4/+3
| | | | Sort enum lexicographically.
* score: Rename _Scheduler_Update()Sebastian Huber2014-06-049-29/+44
| | | | | | Rename _Scheduler_Update() to _Scheduler_Update_priority(). Add parameter for the new thread priority to avoid direct usage of Thread_Control::current_priority in the scheduler operation.
* score: Replace _Scheduler_Allocate/Free()Sebastian Huber2014-06-049-50/+48
| | | | | | | | 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().