summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
* score: Fix C/C++ compatibility issueSebastian Huber2016-09-231-4/+6
| | | | | | | | | Only use CPU_Per_CPU_control if it contains at least one filed. In GNU C empty structures have a size of zero. In C++ structures have a non-zero size. In case CPU_PER_CPU_CONTROL_SIZE is defined to zero, then this structure is not used anymore. Close #2789.
* posix: Fix pthread_spin_unlock() error statusSebastian Huber2016-05-251-9/+4
| | | | Update #2719.
* score: Fix simple timecounter supportSebastian Huber2016-01-271-8/+8
| | | | Close #2502.
* score: Fix watchdog insertSebastian Huber2016-01-051-4/+12
| | | | | | | | | Under certain conditions a new watchdog was inserted with a wrong and very large delta interval due to a wrong iterator update. Bug was introduced by 1ccbd052910ed16131c74b0d5595c8a94066942d. Close #2507.
* score: Fix watchdog removalSebastian Huber2015-12-211-1/+10
| | | | | | | | | Under certain conditions a new watchdog was inserted with a wrong and very large delta interval due to an incomplete iterator update. Bug was introduced by 1ccbd052910ed16131c74b0d5595c8a94066942d. Close #2501.
* Fix _Assert() statementSebastian Huber2015-11-251-1/+1
|
* score: Fix race condition on SMPSebastian Huber2015-11-171-19/+28
| | | | | | | | We must ensure that the Thread_Control::Wait information update is visible to the target thread before we update its wait flags, otherwise we may return out of date events or a wrong status. Close #2471.
* score: Accept NULL pointer in _Freechain_Put()Sebastian Huber2015-07-011-1/+3
| | | | With this a _Freechain_Put( _Freechain_Get() ) works always.
* score: Freechain handler API changesSebastian Huber2015-07-011-11/+42
| | | | | Replace the extend function with an allocator since this fits better to the current use case.
* score: Hide SMP lock profiling impl if disabledSebastian Huber2015-06-262-10/+11
| | | | The problem is that empty structures have a different size in C and C++.
* score: Simplify <rtems/system.h>Sebastian Huber2015-06-261-1/+1
| | | | | Drop the <rtems/score/percpu.h> include since this file exposes a lot of implementation details.
* score: Move default _ISR_Is_in_progress()Sebastian Huber2015-06-251-0/+51
|
* score: Move SMP CPU_USE_DEFERRED_FP_SWITCH checkSebastian Huber2015-06-251-0/+4
|
* score: Assert proper node sizeSebastian Huber2015-06-241-3/+4
|
* Remove use ticks for statistics configure option.Joel Sherrill2015-06-153-23/+5
| | | | | | | | | | This was obsolete and broken based upon recent time keeping changes. Thie build option was previously enabled by adding USE_TICKS_FOR_STATISTICS=1 to the configure command line. This propagated into the code as preprocessor conditionals using the __RTEMS_USE_TICKS_FOR_STATISTICS__ conditional.
* score: Add _Watchdog_Preinitialize()Sebastian Huber2015-06-131-1/+1
| | | | | | Add an assert to ensure that the watchdog is the proper state for a _Watchdog_Initialize(). This helps to detect invalid initializations which may lead to a corrupt watchdog chain.
* score: Delete unused state WATCHDOG_REMOVE_ITSebastian Huber2015-06-131-5/+1
|
* Revert "timecounter: No _Timecounter_Tick_simple() for SMP"Sebastian Huber2015-06-111-6/+0
| | | | | | | | | This reverts commit 46ae1d7a2b49b8f973dd6ba44fbbd38383798524. The _Timecounter_Tick_simple() function actually doesn't switch to the next timehand, so it is all right to use the simple timecounter approach even on SMP configurations. The use of simple timecounters is not recommended however since they impose a performance penalty.
* timecounter: No _Timecounter_Tick_simple() for SMPSebastian Huber2015-06-091-0/+6
|
* timecounter: Synchronize with FreeBSDkib2015-06-091-42/+82
| | | | | | | | | | | | | | | | When updating/accessing the timehands, barriers are needed to ensure that: - th_generation update is visible after the parameters update is visible; - the read of parameters is not reordered before initial read of th_generation. On UP kernels, compiler barriers are enough. For SMP machines, CPU barriers must be used too, as was confirmed by submitter by testing on the Freescale T4240 platform with 24 PowerPC processors. Submitted by: Sebastian Huber <sebastian.huber@embedded-brains.de> MFC after: 1 week
* timecounter: Synchronize with FreeBSDian2015-06-091-5/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement a mechanism for making changes in the kernel<->driver PPS interface without breaking ABI or API compatibility with existing drivers. The existing data structures used to communicate between the kernel and driver portions of PPS processing contain no spare/padding fields and no flags field or other straightforward mechanism for communicating changes in the structures or behaviors of the code. This makes it difficult to MFC new features added to the PPS facility. ABI compatibility is important; out-of-tree drivers in module form are known to exist. (Note that the existing api_version field in the pps_params structure must contain the value mandated by RFC 2783 and any RFCs that come along after.) These changes introduce a pair of abi-version fields which are filled in by the driver and the kernel respectively to indicate the interface version. The driver sets its version field before calling the new pps_init_abi() function. That lets the kernel know how much of the pps_state structure is understood by the driver and it can avoid using newer fields at the end of the structure that it knows about if the driver is a lower version. The kernel fills in its version field during the init call, letting the driver know what features and data the kernel supports. To implement the new version information in a way that is backwards compatible with code from before these changes, the high bit of the lightly-used 'kcmode' field is repurposed as a flag bit that indicates the driver is aware of the abi versioning scheme. Basically if this bit is clear that indicates a "version 0" driver and if it is set the driver_abi field indicates the version. These changes also move the recently-added 'mtx' field of pps_state from the middle to the end of the structure, and make the kernel code that uses this field conditional on the driver being abi version 1 or higher. It changes the only driver currently supplying the mtx field, usb_serial, to use pps_init_abi(). Reviewed by: hselasky@
* timecounter: Synchronize with FreeBSDian2015-06-091-9/+10
| | | | Use sbuf_printf() for sysctl strings instead of stack buffers and snprintf().
* timecounter: Synchronize with FreeBSDhselasky2015-06-091-8/+6
| | | | | | | | Add mutex support to the pps_ioctl() API in the kernel. Bump kernel version to reflect structure change. PR: 196897 MFC after: 1 week
* score: Add Thread_Control::is_fpSebastian Huber2015-06-092-5/+3
| | | | | | | | Store the floating-point unit property in the thread control block regardless of the CPU_HARDWARE_FP and CPU_SOFTWARE_FP settings. Make sure the floating-point unit is only enabled for the corresponding multilibs. This helps targets which have a volatile only floating point context like SPARC for example.
* score: Remove assertSebastian Huber2015-06-031-6/+0
| | | | | | With the introduction of fine grained locking there is no longer a one-to-one connection between the Giant lock nest level and the thread dispatch disable level.
* score: Replace _API_Mutex_Is_locked()Sebastian Huber2015-05-271-5/+3
| | | | Replace _API_Mutex_Is_locked() with _API_Mutex_Is_owner().
* timecounter: Use in RTEMSAlexander Krutwig2015-05-2021-531/+64
| | | | | | | | Replace timestamp implementation with FreeBSD bintime and timecounters. New test sptests/sptimecounter02. Update #2271.
* timecounter: Port to RTEMSAlexander Krutwig2015-05-201-0/+171
| | | | | | New test sptests/timecounter01. Update #2271.
* timecounter: Honor FFCLOCK defineAlexander Krutwig2015-05-191-0/+4
| | | | Update #2271.
* timecounter: Use uint32_t instead of u_intAlexander Krutwig2015-05-191-17/+17
| | | | | | | FreeBSD assumes that u_int is a 32-bit integer type. This is wrong for some 16-bit targets supported by RTEMS. Update #2271.
* timecounter: Import from FreeBSDAlexander Krutwig2015-05-194-0/+2039
| | | | Update #2271.
* score: _Thread_Dispatch_disable_critical()Sebastian Huber2015-05-191-2/+2
| | | | | | | Thread dispatching is disabled in case interrupts are disabled. To get an accurate thread dispatch disabled time it is important to use the interrupt disabled instant in case a transition from an interrupt disabled section to a thread dispatch level section happens.
* score: Replace _Thread_Delay_ended()Sebastian Huber2015-05-191-38/+0
| | | | | | | Use _Thread_Timeout() instead. Use pseudo thread queue for nanosleep() to deal with signals. Close #2130.
* score: Do not inline SMP lock if profiling enabledSebastian Huber2015-05-191-0/+68
| | | | This reduces the code size drastically.
* score: Fine grained locking for MrsPSebastian Huber2015-05-191-5/+0
| | | | Update #2273.
* score: Rework _Thread_Change_priority()Sebastian Huber2015-05-1911-59/+171
| | | | | | | | | | | | | Move the writes to Thread_Control::current_priority and Thread_Control::real_priority into _Thread_Change_priority() under the protection of the thread lock. Add a filter function to _Thread_Change_priority() to enable specialized variants. Avoid race conditions during a thread priority restore with the new Thread_Control::priority_restore_hint for an important average case optimizations used by priority inheritance mutexes. Update #2273.
* score: Fine grained locking for mutexesSebastian Huber2015-05-196-60/+99
| | | | Update #2273.
* score: Inline _CORE_semaphore_Surrender()Sebastian Huber2015-05-191-66/+0
|
* score: Inline _CORE_semaphore_Flush()Sebastian Huber2015-05-191-39/+0
|
* score: Delete _CORE_semaphore_Seize()Sebastian Huber2015-05-192-75/+4
| | | | Rename _CORE_semaphore_Seize_isr_disable() to _CORE_semaphore_Seize().
* score: Fine grained locking for semaphoresSebastian Huber2015-05-192-14/+27
| | | | Update #2273.
* score: Fine grained locking for message queuesSebastian Huber2015-05-196-96/+99
| | | | | | | | | | | Aggregate several critical sections into a bigger one. Sending and receiving messages is now protected by an ISR lock. Thread dispatching is only disabled in case a blocking operation is necessary. The message copy procedure is done inside the critical section (interrupts disabled). Thus this change may have a negative impact on the interrupt latency in case very large messages are transferred. Update #2273.
* score: Delete _CORE_message_queue_Flush_support()Sebastian Huber2015-05-193-98/+61
| | | | | Check the number of pending messages in _CORE_message_queue_Flush() to avoid race conditions.
* score: Delete Thread_queue_Control::timeout_statusSebastian Huber2015-05-1915-24/+22
| | | | | Use a parameter for _Thread_queue_Enqueue() instead to reduce memory usage.
* score: New thread queue implementationSebastian Huber2015-05-198-287/+130
| | | | | | | | | Use thread wait flags for synchronization. The enqueue operation is now part of the initial critical section. This is the key change and enables fine grained locking on SMP for objects using a thread queue like semaphores and message queues. Update #2273.
* score: More thread queue operationsSebastian Huber2015-05-196-82/+160
| | | | | | | | | Move thread queue discipline specific operations into Thread_queue_Operations. Use a separate node in the thread control block for the thread queue to make it independent of the scheduler data structures. Update #2273.
* score: Add Thread_queue_OperationsSebastian Huber2015-05-195-41/+70
| | | | | | | | Replace the Thread_Priority_control with more general Thread_queue_Operations which will be used for generic priority change, timeout, signal and wait queue operations in the future. Update #2273.
* score: Add Thread_queue_Control::LockSebastian Huber2015-05-1912-105/+102
| | | | | | | | | | | Move the complete thread queue enqueue procedure into _Thread_queue_Enqueue_critical(). It is possible to use the thread queue lock to protect state of the object embedding the thread queue. This enables per object fine grained locking in the future. Delete _Thread_queue_Enter_critical_section(). Update #2273.
* score: Generalize _Event_Timeout()Sebastian Huber2015-05-191-0/+74
| | | | | | | Add a thread wait timeout code. Replace _Event_Timeout() with a general purpose _Thread_Timeout() watchdog handler. Update #2273.
* score: New timer server implementationSebastian Huber2015-05-193-94/+37
| | | | | | | | Use mostly the standard watchdog operations. Use a system event for synchronization. This implementation is simpler and offers better SMP performance. Close #2131.