summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* score: _Scheduler_Thread_get_own_node()Sebastian Huber2014-07-091-1/+5
| | | | Provide this function also for uni-processor configurations.
* smptests/smpmrsp01: Add and update test casesSebastian Huber2014-07-092-185/+720
|
* score: Implement scheduler helping protocolSebastian Huber2014-07-0928-127/+1399
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* schedulerpriorityaffinitysmp.c: Add period at end of sentenceJoel Sherrill2014-07-081-1/+1
|
* score: Need for help indicator for scheduler opsSebastian Huber2014-07-0824-142/+645
| | | | | | | | | | | | | 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-0825-45/+45
| | | | | | 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-084-36/+62
| | | | Avoid copy and paste and set the scheduler node state in one place.
* score: Rename _Scheduler_SMP_Update_heir()Sebastian Huber2014-07-083-33/+35
| | | | | | 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: PR2183: Fix context switch on SMPSebastian Huber2014-07-048-86/+230
| | | | | | | | Fix context switch on SMP for ARM, PowerPC and SPARC. Atomically test and set the is executing indicator of the heir context to ensure that at most one processor uses the heir context. Break the busy wait loop also due to heir updates.
* arm: Use local label in _CPU_Context_restore()Sebastian Huber2014-07-011-2/+2
|
* score: Add PER_CPU_OFFSET_EXECUTINGSebastian Huber2014-07-012-17/+31
| | | | | Add PER_CPU_OFFSET_HEIR. Move Per_CPU_Control::executing and Per_CPU_Control::heir for easy offset calculation.
* bsp/altera-cyclone-v: Move MMU configuration tableSebastian Huber2014-07-013-20/+37
| | | | This makes it possible to use application specific version.
* bsps/arm: Rename bsp_mm_config_tableSebastian Huber2014-07-013-11/+9
| | | | | | Rename bsp_mm_config_table to arm_cp15_start_mmu_config_table and rename bsp_mm_config_table_size to arm_cp15_start_mmu_config_table_size to be in line with the other names in <bsp/arm-cp15-start.h>.
* sptests/spcontext01: Avoid NULL pointer accessSebastian Huber2014-07-011-1/+15
|
* bsps/sparc: Reduce copy and pasteSebastian Huber2014-07-015-58/+28
|
* LEON3: devfs free nodes must be sizedDaniel Hellstrom2014-06-301-0/+3
| | | | | | | | | .. according to the maximum number of termios ports which is 8. Since LEON3 uses PnP to find how many UARTs there are present we must make sure worst case work. The current maximum of 4 free nodes caused for example the GR712RC with its 6 UARTs to fail during devfs02 test.
* LEON3: fix console close handlingDaniel Hellstrom2014-06-301-3/+3
| | | | | | On SMP rtems_interrupt_lock_context must be used. Most tests fail with a NULL pointer exception when exiting, except on NGMP where main memory is at 0x00000000.
* smptests/smpfatal08: Support RTEMS_PARAVIRTSebastian Huber2014-06-301-1/+2
|
* termios: Make tty list staticSebastian Huber2014-06-302-4/+3
|
* rtems: Delete unused <rtems/rtems/atomic.h>Sebastian Huber2014-06-303-43/+0
|
* 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
* smptests/smpmigration02: PR2183: Add test caseSebastian Huber2014-06-241-11/+138
|
* score: Fix _Thread_Start_multitasking() on SMPSebastian Huber2014-06-241-0/+13
| | | | | | | | | | The _CPU_Context_Restart_self() implementations usually assume that self context is executing. FIXME: We have a race condition in _Thread_Start_multitasking() in case another thread already performed scheduler operations and moved the heir thread to another processor. The time frame for this is likely too small to be practically relevant.
* score: Fix thread deletion on SMPSebastian Huber2014-06-233-18/+198
| | | | | | Close the thread object in _Thread_Make_zombie() so that all blocking operations that use _Thread_Get() in the corresponding release directive can find a terminating thread and can complete the operation.
* score: Decouple thread and scheduler nodes on SMPSebastian Huber2014-06-2310-279/+394
| | | | | | | 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-235-35/+36
| | | | | This reduces the API to the minimum data structures to maximize the re-usability.
* score: Collect scheduler related fields in TCBSebastian Huber2014-06-237-37/+48
| | | | | Add Thread_Scheduler_control to collect scheduler related fields of the TCB.
* score: Remove scheduler parameter from most opsSebastian Huber2014-06-2311-84/+60
| | | | | | | | | | | | | 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: Fix statement with no effectSebastian Huber2014-06-201-1/+1
|
* score: Fix _Thread_Delay_ended() on SMPSebastian Huber2014-06-205-33/+25
| | | | | | | | | | | | | | | | Suppose we have two tasks A and B and two processors. Task A is about to delete task B. Now task B calls rtems_task_wake_after(1) on the other processor. Task B will block on the Giant lock. Task A progresses with the task B deletion until it has to wait for termination. Now task B obtains the Giant lock, sets its state to STATES_DELAYING, initializes its watchdog timer and waits. Eventually _Thread_Delay_ended() is called, but now _Thread_Get() returned NULL since the thread is already marked as deleted. Thus task B remained forever in the STATES_DELAYING state. Instead of passing the thread identifier use the thread control block directly via the watchdog user argument. This makes _Thread_Delay_ended() also a bit more efficient.
* smptests/smpwakeafter01: New testSebastian Huber2014-06-186-0/+230
|
* smptests: Avoid use of uninitialized dataSebastian Huber2014-06-132-0/+4
|
* JFFS2: Add device identifier for the flash deviceSebastian Huber2014-06-132-3/+15
| | | | | It is used in combination with the inode number to uniquely identify a file system node in the system.
* 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-1213-57/+98
| | | | | | | | | | | | | | | | | | | 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.
* bsp/realview-pbx-a9: Fix SMP startupSebastian Huber2014-06-121-0/+14
|
* smptests/smpscheduler03: Test all SMP schedulersSebastian Huber2014-06-122-4/+135
|
* score: Make functions inlineSebastian Huber2014-06-122-155/+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-122-17/+30
| | | | This helps to avoid untestable code for the normal SMP schedulers.
* score: Fix warningsSebastian Huber2014-06-121-2/+1
|
* score: FormatSebastian Huber2014-06-121-43/+43
|
* score: Add missing inlineSebastian Huber2014-06-121-2/+2
|
* score: Fix scheduler context initializerSebastian Huber2014-06-121-3/+3
|
* Add SMP Priority Scheduler with AffinityJoel Sherrill2014-06-118-77/+745
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* samples/pppd: Fix extra drivers initializerSebastian Huber2014-06-111-1/+1
|