summaryrefslogtreecommitdiffstats
path: root/cpukit/posix (follow)
Commit message (Collapse)AuthorAgeFilesLines
* score: Add header to _Watchdog_Remove()Sebastian Huber2015-05-198-9/+9
| | | | | | | | Add watchdog header parameter to _Watchdog_Remove() to be in line with the other operations. Add _Watchdog_Remove_ticks() and _Watchdog_Remove_seconds() for convenience. Update #2307.
* score: Delete STATES_WAITING_ON_THREAD_QUEUESebastian Huber2015-05-191-3/+3
| | | | | | 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.
* posix: Use right thread dispatch disable functionSebastian Huber2015-04-241-1/+1
|
* score: Fix POSIX thread joinSebastian Huber2015-04-231-1/+1
| | | | | | | | | | | | 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: Delete Thread_queue_Control::stateSebastian Huber2015-04-236-6/+16
| | | | | Use a parameter for _Thread_queue_Enqueue() instead to reduce memory usage.
* score: Delete bogus THREAD_QUEUE_WAIT_FOREVERSebastian Huber2015-04-227-7/+7
| | | | | It makes no sense to use this indirection since the type for timeout values is Watchdog_Interval.
* score: _Objects_Get_isr_disable()Sebastian Huber2015-04-211-0/+6
| | | | | | | | Do not disable thread dispatching and do not acquire the Giant lock. This makes it possible to use this object get variant for fine grained locking. Update #2273.
* score: _Objects_Get_isr_disable()Sebastian Huber2015-04-213-6/+10
| | | | | | | Use ISR_lock_Context instead of ISR_Level to allow use of ISR locks for low-level locking. Update #2273.
* semdestroy.c: Add missing _Objects_Allocator_unlock()Joel Sherrill2015-04-141-8/+7
| | | | closes 2319.
* semunlink.c: Add missing _Objects_Allocator_unlock()Daniel Krueger2015-04-141-0/+1
| | | | | | updates 2319. Signed-off-by: Daniel Krueger <daniel.krueger@systec-electronic.com>
* score: Rename _Watchdog_Reset()Sebastian Huber2015-04-141-1/+1
| | | | Update #2307.
* posix/src/nanosleep.c: Address issue when delay is longer than desiredJoel Sherrill2015-03-121-16/+27
| | | | | | | This resulted in the elapsed time going below 0 and an arbitrarily large number returned as the time remaining. closes #2296.
* posix: Return error code if mmap is usedDaniel Cederman2015-03-121-1/+1
|
* posix: Move function to file with matching nameDaniel Cederman2015-03-122-10/+10
| | | | mmap was previously in munmap.c and munmap was in mmap.c.
* posix: Install <semaphore.h> only if not providedSebastian Huber2015-03-102-1/+4
|
* posix: Change sem_t to the 32-bit object typeSebastian Huber2015-03-102-2/+2
| | | | | This change is also valid for 16-bit object type architectures since in this case POSIX_Semaphore_Control::Semaphore_id is used as a proxy.
* posix: Use a value of 0 for SEM_FAILEDSebastian Huber2015-03-101-1/+1
| | | | This is the standard NULL pointer.
* score: Add rtems_set_errno_and_return_value()Sebastian Huber2015-03-102-8/+10
| | | | Remove rtems_set_errno_and_return_minus_one_cast().
* sysconf: Add _SC_NPROCESSORS_(CONF|ONLN)Sebastian Huber2015-03-091-0/+4
|
* sysconf: SimplifySebastian Huber2015-03-091-22/+17
|
* score: Simplify and fix signal deliverySebastian Huber2015-03-051-8/+14
| | | | | | | Deliver the POSIX signals after the thread state was updated to avoid race-conditions on SMP configurations. Update #2273.
* posix: fix error return code for pthread_mutex_trylockGedare Bloom2015-02-251-1/+4
| | | | | | | | | pthread_mutex_trylock() should return EBUSY if the mutex is already locked. The translations of CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED is EDEADLK which is correct for pthread_mutex_lock(). This fixes the translation for trylock. Closes #2170.
* posix: Delete unused _POSIX_Threads_Get()Sebastian Huber2014-12-181-34/+0
| | | | Close #1759.
* posix: Delete key/value if value is set to NULLSebastian Huber2014-12-123-38/+87
|
* posix: Simplify _POSIX_Keys_Find()Sebastian Huber2014-12-124-12/+10
|
* cpukit/posix/src/timertsr.c: Add _Assert()Josh Oguin2014-11-261-1/+8
| | | | | | | | | CodeSonar flagged this as an empty if body. Upon analysis, it turned out to be an error that we think should never occur but if it did, there is nothing we could do about it. It would likely just indicate the thread was deleted before we got here. Adding the _Assert() at least will flag this if it ever occurs during a debug build and we can discuss what happened.
* sys/mman.h: New file. Clean up and add supporting stubsJoel Sherrill2014-11-205-8/+249
| | | | | | * Makefile.am updated and preinstall.am regenerated. * mprotect.c had a prototype removed now that we have mman.h * mmap.c, munmap.c: New stub files.
* score: Rework global constructionSebastian Huber2014-10-131-2/+15
| | | | | | Ensure that the global construction is performed in the context of the first initialization thread. On SMP this was not guaranteed in the previous implementation.
* posix: Add auto initializaton for rwlockSebastian Huber2014-10-0810-46/+54
|
* posix: Fix mutex auto initializationSebastian Huber2014-10-081-1/+10
| | | | Use the once lock to prevent race conditions during auto initialization.
* posix: Use function instead of macrosSebastian Huber2014-10-081-41/+28
|
* posix: Use RTEMS_DECONST()Sebastian Huber2014-09-082-3/+3
|
* posix: Fix warningSebastian Huber2014-09-081-2/+0
|
* mprotect.c: Remove warning for no prototypeJoel Sherrill2014-09-041-9/+14
|
* Regenerate all preinstall.am files.Chris Johns2014-08-291-3/+3
| | | | | With this patch the preinstall.am files are in a set order and not dependent on now perl implements a hash.
* Regenerate all preinstall.am files.Joel Sherrill2014-08-281-3/+3
| | | | | Apparently, at some point automake output changed and these were not updated.
* posix: Simplify key implementationSebastian Huber2014-08-055-21/+44
|
* rbtree: Add and use RBTree_Compare_resultSebastian Huber2014-08-052-3/+3
|
* Add and use RTEMS_CONTAINER_OF()Sebastian Huber2014-08-055-13/+11
|
* Delete unused *_Is_null() functionsSebastian Huber2014-07-268-127/+0
|
* Add _TOD_Adjust to SCORE TOD Handler.Joel Sherrill2014-07-231-16/+14
| | | | | | | | This lays the proper structure for doing future work on time adjustment algorithms. Any TOD adjustments should be requested at the API level and performed at the SCORE level. Additionally updated a test.
* adjtime.c: Use timestamp math and simplifyJoel Sherrill2014-07-231-40/+28
|
* rbtree: Reduce RBTree_Control sizeSebastian Huber2014-07-155-29/+35
| | | | | | | | | | | | Remove compare function and is unique indicator from the control structure. Rename RBTree_Compare_function to RBTree_Compare. Rename rtems_rbtree_compare_function to rtems_rbtree_compare. Provide C++ compatible initializers. Add compare function and is unique indicator to _RBTree_Find(), _RBTree_Insert(), rtems_rbtree_find() and rtems_rbtree_insert(). Remove _RBTree_Is_unique() and rtems_rbtree_is_unique(). Remove compare function and is unique indicator from _RBTree_Initialize_empty() and rtems_rbtree_initialize_empty().
* score: Fix _Thread_Delay_ended() on SMPSebastian Huber2014-06-201-2/+2
| | | | | | | | | | | | | | | | 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.
* score: PR2181: Add _Thread_Yield()Sebastian Huber2014-06-122-7/+3
| | | | | | | | | | | | | | | | | | | 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.
* score: Add and use _Thread_Owns_resources()Sebastian Huber2014-06-031-2/+2
|
* score: _Scheduler_Get_affinity()Sebastian Huber2014-06-021-1/+0
| | | | Drop scheduler parameter. Coding style.
* score: Simplify _Thread_Change_priority()Sebastian Huber2014-05-152-10/+3
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* posix: Fix POSIX keys initializationSebastian Huber2014-05-061-5/+5
| | | | | Always initialize the freechain. This prevents a NULL pointer access in case no initial key value pairs are defined.
* score: Add clustered/partitioned schedulingSebastian Huber2014-04-152-3/+5
| | | | | | | | | | | | | | | Clustered/partitioned scheduling helps to control the worst-case latencies in the system. The goal is to reduce the amount of shared state in the system and thus prevention of lock contention. Modern multi-processor systems tend to have several layers of data and instruction caches. With clustered/partitioned scheduling it is possible to honour the cache topology of a system and thus avoid expensive cache synchronization traffic. We have clustered scheduling in case the set of processors of a system is partitioned into non-empty pairwise-disjoint subsets. These subsets are called clusters. Clusters with a cardinality of one are partitions. Each cluster is owned by exactly one scheduler instance.