Commit Graph

34279 Commits

Author SHA1 Message Date
Sebastian Huber
57be57c799 score: Return status in _Thread_Restart_other()
This simplifies rtems_task_restart().
2021-05-14 09:37:19 +02:00
Sebastian Huber
b87d2a6364 rtems: Check entry point in rtems_task_start()
Close #4410.
2021-05-14 09:20:26 +02:00
Sebastian Huber
410317ae3a validation: Add INVALID_ID to tx-support.h 2021-05-14 08:50:10 +02:00
Sebastian Huber
bc29c7c313 validation: Add support library
Add a library for support functions used by validation tests.  Rename
tc-support.* to tx-support.* since this file does not contain test
cases.
2021-05-14 08:48:38 +02:00
Sebastian Huber
45a3495325 rtems: Add TOD_Ticks_validation
Replace defines with an enum.

Update #4406.
2021-05-14 08:09:34 +02:00
Sebastian Huber
523867de9d rtems: Constify rtems_task_wake_when()
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-12 21:25:37 +02:00
Sebastian Huber
6136918ddf rtems: Document rtems_task_set_scheduler() errors 2021-05-12 21:08:12 +02:00
Sebastian Huber
51f7a82f08 rtems: Clarify rtems_task_get_priority() doc 2021-05-12 21:07:54 +02:00
Sebastian Huber
e3bec23d4d rtems: Use rtems_clock_get_ticks_per_second()
This avoids an integer division at runtime.
2021-05-12 06:41:10 +02:00
Frank Kühndel
3af2dc7802 _TOD_Validate(): Fix incorrect return code
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-12 06:41:10 +02:00
Sebastian Huber
c2687666b1 rtems: Use _Objects_Free_nothing() for msg queues
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-11 07:45:58 +02:00
Sebastian Huber
ab5aeb1be1 score: Rename _Stack_Free_nothing()
Rename _Stack_Free_nothing() in _Objects_Free_nothing() to make it
reusable for the message queue buffers.

Update #4007.
2021-05-11 07:45:58 +02:00
Sebastian Huber
6822af7579 rtems: rtems_scheduler_get_processor_set() docs
Document changed error status.

Update #4401.
2021-05-07 08:08:35 +02:00
Sebastian Huber
2146d347ab rtems_scheduler_ident_by_processor_set() docs
Document new error status.
2021-05-07 08:08:24 +02:00
Sebastian Huber
9f727f9379 validation: Fix handling of N/A pre-conditions
In the action requirements, some pre-conditions are not applicable
depending on the state of other pre-conditions.  There is no particular
order in the pre-conditions, so we have to check the N/A status
individually.
2021-05-07 07:44:07 +02:00
Sebastian Huber
c46d125569 Check the alignment in posix_memalign() earlier
Make sure all conditions to do a proper memory allocation are satisfied
before a zero size memory allocation is performed.

Update #4390.
2021-05-07 07:08:04 +02:00
G S Niteesh Babu
b391affc36 bsps/shared/ofw: Fix coverity defects
This patch adds asserts to fix coverity defects
1) CID 1474437 (Out-of-bounds access)
2) CID 1474436 (Out-of-bounds access)

From manual inspection, out of bounds access cannot occur due to
bounds checking but coverity fails to detect the checks.
We are adding asserts as a secondary check.
2021-05-06 16:44:38 -06:00
Sebastian Huber
2c5199bb04 Return NULL for zero size allocations
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-06 08:03:58 +02:00
Sebastian Huber
5580b93f36 libc: Reimplement posix_memlign()
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-06 08:03:58 +02:00
Sebastian Huber
48898b3a5d rtems: rtems_scheduler_get_processor_set() status
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-06 08:03:58 +02:00
Sebastian Huber
3f0c0bfe9a rtems: rtems_scheduler_ident_by_processor_set()
Check for a NULL processor set pointer.
2021-05-06 07:23:11 +02:00
Stephen Clark
e5590a3ea1 psxtests: Fix math function build warnings
Added conditionals to ensure that long double function tests were only
built when newlib has long double math functions.
2021-05-05 09:45:56 -05:00
Stephen Clark
cd5fd85730 stackchk: Fixed 32bit pointers
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-05 09:45:56 -05:00
Stephen Clark
ca02143321 rtems-fdt: Fixed 32bit pointers
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-05 09:45:56 -05:00
Sebastian Huber
3e16f1a6e2 score: Make _Once_Lock() and _Once_Unlock() static
These two functions are no longer used outside of _Once().
2021-05-04 09:37:06 +02:00
Sebastian Huber
024d4eaa2f rtems: Use allocator mutex for timer server
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-04 09:37:06 +02:00
Sebastian Huber
d692c62dfb Make zero size allocation result consistent
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-04 09:37:06 +02:00
Sebastian Huber
eb7c33add0 bsps/riscv: Support RTEMS_NOINIT in linkcmds
Update #3866.
2021-05-03 14:05:19 +02:00
Sebastian Huber
5b97821bc8 libtest: Fix use of flexible array member
Flexible array members must not appear in the middle of a structure.
2021-05-03 06:58:53 +02:00
Sebastian Huber
1eb6cdde60 score: Add _Thread_Dispatch_direct_no_return()
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-05-02 18:41:26 +02:00
Sebastian Huber
2df95414a7 spmisc01: Test RTEMS_NOINIT
Close #3866.
2021-05-02 18:41:26 +02:00
Sebastian Huber
e10dec0fe7 bsps: Support RTEMS_NOINIT in linkcmds
Update #3866.
2021-05-02 18:41:21 +02:00
Sebastian Huber
a84bf966b5 basedefs: Add RTEMS_NOINIT
Update #3866.
2021-04-30 15:47:03 +02:00
Sebastian Huber
8b15a3242e Use alias for rtems_task_self() and pthread_self()
This may reduce the code size a bit.
2021-04-30 07:56:28 +02:00
Sebastian Huber
09063212d4 appl-config: Add missing "the" 2021-04-30 07:20:52 +02:00
Sebastian Huber
901136e7c1 appl-config: CONFIGURE_BSP_PREREQUISITE_DRIVERS
Replace copy and paste with a proper description.
2021-04-30 07:20:52 +02:00
Sebastian Huber
eefe7009bb appl-config: Reformat option constraints
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-30 07:20:52 +02:00
Vijay Kumar Banerjee
8e4f5782eb cpukit/Makefile.am: Remove remaining LIBNETWORKING files 2021-04-29 10:28:39 -06:00
Ryan Long
8cf30c41d9 main_rtrace.c: Add error return when malloc fails
CID 1399709: Dereference after null check in
rtems_trace_buffering_shell_save().

Closes #4329
2021-04-29 09:48:00 -05:00
Ryan Long
cdf66529fd objectextendinformation.c: Ensure information->object_blocks is not NULL
CID 26033: Dereference after null check in _Objects_Extend_information().

Closes #4326
2021-04-29 09:48:00 -05:00
Ryan Long
a70d60aff7 pwdgrp.c: Removed unused variable
The 'sc' variable was originally storing the return value of mkdir().
This was causing an issue, so it was changed to make it to where we
ignored the return value with (void). The 'sc' variable was left in
by mistake.
2021-04-29 08:23:22 -05:00
Sebastian Huber
263e00b26a bsps/arm: ARMV7_CP15_START_WORKSPACE_ENTRY_INDEX
Change the ARMV7_CP15_START_WORKSPACE_ENTRY_INDEX value to be in line
with the workspace entry in ARMV7_CP15_START_DEFAULT_SECTIONS.

Close #4395.
2021-04-29 13:42:24 +02:00
Ryan Long
fe3e05ffca psx13: Reworked and relicensed
Changed the way the tests were structured, added rtems_test_assert()'s,
updated psx13.scn and the license.

Update #3899
2021-04-28 10:01:04 -05:00
Sebastian Huber
a1679af380 rtems: Generate <rtems/rtems/tasks.h>
Change license to BSD-2-Clause according to file histories and
documentation re-licensing agreement.

Update #3899.
Update #3993.
2021-04-28 07:38:50 +02:00
Sebastian Huber
b3d3186dc7 rtems: Generate <rtems/rtems/region.h>
Change license to BSD-2-Clause according to file histories and
documentation re-licensing agreement.

Update #3899.
Update #3993.
2021-04-28 07:38:50 +02:00
Sebastian Huber
0b9e307f24 rtems: Generate <rtems/rtems/intr.h>
Change license to BSD-2-Clause according to file histories and
documentation re-licensing agreement.

Update #3899.
Update #3993.
2021-04-28 07:38:50 +02:00
Sebastian Huber
278c7daabf rtems: Fix typo "cod" -> "code" 2021-04-28 07:38:29 +02:00
Sebastian Huber
55c6cb1daa rtems: Clarify constraints in documentation 2021-04-28 07:37:56 +02:00
Peter Dufault
f8b91c9503 powerpc/shared/console: "termios" first open sets console baud to 9600
When the PowerPC shared console baud rate starts at anything other than
9600 the termios code will set it to 9600 at the first open.
2021-04-27 16:46:52 -06:00
Peter Dufault
9c13e528a0 powerpc/shared/console: Make console baud rate configurable.
The "powerpc/shared/console" code has the start-up console value fixed
at 9600 baud.  This changes the hard-wired constant "9600" in the code
to the configuration setting "BSP_CONSOLE_BAUD" and adds configuration
support in both the "waf" and the legacy configuration systems.

Note that the VME BSPs beatnik, mvme3100, and mve5100 can be improved
by adding a "mvmexxxx" BSP family. This configuration change, as well
as future configuration changes, could then be made in a "grp.yml" file.
2021-04-27 16:46:48 -06:00