summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
* posix: shared memory supportGedare Bloom2017-01-131-0/+1
| | | | | | | | | Add POSIX shared memory manager (Shm). Includes a hook-based approach for the backing memory storage that defaults to the Workspace, and a test is provided using the heap. A test is also provided for the basic use of mmap'ing a shared memory object. This test currently fails at the mmap stage due to no support for mmap.
* rtems: Use header file for rtems_object_get_name()Sebastian Huber2017-01-121-10/+1
|
* score: Replace STATES_DELAYINGSebastian Huber2017-01-121-1/+1
| | | | | | | | 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.
* Remove obsolete __RTEMS_HAVE_SYS_CPUSET_H__Joel Sherrill2017-01-113-10/+0
|
* score: Introduce _Internal_error()Sebastian Huber2016-12-121-8/+2
|
* Add INTERNAL_ERROR_RTEMS_INIT_TASK_CREATE_FAILEDSebastian Huber2016-12-121-2/+6
| | | | Update #2825.
* score: Remove fatal is internal indicatorSebastian Huber2016-12-091-2/+1
| | | | | | | | | The fatal is internal indicator is redundant since the fatal source and error code uniquely identify a fatal error. Keep the fatal user extension is internal parameter for backward compatibility and set it to false always. Update #2825.
* rtems: Use _Thread_Dispatch_direct()Sebastian Huber2016-12-022-2/+2
| | | | Update #2797.
* rtems: Fix rtems_scheduler_add_processor()Sebastian Huber2016-12-021-4/+1
| | | | | | Fix thread dispatch profiling of rtems_scheduler_add_processor(). Update #2797.
* score: Initialize thread queue context earlySebastian Huber2016-12-023-1/+3
| | | | | | | | Initialize thread queue context early preferably outside the critical section. Remove implicit _Thread_queue_Context_initialize() from _Thread_Wait_acquire().
* score: Optimize _Thread_queue_Enqueue()Sebastian Huber2016-11-241-1/+4
| | | | | | | | | Move thread state for _Thread_queue_Enqueue() to the thread queue context. This reduces the parameter count of _Thread_queue_Enqueue() from five to four (ARM for example has only four function parameter registers). Since the thread state is used after several function calls inside _Thread_queue_Enqueue() this parameter was saved on the stack previously.
* posix: Add self-contained pthread spinlockSebastian Huber2016-11-231-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Turn pthread_spinlock_t into a self-contained object. On uni-processor configurations, interrupts are disabled in the lock/trylock operations and the previous interrupt status is restored in the corresponding unlock operations. On SMP configurations, a ticket lock is a acquired and released in addition. The self-contained pthread_spinlock_t object is defined by Newlib in <sys/_pthreadtypes.h>. typedef struct { struct _Ticket_lock_Control _lock; __uint32_t _interrupt_state; } pthread_spinlock_t; This implementation is simple and efficient. However, this test case of the Linux Test Project would fail due to call of printf() and sleep() during spin lock ownership: https://github.com/linux-test-project/ltp/blob/master/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/1-2.c There is only limited support for profiling on SMP configurations. Delete CORE spinlock implementation. Update #2674.
* score: Rename _Thread_queue_Enqueue_critical()Sebastian Huber2016-11-231-1/+1
| | | | | Delete unused _Thread_queue_Enqueue() and rename _Thread_queue_Enqueue_critical() to _Thread_queue_Enqueue().
* score: Add thread queue enqueue calloutSebastian Huber2016-11-232-31/+41
| | | | | | | Replace the expected thread dispatch disable level with a thread queue enqueue callout. This enables the use of _Thread_Dispatch_direct() in the thread queue enqueue procedure. This avoids impossible exection paths, e.g. Per_CPU_Control::dispatch_necessary is always true.
* score: Add and use _Thread_Dispatch_direct()Sebastian Huber2016-11-181-1/+1
| | | | | | | | | | This function is useful for operations which synchronously block, e.g. self restart, self deletion, yield, sleep. It helps to detect if these operations are called in the wrong context. Since the thread dispatch necessary indicator is not used, this is more robust in some SMP situations. Update #2751.
* rtems: Add scheduler processor add/removeSebastian Huber2016-11-102-0/+263
| | | | Update #2797.
* score: Simplify _Scheduler_Get_by_id()Sebastian Huber2016-11-095-10/+10
| | | | | | | | | | Avoid dead code in non-SMP configurations. Return scheduler identifier independent of the current processor count of the scheduler via rtems_scheduler_ident(), since this value may change during run-time. Check the processor count in _Scheduler_Set() under scheduler lock protection. Update #2797.
* rtems: Fix rtems_task_create() scheduler selectionSebastian Huber2016-11-091-1/+1
| | | | | | | Use the home scheduler of the executing thread for the created thread. This is in line with pthread_create(). Using the current processor may pick up an unexpected scheduler in case of a temporary migration, e.g. due to locking protocols.
* score: Introduce thread resource count methodsSebastian Huber2016-11-031-1/+1
| | | | | This makes it easier to conditionally enable/disable the thread resource count usage.
* rtems: Fix binary semaphore resource countSebastian Huber2016-11-031-4/+1
| | | | | | Binary semaphores (not simple binary semaphores) maintain the resource count since 8797c76addf22a2f0ffc3717ff977695e35b9b0b. Do this also for initially locked binary semaphores.
* score: Introduce Thread_Scheduler_control::homeSebastian Huber2016-11-023-4/+4
| | | | | | | | Replace Thread_Scheduler_control::control and Thread_Scheduler_control::own_control with new Thread_Scheduler_control::home. Update #2556.
* rtems: Add rtems_task_iterate()Sebastian Huber2016-11-021-0/+31
| | | | Update #2423.
* score: Unify CORE mutex seize/surrenderSebastian Huber2016-09-272-3/+4
| | | | | | Use the Thread_Control::resource_count for the no protocol mutexes. Merge the no protocol and priority inherit CORE mutex seize/surrender operations.
* rtems: Add rtems_task_get_priority()Sebastian Huber2016-09-211-0/+77
| | | | | Update #2556. Update #2784.
* score: Rework thread priority managementSebastian Huber2016-09-215-70/+72
| | | | | | | | | | | | | | | | | | | | | | | | | Add priority nodes which contribute to the overall thread priority. The actual priority of a thread is now an aggregation of priority nodes. The thread priority aggregation for the home scheduler instance of a thread consists of at least one priority node, which is normally the real priority of the thread. The locking protocols (e.g. priority ceiling and priority inheritance), rate-monotonic period objects and the POSIX sporadic server add, change and remove priority nodes. A thread changes its priority now immediately, e.g. priority changes are not deferred until the thread releases its last resource. Replace the _Thread_Change_priority() function with * _Thread_Priority_perform_actions(), * _Thread_Priority_add(), * _Thread_Priority_remove(), * _Thread_Priority_change(), and * _Thread_Priority_update(). Update #2412. Update #2556.
* score: Introduce _Thread_Get_priority()Sebastian Huber2016-09-081-2/+2
| | | | Avoid direct access to thread internal data fields.
* score: Introduce Thread_queue_Lock_contextSebastian Huber2016-09-082-3/+5
| | | | | | Introduce Thread_queue_Lock_context to contain the context necessary for thread queue lock and thread wait lock acquire/release operations to reduce the Thread_Control size.
* score: Simplify thread queue acquire/releaseSebastian Huber2016-09-083-6/+6
|
* score: Fix a release/cancel job race conditionSebastian Huber2016-08-047-31/+25
| | | | | | | | Split up the potential thread priority change in the scheduler release/cancel job operation. Protect the rate monotonic period state with a dedicated SMP lock. This avoids a race condition during _Rate_monotonic_Timeout() while _Rate_monotonic_Cancel() is called on another processor.
* score: Indroduce cancel job scheduler operationSebastian Huber2016-08-041-1/+1
| | | | | Do not use a deadline value of zero to indicate a job cancellation. Use a dedicated scheduler operation for this.
* score: Fix for RTEMS_DEBUGSebastian Huber2016-08-031-0/+1
|
* score: Turn thread lock into thread wait lockSebastian Huber2016-07-275-20/+18
| | | | | | | | | The _Thread_Lock_acquire() function had a potentially infinite run-time due to the lack of fairness at atomic operations level. Update #2412. Update #2556. Update #2765.
* cpukit/rtems: fix return type mismatch for _TOD_To_secondsGedare Bloom2016-07-251-1/+1
|
* cpukit: Add and use Watchdog_Discipline.Gedare Bloom2016-07-256-9/+5
| | | | | | | | | Clock disciplines may be WATCHDOG_RELATIVE, WATCHDOG_ABSOLUTE, or WATCHDOG_NO_TIMEOUT. A discipline of WATCHDOG_RELATIVE with a timeout of WATCHDOG_NO_TIMEOUT is equivalent to a discipline of WATCHDOG_NO_TIMEOUT. updates #2732
* rtems: Fix rtems_task_set_scheduler() APISebastian Huber2016-07-011-6/+15
| | | | | | | | | | | Task priorities are only valid within a scheduler instance. The rtems_task_set_scheduler() directive moves a task from one scheduler instance to another using the current priority of the thread. However, the current task priority of the source scheduler instance is undefined in the target scheduler instance. Add a third parameter to specify the priority. Close #2749.
* score: Avoid atomic fences for thread wait flagsSebastian Huber2016-06-304-13/+4
| | | | | The use of atomic fences is brittle and may break due to changes in different areas which is hard to manage.
* score: Modify release job scheduler operationSebastian Huber2016-06-221-3/+4
| | | | | | Pass the deadline in watchdog ticks to the scheduler. Update #2173.
* score: Introduce map priority scheduler operationSebastian Huber2016-06-222-25/+46
| | | | | | | | | | | Introduce map/unmap priority scheduler operations to map thread priority values from/to the user domain to/from the scheduler domain. Use the map priority operation to validate the thread priority. The EDF schedulers use this new operation to distinguish between normal priorities and priorities obtain through a job release. Update #2173. Update #2556.
* rtems: Rework RTEMS API to SuperCore prioritySebastian Huber2016-06-225-87/+164
| | | | | Use same structure as POSIX API for thread priority conversion to/from SuperCore.
* Move printer initialization to separate headerSebastian Huber2016-06-221-1/+1
| | | | | | The RTEMS print user need to know nothing about a particular printer implementation. In particular get rid of the <stdio.h> include which would be visible via <rtems.h>.
* rtems: Fix rtems_semaphore_create()Sebastian Huber2016-06-161-0/+4
| | | | | Destroy the thread queue in case of a priority ceiling violation, otherwise the SMP profiling data gets corrupted.
* rtems: Simplify rtems_semaphore_create()Sebastian Huber2016-06-071-132/+113
| | | | | Remove superfluous includes. Use one attribute compare for each semaphore variant. Text size drops by 10% on PowerPC due to this.
* rtems: Fix no protocol mutex releaseSebastian Huber2016-06-061-1/+2
| | | | | | | | | | | | | | | | The Classic binary semaphores without a locking protocol (RTEMS_BINARY_SEMAPHORE) could be released by everyone, e.g. in contrast to the POSIX mutexes (all variants) or the Classic binary semphores with priority inheritance or ceiling, there was no owner check in the release path. This behaviour was a bit unexpected and not documented. Add an owner check to the release path. Update sptests/sp42 accordingly. This change has nothing to do with the simple binary semaphores (RTEMS_SIMPLE_BINARY_SEMAPHORE) which have no owner at all. Update #2725
* rtems: Remove superfluous includesSebastian Huber2016-05-301-5/+0
|
* rtems: Fix semaphore field nameSebastian Huber2016-05-303-6/+6
|
* rtems: Move MrsP semaphore operationsSebastian Huber2016-05-305-25/+25
| | | | | Move MrsP semaphore operations to a less prominent location. Fix field name.
* score: Rework CORE inherit priority mutexSebastian Huber2016-05-306-30/+27
| | | | | Provide dedicated seize and surrender methods for inherit priority mutexes. This eliminates CORE_mutex_Attributes.
* score: Rework CORE priority ceiling mutexSebastian Huber2016-05-306-51/+99
| | | | | Rework seize and surrender methods to use CORE_ceiling_mutex_Control. This eliminates CORE_mutex_Disciplines.
* score: Add CORE mutex variantsSebastian Huber2016-05-306-32/+64
| | | | | | | | Add CORE_recursive_mutex_Control and CORE_ceiling_mutex_Control to avoid the run-time evaluation of attributes to figure out how a particular mutex methods should behave. Start with the no protocol variants. This eliminates the CORE_MUTEX_DISCIPLINES_FIFO and CORE_MUTEX_DISCIPLINES_PRIORITY disciplines.
* rtems: Remove superfluous includesSebastian Huber2016-05-301-11/+1
|