summaryrefslogtreecommitdiffstats
path: root/cpukit/include/rtems/score (follow)
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* score: Use extract from scheduled callbacksSebastian Huber2021-11-231-5/+20
| | | | | | | Use the extract from scheduled callback provided by the scheduler implementation in the SMP scheduler framework. Update #4531.
* score: Remove return value from enqueue scheduledSebastian Huber2021-11-231-26/+30
| | | | | | The return value was unused. Remove it. Update #4531.
* score: Scheduler insert after moveSebastian Huber2021-11-231-5/+5
| | | | | | | | Insert nodes after moving the second node to reduce the items in the data structure for the insert operation. This also avoids having two nodes for the same processor inserted into the scheduled chain. Update #4531.
* score: Add missing idle thread exchangesSebastian Huber2021-11-231-0/+18
| | | | Update #4531.
* score: Add missing idle thread releasesSebastian Huber2021-11-231-0/+12
| | | | Update #4531.
* score: Simplify _Scheduler_Exchange_idle_thread()Sebastian Huber2021-11-232-17/+11
| | | | | | Remove superfluous idle parameter. Update #4531.
* score: Change _Scheduler_Try_to_schedule_node()Sebastian Huber2021-11-232-6/+6
| | | | | | Add the victim node as parameter instead of the idle thread. Update #4531.
* score: Not set CPU in _Scheduler_Use_idle_thread()Sebastian Huber2021-11-231-14/+8
| | | | | | | | Do not set the CPU of the idle thread in _Scheduler_Use_idle_thread(). This helps to use _Scheduler_Try_to_schedule_node() under more general conditions in the future, for example in case the owner and user of a node are not the same. Update #4531.
* score: Rename _Scheduler_Set_idle_thread()Sebastian Huber2021-11-232-22/+23
| | | | | | | Rename _Scheduler_Set_idle_thread() in _Scheduler_Node_set_idle_user() and move it to <rtems/score/schedulernodeimpl.h>. Update #4531.
* score: Add red-black tree append/prependSebastian Huber2021-11-231-0/+26
| | | | | | | These functions are a faster alternative to _RBTree_Insert_inline() if it is known that the new node is the maximum/minimum node. Update #4531.
* score: Simplify _Scheduler_Generic_block()Sebastian Huber2021-11-231-1/+1
| | | | | | If we block the executing thread and it is not the heir thread, then there is no need to run the schedule operation. The scheduler already selected a new heir.
* cpukit: Enable debug for SMP AArch64Kinsey Moore2021-11-221-9/+22
| | | | | | | Ensure when both RTEMS_DEBUG is specified and pointers are large that enough space is allocated to accomodate the Per_CPU_Control structure. This changes the calculation to be more compositional instead of trying to list out every permutation of options possible.
* score: Fix _CORE_ceiling_mutex_Set_priority()Sebastian Huber2021-11-151-6/+8
| | | | | | | We have to use a second thread queue context to acquire and release the thread wait lock. Close #4356.
* score: Always check if a prio ceiling is definedSebastian Huber2021-11-151-10/+10
| | | | | | | | | | Priority ceiling semaphores (in contrast to MrsP semaphores) have only one priority ceiling which is defined for the home scheduler of the task which created the semaphore. Always check during a semaphore seize that the home scheduler of the calling task is equal to this scheduler. This avoids a scheduler mismatch if the semphore is acquired after the calling thread blocked on the semaphore.
* score: Fix thread pinning assertionsSebastian Huber2021-11-151-2/+2
|
* score: Add _Timecounter_Set_NTP_update_second()Sebastian Huber2021-11-151-1/+23
| | | | | | | Allow the installation of an NTP update second handler which may be used by an NTP service. Update #2348.
* score: Introduce CPU budget operationsSebastian Huber2021-11-1514-129/+155
| | | | | | | | | | | | | | This patch set replaces the CPU budget algorithm enumeration with a set of CPU budget operations which implement a particular CPU budget algorithm. This helps to hide the CPU budget algorithm implementation details from the general thread handling. The CPU budget callouts are turned into CPU budget operations. This slightly reduces the size of the thread control block. All schedulers used the default scheduler tick implementation. The tick scheduler operation is removed and the CPU budget operations are directly used in _Watchdog_Tick() if the executing thread uses a CPU budget algorithm. This is performance improvement for all threads which do not use a CPU budget algorithm (default behaviour).
* cpukit: Add signal mapping supportKinsey Moore2021-10-291-0/+71
| | | | | | This adds a confdef option allowing an application to request mapping machine exceptions to POSIX signals. This is required for some languages such as Ada.
* score: Fix typoSebastian Huber2021-10-251-2/+2
|
* rtems: Fix rate monotonic statisticsSebastian Huber2021-10-253-12/+47
| | | | | | | | | | | | | | | The rate monotonic period statistics were affected by rtems_cpu_usage_reset(). The logic to detect and work around a CPU usage reset was broken. The Thread_Contol::cpu_time_used is changed to contain the processor time used throughout the entire lifetime of the thread. The new member Thread_Contol::cpu_time_used_at_last_reset is added to contain the processor time used at the time of the last reset through rtems_cpu_usage_reset(). This decouples the resets of the CPU usage and the rate monotonic period statistics. Update #4528.
* score: Simplify _Watchdog_Next_first()Sebastian Huber2021-10-251-19/+36
|
* Add support for IDLE Thread stack allocatorJoel Sherrill2021-10-111-0/+24
| | | | | | | | Add a stack allocator hook specifically for allocation of IDLE thread stacks. This allows the user to decide if IDLE thread stacks are statically allocated or handled by the same custom allocator mechanism as other thread stacks. Closes #4524.
* score: Always check queue in _Thread_Wait_cancel()Sebastian Huber2021-10-061-2/+2
| | | | | | Commit 18c8a270c296addff87f96b8c248f27eba31c24f removed _Thread_queue_Do_nothing_extract() so we have to check for a non-NULL queue in all configurations.
* score: Optimize EDF SMP scheduler opsSebastian Huber2021-10-061-1/+1
| | | | | | | The schedule operation is only called by rtems_task_mode(). It is called if preempt mode of the executing thread changes from disabled to enabled. Since the EDF SMP scheduler does not support the disabled preemption mode, the schedule operation is never called.
* scoe: Move workspace group definitionSebastian Huber2021-10-062-10/+10
| | | | | | Define the group in the header file which is used by <rtems/confdefs.h>. Update #3706.
* score: Add Hash Handler to groupSebastian Huber2021-10-061-0/+2
| | | | Update #3706.
* score: Add Thread_queue_Deadlock_statusSebastian Huber2021-10-011-11/+39
| | | | | | Replace the boolen return value with the new enum Thread_queue_Deadlock_status. This improves the code readability. Improve documentation. Shorten function names.
* score: Regenerate <rtems/score/basedefs.h>Sebastian Huber2021-09-301-1/+1
| | | | Reflect renamed specification item.
* score: Remove unused default scheduler opsSebastian Huber2021-09-211-46/+13
| | | | | | | | | | If SMP support is enabled and the system has exactly one processor, then it may use an uniprocessor scheduler. The ask for help, reconsider help request, and withdraw node operations can be NULL in this case, since they are only used if a thread has at least one helping scheduler node. At least two schedulers are required to get a helping node and each scheduler involved must own at least one processor. This is not possible on a system with exactly one processor.