summaryrefslogtreecommitdiffstats
path: root/cpukit/posix (unfollow)
Commit message (Collapse)AuthorFilesLines
2015-05-19score: Add header to _Watchdog_Remove()Sebastian Huber8-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.
2015-05-19score: Delete STATES_WAITING_ON_THREAD_QUEUESebastian Huber1-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.
2015-04-24posix: Use right thread dispatch disable functionSebastian Huber1-1/+1
2015-04-23score: Fix POSIX thread joinSebastian Huber1-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.
2015-04-23score: Delete Thread_queue_Control::stateSebastian Huber6-6/+16
Use a parameter for _Thread_queue_Enqueue() instead to reduce memory usage.
2015-04-22score: Delete bogus THREAD_QUEUE_WAIT_FOREVERSebastian Huber7-7/+7
It makes no sense to use this indirection since the type for timeout values is Watchdog_Interval.
2015-04-21score: _Objects_Get_isr_disable()Sebastian Huber1-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.
2015-04-21score: _Objects_Get_isr_disable()Sebastian Huber3-6/+10
Use ISR_lock_Context instead of ISR_Level to allow use of ISR locks for low-level locking. Update #2273.
2015-04-14semdestroy.c: Add missing _Objects_Allocator_unlock()Joel Sherrill1-8/+7
closes 2319.
2015-04-14semunlink.c: Add missing _Objects_Allocator_unlock()Daniel Krueger1-0/+1
updates 2319. Signed-off-by: Daniel Krueger <daniel.krueger@systec-electronic.com>
2015-04-14score: Rename _Watchdog_Reset()Sebastian Huber1-1/+1
Update #2307.
2015-03-12posix/src/nanosleep.c: Address issue when delay is longer than desiredJoel Sherrill1-16/+27
This resulted in the elapsed time going below 0 and an arbitrarily large number returned as the time remaining. closes #2296.
2015-03-12posix: Return error code if mmap is usedDaniel Cederman1-1/+1
2015-03-12posix: Move function to file with matching nameDaniel Cederman2-10/+10
mmap was previously in munmap.c and munmap was in mmap.c.
2015-03-10posix: Install <semaphore.h> only if not providedSebastian Huber2-1/+4
2015-03-10posix: Change sem_t to the 32-bit object typeSebastian Huber2-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.
2015-03-10posix: Use a value of 0 for SEM_FAILEDSebastian Huber1-1/+1
This is the standard NULL pointer.
2015-03-10score: Add rtems_set_errno_and_return_value()Sebastian Huber2-8/+10
Remove rtems_set_errno_and_return_minus_one_cast().
2015-03-09sysconf: Add _SC_NPROCESSORS_(CONF|ONLN)Sebastian Huber1-0/+4
2015-03-09sysconf: SimplifySebastian Huber1-22/+17
2015-03-05score: Simplify and fix signal deliverySebastian Huber1-8/+14
Deliver the POSIX signals after the thread state was updated to avoid race-conditions on SMP configurations. Update #2273.
2015-02-25posix: fix error return code for pthread_mutex_trylockGedare Bloom1-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.
2014-12-18posix: Delete unused _POSIX_Threads_Get()Sebastian Huber1-34/+0
Close #1759.
2014-12-12posix: Delete key/value if value is set to NULLSebastian Huber3-38/+87
2014-12-12posix: Simplify _POSIX_Keys_Find()Sebastian Huber4-12/+10
2014-11-26cpukit/posix/src/timertsr.c: Add _Assert()Josh Oguin1-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.
2014-11-20sys/mman.h: New file. Clean up and add supporting stubsJoel Sherrill5-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.
2014-10-13score: Rework global constructionSebastian Huber1-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.
2014-10-08posix: Add auto initializaton for rwlockSebastian Huber10-46/+54
2014-10-08posix: Fix mutex auto initializationSebastian Huber1-1/+10
Use the once lock to prevent race conditions during auto initialization.
2014-10-08posix: Use function instead of macrosSebastian Huber1-41/+28
2014-09-08posix: Use RTEMS_DECONST()Sebastian Huber2-3/+3
2014-09-08posix: Fix warningSebastian Huber1-2/+0
2014-09-04mprotect.c: Remove warning for no prototypeJoel Sherrill1-9/+14
2014-08-29Regenerate all preinstall.am files.Chris Johns1-3/+3
With this patch the preinstall.am files are in a set order and not dependent on now perl implements a hash.
2014-08-28Regenerate all preinstall.am files.Joel Sherrill1-3/+3
Apparently, at some point automake output changed and these were not updated.
2014-08-05posix: Simplify key implementationSebastian Huber5-21/+44
2014-08-05rbtree: Add and use RBTree_Compare_resultSebastian Huber2-3/+3
2014-08-05Add and use RTEMS_CONTAINER_OF()Sebastian Huber5-13/+11
2014-07-26Delete unused *_Is_null() functionsSebastian Huber8-127/+0
2014-07-23Add _TOD_Adjust to SCORE TOD Handler.Joel Sherrill1-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.
2014-07-23adjtime.c: Use timestamp math and simplifyJoel Sherrill1-40/+28
2014-07-15rbtree: Reduce RBTree_Control sizeSebastian Huber5-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().
2014-06-20score: Fix _Thread_Delay_ended() on SMPSebastian Huber1-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.
2014-06-12score: PR2181: Add _Thread_Yield()Sebastian Huber2-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.
2014-06-03score: Add and use _Thread_Owns_resources()Sebastian Huber1-2/+2
2014-06-02score: _Scheduler_Get_affinity()Sebastian Huber1-1/+0
Drop scheduler parameter. Coding style.
2014-05-15score: Simplify _Thread_Change_priority()Sebastian Huber2-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.
2014-05-06posix: Fix POSIX keys initializationSebastian Huber1-5/+5
Always initialize the freechain. This prevents a NULL pointer access in case no initial key value pairs are defined.
2014-04-15score: Add clustered/partitioned schedulingSebastian Huber2-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.