summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Remove *_Is_null() inline functionsSebastian Huber2020-10-141-3/+4
| | | | Simply compare the values against NULL.
* Decouple the C Program Heap initializationSebastian Huber2020-10-012-0/+91
| | | | | | | Before this patch RTEMS_Malloc_Initialize() had a fixed dependency on _Workspace_Area. Introduce _Workspace_Malloc_initializer to have this dependency only if CONFIGURE_UNIFIED_WORK_AREAS is defined by the application configuration.
* rtems: Add rtems_message_queue_construct()Sebastian Huber2020-09-283-9/+68
| | | | | | | | | | | In contrast to message queues created by rtems_message_queue_create(), the message queues constructed by this directive use a user-provided message buffer storage area. Add RTEMS_MESSAGE_QUEUE_BUFFER() to define a message buffer type for message buffer storage areas. Update #4007.
* score: Simplify CORE_message_queue_BufferSebastian Huber2020-09-284-23/+24
| | | | | | | | | | Merge CORE_message_queue_Buffer structure into CORE_message_queue_Buffer_control. Use a zero-length array for the actual message buffer. This reduces the structure size on all targets. Update #4007.
* score: Improve _CORE_message_queue_Initialize()Sebastian Huber2020-09-281-5/+5
| | | | | | Return a status code and differentiate between error conditions. Update #4007.
* score: Gather message queue control initializationSebastian Huber2020-09-281-16/+11
| | | | | | | Initialize the structure in a single code block after the error checks and calculations. Update #4007.
* score: Fix allocation size calculationSebastian Huber2020-09-281-51/+23
| | | | | | | | | | The previous multiplication error check is broken on 64-bit machines. Use the recommended check from SEI CERT C Coding Standard, "INT30-C. Ensure that unsigned integer operations do not wrap". Make sure the message size computation does not overflow. Update #4007.
* score: Use RTEMS_ALIGN_UP()Sebastian Huber2020-09-281-3/+4
| | | | Update #4007.
* CONFIGURE_MAXIMUM_THREAD_LOCAL_STORAGE_SIZESebastian Huber2020-09-171-3/+13
| | | | | | | | | | | Add this application configuration option. This configuration option can be used to reserve space for the dynamic linking of modules with thread-local storage objects. Add RTEMS_TASK_STORAGE_ALIGNMENT to define the minium alignment of a thread-local storage size. Update #4074.
* score: Fix _Thread_Initialize()Sebastian Huber2020-09-111-5/+6
| | | | | | Fix an error cleanup path in SMP configurations to avoid a NULL pointer access. Update #3959.
* score: Add stack free handler to TCBSebastian Huber2020-08-313-17/+60
| | | | | | | This avoids a dependency to the stack free function in the thread destruction. Update #3959.
* score: Move _Stack_Allocator_free to separate fileSebastian Huber2020-08-312-2/+35
| | | | | | This decouples the task stack allocation from the deallocation. Update #3959.
* score: Add _Stack_Allocator_do_initialize()Sebastian Huber2020-08-313-21/+63
| | | | | | | | Do the stack allocator initialization and sanity check only if a user-provided stack allocator was configured. This avoids a dependency of _Thread_Handler_initialization() on the stack allocator. Update #3959.
* score: Use _Freechain_Push()Sebastian Huber2020-08-312-2/+2
| | | | | | The nodes are never NULL. Update #3959.
* score: Add <rtems/score/freechainimpl.h>Sebastian Huber2020-08-315-1/+5
| | | | | | Hide implementation details. Update #3959.
* score: Add _Freechain_Push()Sebastian Huber2020-08-311-2/+1
| | | | Update #3959.
* score: Fix debug assertSebastian Huber2020-08-311-4/+12
| | | | | Do not access executing->current_state outside the protection of the thread state lock. Add missing state with a comment.
* score: Optimize _Objects_Name_to_id_u32()Sebastian Huber2020-08-312-3/+2
| | | | | | | Remove the superfluous invalid name check since the object creation directives ensure that objects with such a name cannot exist. Also finding an object with such a name would be no catastrophy if it really exists.
* rtems: Add _RTEMS_Name_to_id()Sebastian Huber2020-08-311-2/+2
| | | | | | | | | | Simplify object name to identifier directives. Using _RTEMS_Name_to_id() to implement the directives enables a tail call optimization. Change license to BSD-2-Clause according to file history. Update #3053.
* score: Constify objects name to id functionsSebastian Huber2020-08-312-9/+9
|
* score: Fix set but not used warningSebastian Huber2020-08-211-1/+1
|
* score: Add CPU_USE_LIBC_INIT_FINI_ARRAYKinsey Moore2020-06-301-2/+6
| | | | | | | | This introduces the CPU_USE_LIBC_INIT_FINI_ARRAY define for use by CPU ports to determine which global constructor and destructor methods are used instead of placing architecture defines where they shouldn't be. Close #4018
* doxygen: Switch @brief and @ingroupSebastian Huber2020-04-2833-33/+66
| | | | This order change fixes the Latex documentation build via Doxygen.
* Canonicalize config.h includeSebastian Huber2020-04-16224-269/+269
| | | | | | | | Use the following variant which was already used by most source files: #ifdef HAVE_CONFIG_H #include "config.h" #endif
* score: Check time of day in _TOD_Set()Sebastian Huber2020-04-141-1/+20
| | | | Close #3949.
* score: Return status in _TOD_Set()Sebastian Huber2020-04-142-19/+23
| | | | Update #3949.
* Revert "score: Fix _ISR_Stack_area_end"Sebastian Huber2020-04-051-36/+0
| | | | | This reverts commit 8e80876bdd54e36fb668eee655eec1dd588daf13 which broke several architectures.
* score: Fix _ISR_Stack_area_endSebastian Huber2020-04-031-0/+36
| | | | | | | | | | The _ISR_Stack_area_begin and _ISR_Stack_area_end symbols are in different sections. They must have the same alignment, otherwise the following linker directive could separate them: *(SORT_BY_ALIGNMENT (SORT_BY_NAME (.rtemsstack*))) Update #3799.
* score: Add _IO_Base64()Sebastian Huber2020-03-161-0/+82
| | | | Update #3904.
* 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.