| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, the AArch64 BSPs have a hard time running on real hardware
without building the toolchain and the bsps with -mstrict-align in
multiple places. Configuring the MMU on these chips allows for unaligned
memory accesses for non-device memory which avoids requiring strict
alignment in the toolchain and in the BSPs themselves.
In writing this driver, it was found that the synchronous exception
handling code needed to be rewritten since it relied on clearing SCTLR_EL1 to
avoid thread stack misalignments in RTEMS_DEBUG mode. This is now
avoided by exactly preserving thread mode stack and flags and the new
implementation is compatible with the draft information provided on the
mailing list covering the Exception Management API.
|
|
|
|
|
| |
Break out system register definitions and accessors so that they're
usable by other parts of RTEMS.
|
|
|
|
| |
Update #4414.
|
|
|
|
|
|
| |
See also CID 1399721
Closes #4442
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Close #4413.
|
|
|
|
|
| |
Move common code into _Thread_Exit(). This enables a tail call
optimization in most cases.
|
|
|
|
|
|
|
| |
If rtems_task_delete() is called from within interrupt context, then
return RTEMS_CALLED_FROM_ISR. This makes the behaviour predictable.
Update #4414.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Set the priority manually to make telnetd compatible with the
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Close #4426.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
It is only possible to get interrupted by a POSIX signal if
RTEMS_POSIX_API is defined.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Add _Per_CPU_Is_ISR_in_progress() as an optimized version of
_ISR_Is_in_progress().
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
Unconditionally set the real priority of the task to its initial
priority during a task restart.
Close #4411.
|
|
|
|
| |
This simplifies rtems_task_restart().
|
|
|
|
| |
Close #4410.
|
|
|
|
|
|
| |
Replace defines with an enum.
Update #4406.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
| |
This avoids an integer division at runtime.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
Rename _Stack_Free_nothing() in _Objects_Free_nothing() to make it
reusable for the message queue buffers.
Update #4007.
|
|
|
|
|
|
| |
Document changed error status.
Update #4401.
|
|
|
|
| |
Document new error status.
|
|
|
|
|
|
|
| |
Make sure all conditions to do a proper memory allocation are satisfied
before a zero size memory allocation is performed.
Update #4390.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Check for a NULL processor set pointer.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
These two functions are no longer used outside of _Once().
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Flexible array members must not appear in the middle of a structure.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Update #3866.
|
|
|
|
| |
This may reduce the code size a bit.
|
| |
|