summaryrefslogtreecommitdiffstats
path: root/cpukit (unfollow)
Commit message (Collapse)AuthorFilesLines
2021-05-26cpukit/libpci: fix potential buffer overflow in pci_cfg_print_code.cHarrison Edward Gerber1-2/+2
See also CID 1399721 Closes #4442
2021-05-26score/aarch64: Align context validation frameKinsey Moore1-11/+18
Ensure the stack remains aligned by keeping the context frame at a multiple of 16 bytes. This avoids stack alignment exceptions which occur when the stack pointer is not 16 byte aligned.
2021-05-26score: Direct thread dispatch in a self restartSebastian Huber1-5/+11
Commit 73ebf9a27ed5cd0fd3e0dc0da98345d7faa610a2 accidentally removed the direct thread dispatch in a self thread restart. In case of a self restart (always in task context) the directive shall not return. If this is not possible due to a bad thread dispatch disable level, then a fatal error shall occur. Update #4412.
2021-05-26score: Fix _Thread_Cancel()Sebastian Huber1-26/+22
The _Thread_Cancel() (in contrast to _Thread_Restart() which used a similar code block) may have produced ready threads with an active timer in case the thread to cancel had its thread life protection enabled. The problem was this code block: Priority_Control priority; _Thread_Add_life_change_request( the_thread ); if ( _Thread_Is_life_change_allowed( previous ) ) { _Thread_State_release( the_thread, &lock_context ); _Thread_queue_Extract_with_proxy( the_thread ); _Thread_Timer_remove( the_thread ); } else { _Thread_Clear_state_locked( the_thread, STATES_SUSPENDED ); _Thread_State_release( the_thread, &lock_context ); } priority = _Thread_Get_priority( executing ); _Thread_Raise_real_priority( the_thread, priority ); _Thread_Remove_life_change_request( the_thread ); The life change request should only be added/removed if a life change is allowed (see _Thread_Restart()). Add _Thread_Try_life_change_request() and use it in _Thread_Cancel() and _Thread_Restart(). Close #4435.
2021-05-26posix: Allow pthread_cancel() from within ISRsSebastian Huber1-9/+4
Close #4413.
2021-05-26score: Simplify calling _Thread_Exit()Sebastian Huber6-53/+28
Move common code into _Thread_Exit(). This enables a tail call optimization in most cases.
2021-05-26rtems: Return RTEMS_CALLED_FROM_ISRSebastian Huber1-5/+15
If rtems_task_delete() is called from within interrupt context, then return RTEMS_CALLED_FROM_ISR. This makes the behaviour predictable. Update #4414.
2021-05-25sysinit: Do not open console when just referencing reentrancy structure.Joel Sherrill2-6/+21
This change eliminates a system initialization dependentcy which resulted in an application without a file system or console referencing errno being forced to include the code to open(/dev/console), close(), atexit(), and the unmount infrastructure. Closes #4439.
2021-05-20telnetd.c: Remove RTEMS_NETWORKING checkVijay Kumar Banerjee1-10/+1
Set the priority manually to make telnetd compatible with the
2021-05-18score: Simplify thread queue timeout handlingSebastian Huber10-44/+88
Add Thread_queue_Context::timeout_absolute to specify an absolute or relative timeout. This avoid having to get the current time twice for timeouts relative to the current time. It moves also functionality to common code.
2021-05-18posix: Fix use of clock for relative timesSebastian Huber1-13/+18
Close #4426.
2021-05-18score: Add _CPU_Context_switch_no_return()Sebastian Huber9-5/+56
The __builtin_unreachable() cannot be used with current GCC versions to tell the compiler that a function does not return to the caller, see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99151 Add a no return variant of _CPU_Context_switch() to avoid generation of dead code in _Thread_Start_multitasking() if RTEMS was built with SMP support enabled.
2021-05-17score: Move _Thread_queue_Queue_get_name_and_id()Sebastian Huber3-36/+77
Move this diagnostic function to a separate file since it does not provide a core function of the system. Change license to BSD-2-Clause according to file history and re-licensing agreement. Update #3053.
2021-05-17posix: Use RTEMS_POSIX_API in clock_nanosleep()Sebastian Huber1-0/+5
It is only possible to get interrupted by a POSIX signal if RTEMS_POSIX_API is defined.
2021-05-17posix: Move clock_nanosleep()Sebastian Huber3-91/+117
Move clock_nanosleep() to a separate file to avoid a dependency on errno which pulls in the Newlib reentrancy support. This is an issue since most parts which are pulled in cannot be garbage collected by the linker due to the system initialization linker set.
2021-05-17score: Add and use _Per_CPU_Is_ISR_in_progress()Sebastian Huber4-13/+22
Add _Per_CPU_Is_ISR_in_progress() as an optimized version of _ISR_Is_in_progress().
2021-05-17score: Improve parameters in _Thread_Change_life()Sebastian Huber2-22/+29
2021-05-14rtems: Fix task restart within interrupt contextSebastian Huber3-74/+17
rtems_task_restart() may be called from within interrupt context. So checking only that the thread to restart is equal to the executing thread is insufficient to determine a self restart. We have to also check that no ISR is in progress. Merge _Thread_Restart_other() and _Thread_Restart_self() into one _Thread_Restart() since they share a lot of common code. Close #4412.
2021-05-14rtems: Always set the real priority during restartSebastian Huber1-26/+32
Unconditionally set the real priority of the task to its initial priority during a task restart. Close #4411.
2021-05-14score: Return status in _Thread_Restart_other()Sebastian Huber3-12/+16
This simplifies rtems_task_restart().
2021-05-14rtems: Check entry point in rtems_task_start()Sebastian Huber1-0/+4
Close #4410.
2021-05-14rtems: Add TOD_Ticks_validationSebastian Huber2-15/+24
Replace defines with an enum. Update #4406.
2021-05-12rtems: Constify rtems_task_wake_when()Sebastian Huber6-16/+28
Add a parameter to _TOD_Validate() to disable the validation of the ticks member. There are two reasons for this change. Firstly, in rtems_task_wake_when() was a double check for time_buffer == NULL (one in rtems_task_wake_when() and one in _TOD_Validate()). Secondly, the ticks member is ignored by rtems_task_wake_when(). This was done with a write of zero to the ticks member and thus a modification of the user-provided structure. Now the structure is no longer modified. Using a mask parameter is quite efficient. You just have to load an immediate value and there are no additional branches in _TOD_Validate(). Close #4406.
2021-05-12rtems: Document rtems_task_set_scheduler() errorsSebastian Huber1-3/+20
2021-05-12rtems: Clarify rtems_task_get_priority() docSebastian Huber1-2/+2
2021-05-12rtems: Use rtems_clock_get_ticks_per_second()Sebastian Huber1-2/+2
This avoids an integer division at runtime.
2021-05-12_TOD_Validate(): Fix incorrect return codeFrank Kühndel5-40/+51
This patch fixes bug #4403. Directives * rtems_timer_fire_when() * rtems_timer_server_fire_when() * rtems_task_wake_when() are documented to return RTEMS_INVALID_ADDRESS when their time-of-day argument is NULL. But actually they return RTEMS_INVALID_CLOCK. To fix the issue this patch changes _TOD_Validate() to return a status code instead of just true/false. Close #4403
2021-05-11rtems: Use _Objects_Free_nothing() for msg queuesSebastian Huber2-6/+9
Use _Objects_Free_nothing() for rtems_message_queue_construct() to avoid unreachable code in _CORE_message_queue_Close() in case only user-provided message buffers are used. Update #4007.
2021-05-11score: Rename _Stack_Free_nothing()Sebastian Huber7-16/+16
Rename _Stack_Free_nothing() in _Objects_Free_nothing() to make it reusable for the message queue buffers. Update #4007.
2021-05-07rtems: rtems_scheduler_get_processor_set() docsSebastian Huber1-1/+1
Document changed error status. Update #4401.
2021-05-07rtems_scheduler_ident_by_processor_set() docsSebastian Huber1-0/+2
Document new error status.
2021-05-07Check the alignment in posix_memalign() earlierSebastian Huber1-4/+4
Make sure all conditions to do a proper memory allocation are satisfied before a zero size memory allocation is performed. Update #4390.
2021-05-06Return NULL for zero size allocationsSebastian Huber7-8/+30
In POSIX, zero size memory allocations are implementation-defined behaviour. The implementation has two options: https://pubs.opengroup.org/onlinepubs/9699919799/functions/malloc.html https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_memalign.html Linux and FreeBSD return a unique pointer for zero size memory allocations. Return NULL on RTEMS to more likely catch the use of a zero size memory area by erroneous applications. Update #4390.
2021-05-06libc: Reimplement posix_memlign()Sebastian Huber1-7/+22
Move all error checks into posix_memalign() so that the returned memory pointer is set to NULL under all error conditions except memptr == NULL. Use parameter names of POSIX documentation.
2021-05-06rtems: rtems_scheduler_get_processor_set() statusSebastian Huber1-1/+1
In case the processor set is not large enough to contain the processor set owned by the scheduler return RTEMS_INVALID_SIZE instead of RTEMS_INVALID_NUMBER. This is more in line with other directives since the issue is related to the size of an object. Close #4401.
2021-05-06rtems: rtems_scheduler_ident_by_processor_set()Sebastian Huber1-0/+4
Check for a NULL processor set pointer.
2021-05-05stackchk: Fixed 32bit pointersStephen Clark1-1/+2
Using 32bit types like uint32_t for pointers creates issues on 64 bit architectures like AArch64. Replaced occurrences of these with uintptr_t, which will work for both 32 and 64 bit architectures.
2021-05-05rtems-fdt: Fixed 32bit pointersStephen Clark1-2/+2
Using 32bit types like uint32_t for pointers creates issues on 64 bit architectures like AArch64. Replaced occurrences of these with uintptr_t, which will work for both 32 and 64 bit architectures.
2021-05-04score: Make _Once_Lock() and _Once_Unlock() staticSebastian Huber2-32/+16
These two functions are no longer used outside of _Once().
2021-05-04rtems: Use allocator mutex for timer serverSebastian Huber1-4/+2
The allocator mutex is recursive and already used for the task creation in rtems_timer_initiate_server(). Just use this mutex instead of the once mutex to serialize the initialization. This avoids a dependency on condition variables which are not used here.
2021-05-04Make zero size allocation result consistentSebastian Huber3-14/+4
The zero size allocations had no consistent behaviour in RTEMS. For example, malloc( 0 ) returned NULL and posix_memalign( &p, align, 0 ) returned in p a unique pointer (or NULL if no memory is available). In POSIX, zero size memory allocations are implementation-defined behaviour. The implementation has two options: https://pubs.opengroup.org/onlinepubs/9699919799/functions/malloc.html https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_memalign.html Linux and FreeBSD return a unique pointer for zero size memory allocations. Use this approach for RTEMS as well throughout the memory allocation directives Close #4390.
2021-05-03libtest: Fix use of flexible array memberSebastian Huber2-20/+22
Flexible array members must not appear in the middle of a structure.
2021-05-02score: Add _Thread_Dispatch_direct_no_return()Sebastian Huber5-4/+18
The __builtin_unreachable() cannot be used with current GCC versions to tell the compiler that a function does not return to the caller, see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99151 Add a no return variant of _Thread_Dispatch_direct() to avoid generation of dead code.
2021-04-30basedefs: Add RTEMS_NOINITSebastian Huber1-16/+26
Update #3866.
2021-04-30Use alias for rtems_task_self() and pthread_self()Sebastian Huber5-62/+61
This may reduce the code size a bit.
2021-04-30appl-config: Add missing "the"Sebastian Huber1-11/+10
2021-04-30appl-config: CONFIGURE_BSP_PREREQUISITE_DRIVERSSebastian Huber1-2/+2
Replace copy and paste with a proper description.
2021-04-30appl-config: Reformat option constraintsSebastian Huber1-120/+209
If only one constraint is present, then use a single sentence, otherwise use a list for the constraints. Format the constraints so that the line length limit is maintained.
2021-04-29cpukit/Makefile.am: Remove remaining LIBNETWORKING filesVijay Kumar Banerjee2-44/+0
2021-04-29main_rtrace.c: Add error return when malloc failsRyan Long1-0/+1
CID 1399709: Dereference after null check in rtems_trace_buffering_shell_save(). Closes #4329