summaryrefslogtreecommitdiffstats
path: root/cpukit/score (follow)
Commit message (Collapse)AuthorAgeFilesLines
* score: Fix context switch extensions (SMP)Sebastian Huber2020-02-284-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In uniprocessor and SMP configurations, the context switch extensions were called during _Thread_Do_dispatch(): void _Thread_Do_dispatch( Per_CPU_Control *cpu_self, ISR_Level level ) { Thread_Control *executing; executing = cpu_self->executing; ... do { Thread_Control *heir; heir = _Thread_Get_heir_and_make_it_executing( cpu_self ); ... _User_extensions_Thread_switch( executing, heir ); ... _Context_Switch( &executing->Registers, &heir->Registers ); ... } while ( cpu_self->dispatch_necessary ); ... } In uniprocessor configurations, this is fine and the context switch extensions are called for all thread switches except the very first thread switch to the initialization thread. However, in SMP configurations, the context switch may be invalidated and updated in the low-level _Context_Switch() routine. See: https://docs.rtems.org/branches/master/c-user/symmetric_multiprocessing_services.html#thread-dispatch-details In case such an update happens, a thread will execute on the processor which was not seen in the previous call of the context switch extensions. This can confuse for example event record consumers which use events generated by a context switch extension. Fixing this is not straight forward. The context switch extensions call must move after the low-level context switch. The problem here is that we may end up in _Thread_Handler(). Adding the context switch extensions call to _Thread_Handler() covers now also the thread switch to the initialization thread. We also have to save the last executing thread (ancestor) of the processor. Registers or the stack cannot be used for this purpose. We have to add it to the per-processor information. Existing extensions may be affected, since now context switch extensions use the stack of the heir thread. The stack checker is affected by this. Calling the thread switch extensions in the low-level context switch is difficult since at this point an intermediate stack is used which is only large enough to enable servicing of interrupts. Update #3885.
* score: Fix label defined but not used warningSebastian Huber2020-02-251-0/+2
| | | | Update #3835.
* score: _Scheduler_Is_non_preempt_mode_supported()Sebastian Huber2020-02-251-1/+4
| | | | | | | | If the non-preempt mode for threads is supported depends on the scheduler implementation. Add _Scheduler_Is_non_preempt_mode_supported() to indicate this. Update #3876.
* score: Add _SMP_Need_inter_processor_interrupts()Sebastian Huber2020-02-252-2/+2
| | | | | | | Test for the proper system condition instead of using the rtems_configuration_is_smp_enabled() workaround. Update #3876.
* config: Add _Workspace_Is_unifiedSebastian Huber2020-02-251-0/+34
| | | | | | | | | Move the unified workspace configuration constant out of the configuration table. Provide a default definition of the unified workspace constant. Update #3875.
* config: Add _Thread_Idle_bodySebastian Huber2020-02-252-2/+36
| | | | | | | | | Move the idle thread body configuration constant out of the configuration table. Provide a default definition of the idle thread body constant. Update #3875.
* config: Add _Thread_Idle_stack_sizeSebastian Huber2020-02-251-1/+2
| | | | | | | | | | Move the idle thread stack size configuration constant out of the configuration table. Add THREAD_IDLE_STACK_SIZE_DEFAULT and use it to provide a default definition of the idle thread stack size constant. Update #3875.
* config: Add _Watchdog_Ticks_per_timesliceSebastian Huber2020-02-251-0/+35
| | | | | | | | | | Move the ticks per timeslice configuration constant out of the configuration table. Add WATCHDOG_TICKS_PER_TIMESLICE_DEFAULT and use it to provide a default definition of the watchdog ticks per timeslice constant. Update #3875.
* score: Clean up wkspace.cSebastian Huber2020-02-171-39/+3
| | | | | | | Remove DEBUG_WORKSPACE support. There are better ways to trace the application. See Tracing chapter in the RTEMS User Manual. Remove superfluous includes. Change format.
* score: Remove unused _Workspace_Allocate_aligned()Sebastian Huber2020-02-171-5/+0
|
* score: Simplify _Thread_Initialize()Sebastian Huber2020-02-122-9/+74
| | | | | | | | Allocate new thread queue heads during objects information extend. This removes an error case and the last dependency on the workspace in _Thread_Initialize(). Update #3835.
* score: Add _Objects_Allocate_with_extend()Sebastian Huber2020-02-121-26/+10
| | | | Update #3835.
* score: Add _Objects_Activate_unlimited()Sebastian Huber2020-02-121-12/+1
| | | | Update #3835.
* score: Add _Freechain_Extend()Sebastian Huber2020-02-121-8/+25
| | | | Update #3835.
* score: _Objects_Extend_information()Sebastian Huber2020-02-121-15/+6
| | | | | | | Return block index in _Objects_Extend_information(). This allows to customize the objects information extend. Update #3835.
* score: Inline _Objects_Namespace_remove_u32()Sebastian Huber2020-02-121-9/+0
| | | | | | This function is simple enough to be inlined. Update #3835.
* score: Split up objects freeSebastian Huber2020-02-122-4/+48
| | | | | | | | Split up the different objects free methods into separate functions. This helps to avoid a dependency on the workspace in case no objects or a static set of objects is configured. Update #3835.
* score: Split up objects allocationSebastian Huber2020-02-124-74/+195
| | | | | | | | | | | Split up the different objects allocation methods into separate functions. This helps to avoid a dependency on the workspace in case no objects or a static set of objects is configured. Change license to BSD-2-Clause according to file histories. Update #3053. Update #3835.
* score: Add _Objects_Free_objects_block()Sebastian Huber2020-02-121-39/+53
| | | | | | | This is a preparation to allow a customization of the objects information extend. Update #3835.
* score: Statically allocate idle/MPCI stacksSebastian Huber2020-02-123-10/+16
| | | | | | | Place idle and MPCI stacks into extra linker sections. This can be optionally used by applications to control the placement of the stacks. Update #3835.
* score: Move thread stack allocationSebastian Huber2020-02-123-43/+47
| | | | | | Move thread stack allocation to caller side of _Thread_Initialize(). Update #3835.
* score: Add _Stack_Extend_size()Sebastian Huber2020-02-121-10/+3
| | | | Update #3835.
* score: Add Thread_ConfigurationSebastian Huber2020-02-123-77/+67
| | | | | | | | | Add the Thread_Configuration structure to reduce the parameter count of _Thread_Initialize(). This makes it easier to add more parameters in the future. It simplifies the code generation since most architectures do not have that many registers available for function parameters. Update #3835.
* score: Split stack allocator configurationSebastian Huber2020-02-121-0/+41
| | | | | | This allows the linker garbage collection to perform its work. Update #3835.
* score: Simplify TLS area allocationSebastian Huber2020-02-125-55/+141
| | | | | | Use the stack area to allocate the TLS area. Update #3835.
* score: Simplify FP context allocationSebastian Huber2020-02-122-24/+17
| | | | | | | | | | | Use the stack area to allocate the FP context. This considerably simplifies the application configuration since the task count no longer influences the configured work space size. With this change the stack space size is overestimated since an FP context for each thread is accounted. Memory constraint applications can use the stack size for fine tuning. Update #3835.
* score: Remove _Stack_Ensure_minimum() callSebastian Huber2020-02-121-2/+1
| | | | | | This call is superfluous since _Thread_Initialize() will do this also. Update #3835.
* score: Simplify thread stack freeSebastian Huber2020-02-123-44/+18
| | | | Update #3835.
* score: Simplify thread stack allocationSebastian Huber2020-02-122-38/+19
| | | | | | Remove superfluous Thread_Control::Start::stack member. Update #3835.
* score: Remove superfluous FP types/definesSebastian Huber2020-02-1210-795/+33
| | | | Update #3835.
* config: Add CONFIGURE_DIRTY_MEMORYSebastian Huber2020-02-061-0/+37
| | | | | | | Replace the BSP_DIRTY_MEMORY BSP option with a CONFIGURE_DIRTY_MEMORY configuration option. Update #3843.
* sysinit: Add RTEMS_SYSINIT_ZERO_MEMORYSebastian Huber2020-02-063-6/+71
| | | | | | | | Use a dedicate system initialization step to zero the memory used for the workspace and C program heap. This avoids dead code in case CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY is not configured.
* bsps: Rework work area initializationSebastian Huber2020-02-042-101/+64
| | | | | | | | | | | | | | | | | | | | The work area initialization was done by the BSP through bsp_work_area_initialize(). This approach predated the system initialization through the system initialization linker set. The workspace and C program heap were unconditionally initialized. The aim is to support RTEMS application configurations which do not need the workspace and C program heap. In these configurations, the workspace and C prgram heap should not get initialized. Change all bsp_work_area_initialize() to implement _Memory_Get() instead. Move the dirty memory, sbrk(), per-CPU data, workspace, and malloc() heap initialization into separate system initialization steps. This makes it also easier to test the individual initialization steps. This change adds a dependency to _Heap_Extend() to all BSPs. This dependency will be removed in a follow up change. Update #3838.
* score: Add _Memory_Fill()Sebastian Huber2020-02-041-0/+48
| | | | Update #3838.
* score: Add Memory HandlerSebastian Huber2020-02-041-0/+67
| | | | Update #3838.
* score: Optimize per-processor data placementSebastian Huber2020-02-011-1/+8
| | | | Only align per-processor data in SMP configurations.
* mpci: Fix blocking proxy statusSebastian Huber2020-01-021-1/+1
| | | | | Remove THREAD_STATUS_PROXY_BLOCKING and replace it with STATUS_PROXY_BLOCKING.
* score: Fix objects node initializationSebastian Huber2020-01-021-0/+1
| | | | | | | The objects node is statically initialized to one. Clear the node field before it is set. Update #3621.
* score: Remove _Workspace_Allocate_or_fatal_error()Sebastian Huber2019-12-131-23/+0
| | | | | | This function is unused. Update #3735.
* config: Statically allocate MP object controlsSebastian Huber2019-12-132-5/+5
| | | | Update #3735.
* config: Statically allocate MP thread proxiesSebastian Huber2019-12-132-5/+4
| | | | Update #3735.
* config: Add _MPCI_ConfigurationSebastian Huber2019-12-134-27/+38
| | | | | | | Replace the user MPCI configuration table with a system provided _MPCI_Configuration. Update #3735.
* Add TOD Hooks to allow BSP to take action when TOD is setJoel Sherrill2019-12-115-1/+248
| | | | | | | | | | | | Two use cases were envisioned for this. 1) a BSP or application which desires to update a real-time clock when the RTEMS TOD is set. 2) a paravirtualized BSP can use this to propagate setting the time in an RTEMS application to the hosting environment. This enables the entire set of applications in the virtualized environments to have a single consistent TOD.
* userext: Simplify configurationSebastian Huber2019-12-092-18/+10
| | | | | Avoid the use of the workspace and use statically allocated switch controls for the initial extensions.
* Regenerate headers.amSebastian Huber2019-11-291-0/+1
|
* riscv: preliminarily support for libdlHesham Almatary2019-11-121-0/+144
| | | | Support for targets compiled with -fno-pic and -mno-relax
* heap: Simplify _Heap_Block_allocate()Sebastian Huber2019-11-051-24/+24
| | | | Determine the next block only once and use it throughout.
* rtems-5: Improve heap fatal error informationsebastian.huber2019-11-053-8/+18
| | | | Update #3806.
* arm: Add defines for small pages MMUSebastian Huber2019-10-311-0/+57
|
* score: Install timecounter according to qualitySebastian Huber2019-10-021-0/+2
| | | | | | This makes it possible to install higher quality timecounter in plug-and-play systems and helps to override the clock driver provided timecounter in some test scenarios.