summaryrefslogtreecommitdiff
path: root/cpukit (follow)
AgeCommit message (Collapse)Author
2014-06-24score: Fix _Thread_Start_multitasking() on SMPSebastian Huber
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.
2014-06-23score: Fix thread deletion on SMPSebastian Huber
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.
2014-06-23score: Decouple thread and scheduler nodes on SMPSebastian Huber
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.
2014-06-23score: Use chain nodes for ready queue supportSebastian Huber
This reduces the API to the minimum data structures to maximize the re-usability.
2014-06-23score: Collect scheduler related fields in TCBSebastian Huber
Add Thread_Scheduler_control to collect scheduler related fields of the TCB.
2014-06-23score: Remove scheduler parameter from most opsSebastian Huber
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.
2014-06-20score: Use default get/set affinity operationSebastian Huber
Add and use SCHEDULER_OPERATION_DEFAULT_GET_SET_AFFINITY.
2014-06-20score: Fix statement with no effectSebastian Huber
2014-06-20score: Fix _Thread_Delay_ended() on SMPSebastian Huber
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.
2014-06-13JFFS2: Add device identifier for the flash deviceSebastian Huber
It is used in combination with the inode number to uniquely identify a file system node in the system.
2014-06-13score: Delete _Thread_Set_transient()Sebastian Huber
2014-06-13score: _Scheduler_priority_Get_scheduler_info()Sebastian Huber
Delete _Scheduler_priority_Get_scheduler_info().
2014-06-12score: PR2181: Add _Thread_Yield()Sebastian Huber
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.
2014-06-12score: Make functions inlineSebastian Huber
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.
2014-06-12score: Move NULL pointer check to order functionSebastian Huber
This helps to avoid untestable code for the normal SMP schedulers.
2014-06-12score: Fix warningsSebastian Huber
2014-06-12score: FormatSebastian Huber
2014-06-12score: Add missing inlineSebastian Huber
2014-06-12score: Fix scheduler context initializerSebastian Huber
2014-06-11Add SMP Priority Scheduler with AffinityJoel Sherrill
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.
2014-06-10score: Fix MrsP root node updateSebastian Huber
Set the new root after the resource tree update.
2014-06-05score: _Per_CPU_State_wait_for_non_initial_state()Sebastian Huber
Replace _Per_CPU_State_wait_for_ready_to_start_multitasking() with _Per_CPU_State_wait_for_non_initial_state(). Implement this function.
2014-06-05score: Avoid NULL pointer accessSebastian Huber
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.
2014-06-05score: Delete SMP_FATAL_SHUTDOWN_EARLYSebastian Huber
Sort enum lexicographically.
2014-06-05remove not updated NEWS fileDaniel Hellstrom
2014-06-04shell: Add rtems_shell_dup_current_env to get a default env.Chris Johns
Remove rtems_current_shell_env as this is dangerous because the env can be NULL if used outside of a valid shell with the POSIX key to an env set up. Clean up the usage of rtems_current_shell_env.
2014-06-04score: Rename _Scheduler_Update()Sebastian Huber
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.
2014-06-04score: Replace _Scheduler_Allocate/Free()Sebastian Huber
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().
2014-06-03score/sparc: Add support for paravirtualizationChristian Mauderer
Guest systems in paravirtualization environments run usually in user mode. Thus it is not possible to directly access the PSR and TBR registers. Use functions instead of inline assembler to access these registers if RTEMS_PARAVIRT is defined.
2014-06-03libblock: Avoid recursive mutexSebastian Huber
2014-06-03score: Use Resource Handler for MrsP semaphoresSebastian Huber
This enables proper resource dependency tracking and as a side-effect deadlock detection.
2014-06-03score: Add resource node to thread control blockSebastian Huber
2014-06-03score: Add and use _Thread_Owns_resources()Sebastian Huber
2014-06-03score: Add Resource HandlerSebastian Huber
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.
2014-06-02libblock: Add RTEMS_BDBUF_USE_PTHREADRalf Kirchner
Use the PTHREAD mutexes and condition variables if available. This helps on SMP configurations to avoid the home grown condition variables via disabled preemption.
2014-06-02rtems: Avoid copy and paste in confdefs.hRalf Kirchner
Add and use CONFIGURE_POSIX_MUTEXES. Add and use CONFIGURE_POSIX_CONDITION_VARIABLES.
2014-06-02arm: Add ARM_MULTILIB_HAS_BARRIER_INSTRUCTIONSSebastian Huber
2014-06-02libblock: Use pthread_once() for initializationRalf Kirchner
Enabling and disabling preemption as done for single core will not work for SMP. In the bdbuf initialization preemption handling can be avoided in general by using pthread_once().
2014-06-02score: _Scheduler_Set_affinity()Sebastian Huber
Do not change the scheduler with this function. Documentation. Coding style.
2014-06-02score: _Scheduler_Get_affinity()Sebastian Huber
Drop scheduler parameter. Coding style.
2014-06-02rtems: Coding styleSebastian Huber
2014-05-30cpusetimpl.h: Add _CPU_set_Set() and improve DoxygenJoel Sherrill
2014-05-30Minor conditionals to enable building Scheduler Simulator on GNU/LinuxJoel Sherrill
- rtems/score/assert.h: Scheduler Simulator uses glibc assert.h on GNU/Linux. This will likely need to be adjusted more for other host compilers and C libraries. Also disable _Assert_Not_reached() because some of these paths do actually return to the called on the Scheduler Simulator. - basedefs.h: Do not use noreturn attribute when on Scheduler Simulator. Paths which context switch can return to the command interpreter on the Scheduler Simulator.
2014-05-28rtems/score/thread*.h: Really correct spelling errorJoel Sherrill
2014-05-28rtems/score/thread*.h: TERMINTING to TERMINATINGJoel Sherrill
2014-05-28shell: Make rtems_global_shell_env publicSebastian Huber
Provide rtems_global_shell_env as a public read-only variable for backward compatibility.
2014-05-28score: Multiprocessor Resource Sharing ProtocolSebastian Huber
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.
2014-05-26score: Fix race condition in SMP startupSebastian Huber
Do not use the Per_CPU_Control::started in _SMP_Start_multitasking_on_secondary_processor() since this field may be not up to date when a secondary processor reads it. Use the read-only scheduler assignment instead. Add a new fatal error SMP_FATAL_MULTITASKING_START_ON_INVALID_PROCESSOR. This prevents out-of-bounds access. It is currently not possible to test these fatal errors. One option would be to fake values of the _CPU_SMP_Get_current_processor(), but unfortunately this function is inline on some architectures.
2014-05-23SPARC: add syscall 1 (exit) function entry pointDaniel Hellstrom
The exit SPARC system call doesn't have a function entry point like the others do. This is probably why people use TA 0x0 instruction directly for shutting down the system.
2014-05-23score: Use _SMP_Fatal()Sebastian Huber