summaryrefslogtreecommitdiffstats
path: root/cpukit/include/rtems/score (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* cpukit/include: Fixes for C++Chris Johns2022-08-222-3/+3
| | | | Updates #4706
* schedulerpriority.h: Fix gcc 12 warningRyan Long2022-08-191-1/+1
| | | | | | Changed the size of the array to 1 to get rid of the warning. Updates #4662
* percpu.h: Add pragma for gcc 12 warningRyan Long2022-08-191-0/+8
| | | | Updates #4662
* interr.h: Fix gcc 12 warningRyan Long2022-08-191-1/+3
| | | | | | | The warning that this fixes states that "ISO C restricts enumerator values to range of 'int'." Updates #4662
* score: Allow linker garbage collectionSebastian Huber2022-07-282-3/+3
| | | | | | | Place the object control blocks in dedicated sections to allow a linker garbage collection. Update #4678.
* score: Use PTHREAD_CANCELED for _Thread_Cancel()Sebastian Huber2022-07-281-4/+1
| | | | | | | | | | The rtems_task_delete() directive is basically just a combined pthread_cancel() and pthread_join(). In addition, it removes the PTHREAD_DETACHED state. The exit value returned by pthread_join() of threads cancelled by rtems_task_delete() should reflect this by getting a PTHREAD_CANCELED value instead of NULL which could be a normal exit value. Close #4680.
* score: Use priority inheritance for thread joinSebastian Huber2022-07-281-24/+57
| | | | | | | | | | | | | | | | | | | | | Threads may join the thread termination of another thread using the pthread_join() or rtems_task_delete() directives. The thread cancel operation used a special case priority boosting mechanism implemented by _Thread_Raise_real_priority(). The problem was that this approach * is not transitive, * does not account for priority adjustments of the calling task while waiting for the join, * does not support clustered scheduling, and * does not detect deadlocks. All these problems are fixed by using a priority inheritance thread queue for the join operation. Close #4679.
* score: Fix objects local table initializationSebastian Huber2022-07-272-4/+2
| | | | | | | | The objects local table must be statically zero-initialized so that _Objects_Get() and _Objects_Get_no_protection() return NULL if no object is associated with the identifier. Update #4678.
* score: Remove PRIORITY_PSEUDO_ISR thread prioritySebastian Huber2022-07-266-122/+242
| | | | | | | | | | | | | | | The uniprocessor schedulers had some special case logic for the PRIORITY_PSEUDO_ISR priority. Tasks with a priority of PRIORITY_PSEUDO_ISR were allowed to preempt a not preemptible task. If other higher priority task are made ready while a PRIORITY_PSEUDO_ISR task preempts a not preemptible task, then the other tasks run before the not preemptible task. This made the RTEMS_NO_PREEMPT mode ineffective. Remove the PRIORITY_PSEUDO_ISR special case logic. This simplifies the uniprocessor schedulers. Move the uniprocessor-specific scheduler support to the new header file <rtems/score/scheduleruniimpl.h>. Close #2365.
* Support _REENT_THREAD_LOCAL Newlib configurationMatt Joyce2022-07-211-0/+4
| | | | | | | | | In case the Newlib _REENT_THREAD_LOCAL configuration option is enabled, the struct _reent is not defined (there is only a forward declaration in <sys/reent.h>). Instead, the usual members of struct _reent are available as dedicatd thread-local storage objects. Update #4560.
* score: Fix unlimited objects supportSebastian Huber2022-07-181-4/+25
| | | | | | | | Commit 21275b58a5a69c3c838082ffc8a7a3641f32ea9a ("score: Static Objects_Information initialization") introduced an off-by-one error in the maintenance of inactive objects. Close #4677.
* score: Extend memory dirty/zero actionsSebastian Huber2022-07-151-1/+13
| | | | | | Dirty or zero also the part of the .noinit section used by RTEMS. Close #4678.
* score: Place object controls into .noinit sectionsSebastian Huber2022-07-152-5/+11
| | | | | | | | | | | | Place the statically allocated object control blocks, local tables, and thread queue heads into the dedicated .noinit intput sections. The output section is not zero initialized. Placing these elements into the .noinit section reduces the system initialization time by decreasing the .bss section size. It may improve the cache efficiency since the mostly read local tables are placed in a contiguous memory area. Update #4678.
* score: Conditional _Thread_Priority_replace()Sebastian Huber2022-07-071-0/+2
| | | | This function is only used in SMP configurations.
* gcov: Add functions to dump the gcov informationSebastian Huber2022-07-041-0/+87
| | | | Update #4670.
* score: Account for <sys/bitset.h> API changesSebastian Huber2022-06-231-17/+73
| | | | Update #4667.
* score: Remove unused _Processor_mask_Nand()Sebastian Huber2022-06-231-16/+0
| | | | Update #4667.
* score: Make SMP only code explicitSebastian Huber2022-06-231-28/+5
| | | | | | | Conditional expressions with inline functions are not optimized away if optimization is disabled. Avoid such expressions to prevent dead branches. It helps also during code review to immediately see if a loop is used or not.
* timecounter.h: Add _Timecounter_Discipline()Gabriel Moyano2022-05-231-0/+17
| | | | Update #2349.
* score: Rename tc_getfrequency()Gabriel Moyano2022-05-231-0/+8
| | | | | | Rename tc_getfrequency() to _Timecounter_Get_frequency(). Update #2349.
* score: Add SMP priority affinity scheduler yieldTian Ye2022-05-121-1/+7
|
* heap: Fix heap statistics with protection enabledSebastian Huber2022-04-281-9/+1
| | | | Close #4644.
* smp: Add fatal errorSebastian Huber2022-03-241-1/+2
| | | | | | | Add SMP-specifc SMP_FATAL_MULTITASKING_START_ON_NOT_ONLINE_PROCESSOR fatal error. This fatal error helps to diagnose a broken SMP startup sequence. Without this error a context switch using the NULL pointer for the thread control block happens which may be difficult to debug.
* score: Add _IO_Relax()Sebastian Huber2022-03-241-0/+8
| | | | | | | This function may be used to burn a couple of processor cycles with minimum impact on the system bus. It may be used in busy wait loops. Since it is a global function, it is possible to wrap it in device driver test code.
* cpukit/: Scripted embedded brains header file clean upJoel Sherrill2022-03-1024-144/+0
| | | | Updates #4625.
* cpukit/include/rtems/score/[s-z]*.h: Change license to BSD-2Joel Sherrill2022-02-2853-159/+1166
| | | | Updates #3053.
* cpukit/include/rtems/score/[a-r]*.h: Change license to BSD-2Joel Sherrill2022-02-2850-150/+1100
| | | | Updates #3053.
* kern_ntptime.c: Port to RTEMSSebastian Huber2022-02-211-0/+9
| | | | | | Remove previous adjtime() implementation. Update #2348.
* Remove obsolete rtems_gxx_*() implementationSebastian Huber2022-01-271-2/+2
| | | | | | | | | | | GCC versions prior to 6.1 used a RTEMS thread model based on rtems_gxx_*() functions. GCC version 6.1 or later uses the self-contained synchronization objects of Newlib <sys/lock.h> for the RTEMS thread model. Remove the obsolete implementation. Close #3143.
* Avoid ISR_LOCK_MEMBER() since it confuses DoxygenSebastian Huber2021-12-094-5/+11
| | | | | If RTEMS_SMP is not defined, then Doxygen adds the comments intended for conditional the lock member to the next member.
* score: Fix _Workspace_Initialize_for_one_area()Sebastian Huber2021-12-071-14/+20
| | | | | | | In _Workspace_Initialize_for_one_area(), properly check if there is enough free memory available for the configured workspace size. The bug was introduced by commit 3d0620b607ff6459fec9d30efc1e0589bbd010f9.
* score: Fix atomic stores for C++Sebastian Huber2021-12-071-3/+3
| | | | Close #4566.
* score: Optimize Workspace Handler initializationSebastian Huber2021-11-303-10/+244
| | | | | | | | | | | | The BSPs provide memory for the workspace initialization via _Memory_Get(). Most BSPs provide exactly one memory area. Only two BSPs provide more than one memory area (arm/altera-cyclone-v and bsps/powerpc/mpc55xxevb). Only if more than one memory area is provided, there is a need to use _Heap_Extend(). Provide two implementations to initialize the workspace handler and let the BSP select one of the implementations based on the number of provided memory areas. This gets rid of a dependency on _Heap_Extend(). It also avoids dead code sections for most BSPs.
* score: Properly continue the thread during restartSebastian Huber2021-11-232-2/+7
| | | | | | | | | | The _Thread_queue_Extract() does not deal with potential priority updates and the SMP locking protocol handling. Use _Thread_queue_Continue(). For the POSIX signals processing this is currently probably unnecessary, however, the use case is similar to the restart so use the same appoach. Close #4546.
* score: Move _Thread_queue_Extract()Sebastian Huber2021-11-231-1/+6
| | | | | | | Move _Thread_queue_Extract() since this function is not used by the core services (threads, semaphores, mutexes, message queues). Update #4546.
* score: Simplify thread wait state handlingSebastian Huber2021-11-232-12/+9
| | | | | | | | | | Remove the THREAD_WAIT_STATE_READY_AGAIN and simply use the initial value to indicate that a thread does not wait on something. Rename THREAD_WAIT_FLAGS_INITIAL to THREAD_WAIT_STATE_READY. This change is necessary so that _Thread_Continue() can be called for threads which never waited on something (for example dormant threads). Update #4546.
* score: Add _Thread_MP_Extract_proxy()Sebastian Huber2021-11-234-19/+41
| | | | | | | | Remove _Thread_queue_Extract_with_proxy() and move the proxy extraction to _Thread_MP_Extract_proxy(). Move similar code blocks of the previous caller of _Thread_queue_Extract_with_proxy() to helper functions. Update #4546.
* rtems: Fix rtems_scheduler_remove_processor()Sebastian Huber2021-11-231-9/+7
| | | | | | | | | | | | | | | | | | Return an error status for the following error condition in rtems_scheduler_remove_processor(): While an attempt is made to remove a processor from a scheduler, while the processor is the only processor owned by the scheduler, if a thread exists which uses the scheduler as a helping scheduler, then the processor shall not be removed. The reason is that ask for help requests and withdraw node requests are processed asynchronously in any order. An ask for help request carried out on a scheduler without a processor is undefined behaviour. Update error status description. Update #4544.
* score: Fix assertion in SMP scheduler frameworkSebastian Huber2021-11-231-6/+9
| | | | | | Properly assert that the scheduled chain is not empty. Fix formatting. Close #4531.
* score: Rework ask for help requestsSebastian Huber2021-11-234-83/+100
| | | | | | | | Process ask for help requests on the current processor. This avoids using inter-processor interrupts to make the system behaviour a bit more predictable. Update #4531.
* score: _Scheduler_SMP_Schedule_highest_ready()Sebastian Huber2021-11-231-48/+49
| | | | | | | | | Simplify callers of _Scheduler_SMP_Schedule_highest_ready(). Move the node state change and the extraction from scheduled into _Scheduler_SMP_Schedule_highest_ready(). Move the idle thread release to the caller which have more information about the presence of an idle thread. Update #4531.
* score: Remove victim thread from CPU allocationSebastian Huber2021-11-231-60/+53
| | | | Update #4531.
* score: Move _Scheduler_Unblock_node()Sebastian Huber2021-11-232-71/+35
| | | | | | | Move _Scheduler_Unblock_node() into _Scheduler_SMP_Unblock(). This simplifies the code and makes it easier to review. Update #4531.
* score: Move _Scheduler_Block_node()Sebastian Huber2021-11-232-81/+46
| | | | | | | Move _Scheduler_Block_node() into _Scheduler_SMP_Block(). This simplifies the code and makes it easier to review. Update #4531.
* score: Simplify _Scheduler_SMP_Yield()Sebastian Huber2021-11-231-10/+1
| | | | | There is not need to actively ask for help in a yield operation. The helping is already done on demand by the other scheduler operations.
* score: Add node to insert to Chain_Node_orderSebastian Huber2021-11-233-16/+44
| | | | | | This allows to use additional members of the nodes for comparision. Update #4534.
* score: Rework idle handling in SMP schedulersSebastian Huber2021-11-235-466/+427
| | | | | | | | | | | | | | | | | | This patch fixes an issue with the idle thread handling in the SMP scheduler framework used for the MrsP locking protocol. The approach to use a simple chain of unused idle threads is broken for schedulers which support thread to processor affinity. The reason is that the thread to processor affinity introduces another ordering indicator which may under certain conditions lead to a reordering of idle threads in the scheduled chain. This reordering is not propagated to the chain of unused idle threads. This could lead to use an idle thread for a sticky scheduler node which is already in use. This locks up the system in infinite loops in the thread context switch procedure. To fix this, the SMP scheduler implementations must now provide callbacks to get and release an unused idle thread. Update #4531.
* score: Add SMP scheduler make/clean stickySebastian Huber2021-11-2310-77/+378
| | | | | | | | | | | | | | | | | | | | This patch fixes the following broken behaviour: While a thread is scheduled on a helping scheduler, while it does not own a MrsP semaphore, if it obtains a MrsP semaphore, then no scheduler node using an idle thread and the ceiling priority of the semaphore is unblocked for the home scheduler. This could lead to priority inversion issues and is not in line with the MrsP protocol. Introduce two new scheduler operations which are only enabled if RTEMS_SMP is defined. The operations are used to make the scheduler node of the home scheduler sticky and to clean the sticky property. This helps to keep the sticky handing out of the frequently used priority update operation. Close #4532.
* score: Add SMP scheduler idle exchange callbackSebastian Huber2021-11-231-0/+19
| | | | Update #4531.
* score: Rework affine ready queue handlingSebastian Huber2021-11-231-2/+11
| | | | | | | | Rework the handling of the affine ready queue for the EDF SMP scheduler. Do the queue handling in the node insert, move, and extract operations. Remove the queue handling from _Scheduler_EDF_SMP_Allocate_processor(). Update #4531.