summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/statesimpl.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Remove make preinstallChris Johns2018-01-251-283/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A speciality of the RTEMS build system was the make preinstall step. It copied header files from arbitrary locations into the build tree. The header files were included via the -Bsome/build/tree/path GCC command line option. This has at least seven problems: * The make preinstall step itself needs time and disk space. * Errors in header files show up in the build tree copy. This makes it hard for editors to open the right file to fix the error. * There is no clear relationship between source and build tree header files. This makes an audit of the build process difficult. * The visibility of all header files in the build tree makes it difficult to enforce API barriers. For example it is discouraged to use BSP-specifics in the cpukit. * An introduction of a new build system is difficult. * Include paths specified by the -B option are system headers. This may suppress warnings. * The parallel build had sporadic failures on some hosts. This patch removes the make preinstall step. All installed header files are moved to dedicated include directories in the source tree. Let @RTEMS_CPU@ be the target architecture, e.g. arm, powerpc, sparc, etc. Let @RTEMS_BSP_FAMILIY@ be a BSP family base directory, e.g. erc32, imx, qoriq, etc. The new cpukit include directories are: * cpukit/include * cpukit/score/cpu/@RTEMS_CPU@/include * cpukit/libnetworking The new BSP include directories are: * bsps/include * bsps/@RTEMS_CPU@/include * bsps/@RTEMS_CPU@/@RTEMS_BSP_FAMILIY@/include There are build tree include directories for generated files. The include directory order favours the most general header file, e.g. it is not possible to override general header files via the include path order. The "bootstrap -p" option was removed. The new "bootstrap -H" option should be used to regenerate the "headers.am" files. Update #3254.
* score: Add _Thread_queue_Object_nameSebastian Huber2017-01-311-29/+19
| | | | | | | | | | | | | Add the special thread queue name _Thread_queue_Object_name to mark thread queues embedded in an object with identifier. Using the special thread state STATES_THREAD_QUEUE_WITH_IDENTIFIER is not reliable for this purpose since the thread wait information and thread state are protected by different SMP locks in separate critical sections. Remove STATES_THREAD_QUEUE_WITH_IDENTIFIER. Add and use _Thread_queue_Object_initialize(). Update #2858.
* score: Remove unused _States_Is_*()Sebastian Huber2017-01-121-153/+0
|
* score: Replace STATES_DELAYINGSebastian Huber2017-01-121-37/+6
| | | | | | | | Replace STATES_DELAYING with STATES_WAITING_FOR_TIME. There is no need for separate timeout thread states. The Thread_Control::Timer::header and Watchdog_Control::cpu members can be used to figure out the kind of timeout.
* score: Optimize thread state valuesSebastian Huber2017-01-111-48/+73
|
* score: Add STATES_THREAD_QUEUE_WITH_IDENTIFIERSebastian Huber2017-01-111-13/+14
| | | | | Add thread state bit to identify thread queues that are embedded in an object with identifier.
* score: Delete STATES_WAITING_FOR_BUFFERSebastian Huber2017-01-111-19/+1
|
* score: Format thread state definesSebastian Huber2017-01-111-27/+27
| | | | Specify all 32-bits in a thread state define.
* score: Add a STATES_DEBUGGER for use by debugging agents to a thread's state.Chris Johns2016-07-261-0/+2
|
* score: Avoid Giant lock for _Thread_Start()Sebastian Huber2016-05-201-1/+1
| | | | Update #2555.
* posix: Rework pthread_join()Sebastian Huber2016-05-201-0/+7
| | | | | | | | | Rework pthread_join() to use _Thread_Join(). Close #2402. Update #2555. Update #2626. Close #2714.
* score: Rework _Thread_Restart_other()Sebastian Huber2016-05-201-2/+2
| | | | | | | | | Rework _Thread_Restart_other() to use _Thread_Change_life_locked(). Cope with concurrent change requests by means of a pending request counter. Update #2555. Update #2626.
* score: Add _Thread_Join() and _Thread_Cancel()Sebastian Huber2016-05-201-2/+0
| | | | | | | | Split _Thread_Close() into _Thread_Join() and _Thread_Cancel() to prepare for a re-use in pthread_join() and pthread_cancel(). Update #2555. Update #2626.
* score: Avoid Giant lock _Scheduler_Set_affinity()Sebastian Huber2016-05-121-2/+0
| | | | Update #2555.
* score: Add self-contained condition implementationSebastian Huber2015-07-301-0/+3
|
* score: Add self-contained futex implementationSebastian Huber2015-07-301-0/+3
|
* score: Add self-contained semaphore implementationSebastian Huber2015-07-301-0/+3
|
* score: Add self-contained mutex implementationSebastian Huber2015-07-301-0/+3
| | | | | | | This mutex implementation uses a thread priority queue with a simple priority inheritance mechanism (similar to the object based mutexes). The storage space must be supplied by the user (16 bytes on 32-bit targets).
* score: Delete STATES_WAITING_ON_THREAD_QUEUESebastian Huber2015-05-191-24/+2
| | | | | | Avoid the usage of the current thread state in _Thread_queue_Extract_with_return_code() since thread queues should not know anything about thread states.
* score: Fix POSIX thread joinSebastian Huber2015-04-231-1/+3
| | | | | | | | | | | | A thread join is twofold. There is one thread that exists and an arbitrary number of threads that wait for the thread exit (one-to-many relation). The exiting thread may want to wait for a thread that wants to join its exit (STATES_WAITING_FOR_JOIN_AT_EXIT in _POSIX_Thread_Exit()). On the other side we need a thread queue for all the threads that wait for the exit of one particular thread (STATES_WAITING_FOR_JOIN in pthread_join()). Update #2035.
* score: Use _Thread_Clear_state() for _Thread_ReadySebastian Huber2015-04-081-0/+3
|
* score: Simplify _Thread_Change_priority()Sebastian Huber2014-05-151-17/+0
| | | | | | | | | | | | | | | | | | | | | | | | 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: Add STATES_RESTARTINGSebastian Huber2014-05-141-0/+2
| | | | Use separate state for thread restart.
* score: TypoSebastian Huber2014-05-141-1/+1
|
* score: Implement forced thread migrationSebastian Huber2014-05-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current implementation of task migration in RTEMS has some implications with respect to the interrupt latency. It is crucial to preserve the system invariant that a task can execute on at most one processor in the system at a time. This is accomplished with a boolean indicator in the task context. The processor architecture specific low-level task context switch code will mark that a task context is no longer executing and waits that the heir context stopped execution before it restores the heir context and resumes execution of the heir task. So there is one point in time in which a processor is without a task. This is essential to avoid cyclic dependencies in case multiple tasks migrate at once. Otherwise some supervising entity is necessary to prevent life-locks. Such a global supervisor would lead to scalability problems so this approach is not used. Currently the thread dispatch is performed with interrupts disabled. So in case the heir task is currently executing on another processor then this prolongs the time of disabled interrupts since one processor has to wait for another processor to make progress. It is difficult to avoid this issue with the interrupt latency since interrupts normally store the context of the interrupted task on its stack. In case a task is marked as not executing we must not use its task stack to store such an interrupt context. We cannot use the heir stack before it stopped execution on another processor. So if we enable interrupts during this transition we have to provide an alternative task independent stack for this time frame. This issue needs further investigation.
* score: Thread life cycle re-implementationSebastian Huber2014-03-311-0/+4
| | | | | | | | | | | | | | | | | | | 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: Delete unused STATES_ALL_SETSebastian Huber2014-03-241-2/+0
|
* Change all references of rtems.com to rtems.org.Chris Johns2014-03-211-1/+1
|
* score: New state STATES_WAITING_FOR_BSD_WAKEUPSebastian Huber2013-10-311-0/+3
| | | | This state is necessery to implement the SLEEP(9) FreeBSD kernel API.
* score: Create states implementation headerSebastian Huber2013-07-261-0/+477
Move implementation specific parts of states.h and states.inl into new header file statesimpl.h. The states.h contains now only the application visible API.