summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems (unfollow)
Commit message (Collapse)AuthorFilesLines
2017-01-12rtems: Use header file for rtems_object_get_name()Sebastian Huber1-10/+1
2017-01-12score: Replace STATES_DELAYINGSebastian Huber1-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.
2017-01-11Remove obsolete __RTEMS_HAVE_SYS_CPUSET_H__Joel Sherrill4-14/+0
2016-12-12score: Introduce _Internal_error()Sebastian Huber1-8/+2
2016-12-12Add INTERNAL_ERROR_RTEMS_INIT_TASK_CREATE_FAILEDSebastian Huber1-2/+6
Update #2825.
2016-12-09score: Remove fatal is internal indicatorSebastian Huber1-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.
2016-12-02rtems: Use _Thread_Dispatch_direct()Sebastian Huber2-2/+2
Update #2797.
2016-12-02rtems: Fix rtems_scheduler_add_processor()Sebastian Huber1-4/+1
Fix thread dispatch profiling of rtems_scheduler_add_processor(). Update #2797.
2016-12-02score: Initialize thread queue context earlySebastian Huber3-1/+3
Initialize thread queue context early preferably outside the critical section. Remove implicit _Thread_queue_Context_initialize() from _Thread_Wait_acquire().
2016-11-24score: Optimize _Thread_queue_Enqueue()Sebastian Huber1-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.
2016-11-23posix: Add self-contained pthread spinlockSebastian Huber1-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.
2016-11-23score: Rename _Thread_queue_Enqueue_critical()Sebastian Huber1-1/+1
Delete unused _Thread_queue_Enqueue() and rename _Thread_queue_Enqueue_critical() to _Thread_queue_Enqueue().
2016-11-23score: Add thread queue enqueue calloutSebastian Huber3-31/+44
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.
2016-11-18rtems: Conditionally define rtems_interrupt_frameSebastian Huber1-1/+6
Update #2808.
2016-11-18score: Add and use _Thread_Dispatch_direct()Sebastian Huber1-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.
2016-11-10rtems: Add scheduler processor add/removeSebastian Huber4-4/+318
Update #2797.
2016-11-09score: Simplify _Scheduler_Get_by_id()Sebastian Huber6-12/+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.
2016-11-09rtems: Fix rtems_task_create() scheduler selectionSebastian Huber1-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.
2016-11-03score: Introduce thread resource count methodsSebastian Huber1-1/+1
This makes it easier to conditionally enable/disable the thread resource count usage.
2016-11-03rtems: Fix binary semaphore resource countSebastian Huber1-4/+1
Binary semaphores (not simple binary semaphores) maintain the resource count since 8797c76addf22a2f0ffc3717ff977695e35b9b0b. Do this also for initially locked binary semaphores.
2016-11-02score: Introduce Thread_Scheduler_control::homeSebastian Huber3-4/+4
Replace Thread_Scheduler_control::control and Thread_Scheduler_control::own_control with new Thread_Scheduler_control::home. Update #2556.
2016-11-02rtems: Add rtems_task_iterate()Sebastian Huber3-0/+64
Update #2423.
2016-09-27score: Unify CORE mutex seize/surrenderSebastian Huber2-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.
2016-09-21rtems: Add rtems_task_get_priority()Sebastian Huber3-0/+107
Update #2556. Update #2784.
2016-09-21score: Rework thread priority managementSebastian Huber6-70/+78
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.
2016-09-08score: Introduce _Thread_Get_priority()Sebastian Huber1-2/+2
Avoid direct access to thread internal data fields.
2016-09-08score: Introduce Thread_queue_Lock_contextSebastian Huber5-7/+12
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.
2016-09-08score: Simplify thread queue acquire/releaseSebastian Huber3-6/+6
2016-08-04score: Fix a release/cancel job race conditionSebastian Huber9-37/+36
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.
2016-08-04score: Indroduce cancel job scheduler operationSebastian Huber1-1/+1
Do not use a deadline value of zero to indicate a job cancellation. Use a dedicated scheduler operation for this.
2016-08-03score: Fix for RTEMS_DEBUGSebastian Huber1-0/+1
2016-07-27score: Turn thread lock into thread wait lockSebastian Huber6-22/+20
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.
2016-07-25cpukit/rtems: fix return type mismatch for _TOD_To_secondsGedare Bloom1-1/+1
2016-07-25cpukit: Add and use Watchdog_Discipline.Gedare Bloom6-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
2016-07-04rtems+bsps/cache: Define cache manager operations for code synchronization ↵Pavel Pisa1-0/+29
and maximal alignment. There is need for unambiguous named and defined cache function which should be called when code is updated, loaded or is self-modifying. There should be function to obtain maximal cache line length as well. This function can and should be used for allocations which can be used for data and or code and ensures that there are no partial cache lines overlaps on start and end of allocated region.
2016-07-01rtems: Fix rtems_task_set_scheduler() APISebastian Huber2-13/+31
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.
2016-06-30score: Avoid atomic fences for thread wait flagsSebastian Huber4-13/+4
The use of atomic fences is brittle and may break due to changes in different areas which is hard to manage.
2016-06-24score: Change Priority_Control to 64-bitSebastian Huber1-1/+1
A 32-bit Priority_Control limits the uptime to 49 days with a 1ms clock tick in case the EDF scheduler is used. Increase it to 64-bit to enable proper operation of the EDF scheduler, Close 2173.
2016-06-22score: Modify release job scheduler operationSebastian Huber1-3/+4
Pass the deadline in watchdog ticks to the scheduler. Update #2173.
2016-06-22score: Introduce map priority scheduler operationSebastian Huber3-28/+50
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.
2016-06-22rtems: Rework RTEMS API to SuperCore prioritySebastian Huber6-109/+191
Use same structure as POSIX API for thread priority conversion to/from SuperCore.
2016-06-22Avoid <rtems/print.h> in <rtems/rtems/ratemon.h>Sebastian Huber1-2/+3
This gets rid of the pull in of <stdarg.h> via <rtems.h> via <rtems/rtems/ratemon.h> via <rtems/print.h>.
2016-06-22Move printer initialization to separate headerSebastian Huber1-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>.
2016-06-16rtems: Fix rtems_semaphore_create()Sebastian Huber1-0/+4
Destroy the thread queue in case of a priority ceiling violation, otherwise the SMP profiling data gets corrupted.
2016-06-07rtems: Simplify rtems_semaphore_create()Sebastian Huber1-132/+113
Remove superfluous includes. Use one attribute compare for each semaphore variant. Text size drops by 10% on PowerPC due to this.
2016-06-06rtems: Fix no protocol mutex releaseSebastian Huber1-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
2016-05-30rtems: Remove superfluous includesSebastian Huber1-5/+0
2016-05-30rtems: Fix semaphore field nameSebastian Huber4-7/+7
2016-05-30rtems: Move MrsP semaphore operationsSebastian Huber6-26/+26
Move MrsP semaphore operations to a less prominent location. Fix field name.
2016-05-30score: Rework CORE inherit priority mutexSebastian Huber8-38/+28
Provide dedicated seize and surrender methods for inherit priority mutexes. This eliminates CORE_mutex_Attributes.