Commit Graph

33527 Commits

Author SHA1 Message Date
eadler
208ebf2099 dd(1): Use a local swapbytes() function.
swab(3) has restrict qualifiers for src and dst.
Avoid relying on undefined overlapping swab behavior.

Obtained From: OpenBSD
2020-08-20 14:03:20 +02:00
Sebastian Huber
79fb53687b spintrcritical23: Fix unused variable warnings 2020-08-20 08:56:28 +02:00
Sebastian Huber
218053d0f1 sp37: Fix unused variable warnings 2020-08-20 08:56:28 +02:00
Aschref Ben Thabet
65e027c9ed psxkey01: Fix configuration
Key_ID array must have the right size, it shall have a value greater
than zero.
Note: In Standard C and C++, zero-size array is not
allowed..
2020-08-20 07:44:33 +02:00
Aschref Ben Thabet
cbfdcba555 Fix -Wchar-subscripts warnings
The argument to the ctype functions must be an int and the value of the
character must be representable as an unsigned char or equal to the
value of the macro EOF. If the argument has any other value, the
behavior is undefined.
2020-08-20 07:44:33 +02:00
Sebastian Huber
05d5772c1c ada: Add missing attributes 2020-08-19 06:48:32 +02:00
Sebastian Huber
593a67f6c8 rtems: Use unique option values
The RTEMS_BARRIER_AUTOMATIC_RELEASE and RTEMS_BINARY_SEMAPHORE options
had the same value.  In order to better detect a misuse of option values
(for example using RTEMS_BINARY_SEMAPHORE for rtems_barrier_create()),
the options should have unique values.

Close #4054.
2020-08-19 06:48:32 +02:00
Sebastian Huber
c728948434 libtest: Add T_push_plan() and T_pop_plan()
Update #3199.
2020-08-18 07:08:51 +02:00
Sebastian Huber
13acd90003 libtest: Use a destructor
Do not set up a new test steps environment.

Update #3199.
2020-08-18 07:08:51 +02:00
Sebastian Huber
72960bc7d4 libtest: Change T_step() and T_assert_step()
Normally, the expected test step must be a compile time constant.  Allow
variable expected test steps for the T_step() and T_assert_step().  This
can be used for parameterized test loops with individual fixtures.

Remove the ability to use custom failure messages due to some
implementation constraints.

Update #3199.
2020-08-18 07:08:51 +02:00
Sebastian Huber
5383d4db04 libtest: Add fixture steps
Support a new test plan for each nested fixture.

Update #3199.
2020-08-18 07:08:51 +02:00
Sebastian Huber
33eb113c36 libtest: Add T_check_steps()
Update #3199.
2020-08-18 07:08:51 +02:00
Sebastian Huber
cbc1ba341d libtest: Use line buffer in T_check()
Update #3199.
2020-08-18 07:08:51 +02:00
Sebastian Huber
5d614fdfa7 libtest: Add T_puts()
Update #3199.
2020-08-18 07:08:51 +02:00
Sebastian Huber
a7af34d0cf libtest: Add T_do_is_runner()
Update #3199.
2020-08-18 07:08:51 +02:00
Sebastian Huber
e67eff2b53 libtest: Add output buffer drain and fill
Update #3199.
2020-08-18 07:08:51 +02:00
Sebastian Huber
5a8114c6c5 libtest: Change fixture scope method
Return the produced character count.  There is no need for a NUL
termination.

Update #3199.
2020-08-18 07:08:51 +02:00
Aschref Ben Thabet
5869c64793 rtems/printer.h Fix build warnings -Wclass-memaccess 2020-08-17 11:59:00 +02:00
Chris Johns
3ec5f20484 powerpc/io: The eieio() function clashes with FreeBSD. Change. 2020-08-12 12:59:09 +10:00
Kinsey Moore
14749c4515 posix: Only check shm_unlink obj_err if necessary
In the nominal case checked by spsysinit01, obj_err is unmodified if
_POSIX_Shm_Get_by_name returns non-NULL. In the case of shm_unlink, this means
an uninitialized value is passed into the switch and it appears tests using it
were passing by virtue of the stack having the right value on it in most cases.
This now checks obj_err only if _POSIX_Shm_Get_by_name returns NULL.

Close #4016
2020-08-11 07:51:46 -05:00
Sebastian Huber
01677dd491 spintrcritical23: Restore runner priority 2020-08-11 10:03:53 +02:00
Aschref Ben Thabet
5d7ab6bd21 libtests/dl10: Delete unused functions 2020-08-11 09:49:02 +02:00
Sebastian Huber
c1354f0514 libtest: Add T_thread_switch_record()
Add support to record thread switch events.  This can be used to check
that a blocking operation results in the expected sequence of thread
switches.

Update #3199.
2020-08-11 08:03:47 +02:00
Sebastian Huber
20c79bf5eb libtest: Constify
Update #3199.
2020-08-10 11:49:28 +02:00
Sebastian Huber
6626ed504c Doxyfile: Change version to 6.0.0
Update #4020.
2020-08-10 11:49:28 +02:00
Chris Johns
20b1bdba72 shell: Only clear std handles when the shell task exits
Clearing the std file handles when the main loop exited crashes
telnetd as it reuses its session threads.
2020-08-08 18:12:26 +10:00
Sebastian Huber
f933b651e7 libtest: Improve T_check_task_context
Update #3199.
2020-08-07 18:09:56 +02:00
Sebastian Huber
e812f81c89 Document application configuration options
Add a new directory for Doxygen-specific documentation content.  Add a
Doxygen only header file containing documentation of the application
configuration options.  The header file is generated from specification
items.

Close #3994.
2020-08-07 07:24:01 +02:00
Sebastian Huber
6894e2f4b5 Remove accidentally committed file 2020-08-06 19:45:15 +02:00
Sebastian Huber
32f1f747cc libtest: Fix T_interrupt_test() in SMP configs
Update #3199.
2020-08-06 19:15:57 +02:00
Aschref Ben Thabet
6c4ca834fa psxhdrs/strncpy/stpncpy: Fix string turncation warning
Since we need to test the strncpy function, using a character array with
a fixed array size in this case in place of character pointer can avoid
the string turncation warning.
2020-08-05 14:21:17 +02:00
Sebastian Huber
d2c98c1104 dev/sc16is752: Fix declaration 2020-08-05 09:18:27 +02:00
Sebastian Huber
1b42158588 arm/atsam: Make interrupt server configurable
The external UART over SPI device SC16IS752 uses the interrupt server
for interrupt processing. The interrupt server is also heavily used by
libbsd. The interrupt processing for the SC16IS752 is time critical and
doesn't work if network traffic is processed at the same priority.
With #4033 custom interrupt servers are available. Change
atsam_sc16is752_spi_create() to support user-defined interrupt servers.
Introduced atsam_sc16is752_spi_config to cut down the argument count of
this function.

Close #4039.
2020-08-05 07:00:36 +02:00
Sebastian Huber
81631dea2e smpschededf02: Document reset() function 2020-08-04 15:48:32 +02:00
Sebastian Huber
9566538823 termios: Make rtems_termios_ttyMutex private
This mutex is used to maintain termios internal data structures.
2020-08-04 15:48:32 +02:00
Sebastian Huber
2ae557eb04 score: Use flexible-array member for C99 and later
This addresses compiler warnings like this:

warning: array subscript 0 is outside the bounds of an interior
zero-length array 'abc[0]' [-Wzero-length-bounds]
2020-08-04 15:48:32 +02:00
Christian Mauderer
87fdb206fa dosfs: Fix memory leak on failed mounts.
Currently if mount fails, a converter isn't destroyed. We have to take
care of two cases:

1. The user doesn't provide a converter.

In this case mounting a dosfs creates a default converter. This patch
makes sure that the converter is destroyed again if mount failes for
this case.

2. The user provides a converter.

In this case it's not sure that the dosfs specific routines are reached
because mount can fail before that. Therefore the user has to destroy
the converter himself again. This patch adds a documentation for that
and implements it in the media server.

Closes #4042.
2020-08-04 08:24:17 +02:00
Christian Mauderer
6014fadb5a bsps/beagle: Remove some debug output from I2C. 2020-08-03 09:11:13 +02:00
Sebastian Huber
29e7a069f8 dev/spi-memdrv: Fix use of uninit mem_param_ptr 2020-08-03 08:53:31 +02:00
Sebastian Huber
c60942ea5b rtems: Add rtems_interrupt_server_create()
Add rtems_interrupt_server_destroy().

Before this patch, the only way to create interrupt servers was
rtems_interrupt_server_initialize(). This function creates the default
interrupt server and in SMP configurations additional interrupt servers
for the additional processors. The interrupt server is heavily used by
libbsd. This includes the epoch based reclamation which performs time
consuming resource and memory deallocation work. This does not work well
with time critical services, for example an UART over SPI or I2C. One
approach to address this problem is to allow the application to create
custom interrupt servers with the right priority and task properties.
The interrupt server API accounted for this, however, it was not
implemented before this patch.

Close #4034.
2020-08-03 08:52:41 +02:00
Christian Mauderer
02c9eb8567 bsps/fdt: Make sure data is cache aligned
The cache of the fdt blob is flushed after copy. Therefore it should be
aligned.
2020-07-31 08:26:14 +02:00
Christian Mauderer
29a73d876c bsp/imx: Use GPIOs for SPI CS
The chip select lines of the iMX SPI module doesn't work well for a
generic API like the one RTEMS uses. The existing solution only worked
in some special cases and had odd bugs when trying transfers of
different sizes (like deselecting between each byte for lengths that are
not dividable by 4).

With this patch the same approach like on FreeBSD or Linux is used:
Treat the CS lines as GPIOs.

Update 3869
2020-07-31 08:26:14 +02:00
Christian Mauderer
0f4b911c01 bsp/imx: Add a GPIO driver
Update 3869
2020-07-31 08:26:14 +02:00
Sebastian Huber
a3bcc79a1f bsps/lm32: Use shared <bsp/irq.h>
Having a duplicate header with the shared includes is a build system
inconsistency.  You may use one header file to build the libraries and
another one is installed (overwriting the other).

Update #3269.
2020-07-31 07:01:09 +02:00
Aschref Ben Thabet
699f465c50 psxhdrs/strncat: Fix string truncation warning 2020-07-30 14:57:57 +02:00
Jan Sommer
21c7e3a41f i386: Fix possible race condition on first context restore
Make sure that the esp is restored before the eflags register.

When the init task is initially restored, system interrupts are activated when the
eflags register is loaded.
If the esp register still points to an address in the interrupt stack
area (from early system initlization) the ISR might overwrite its own
stack.

Closes #4031
2020-07-29 11:39:02 +02:00
Sebastian Huber
4444094d02 spmisc01: Include missing header file
Update #4032.
2020-07-24 07:31:43 +02:00
Sebastian Huber
7746b0def9 malloc: Make deferred free support optional
Only include the deferred free support if free() is actually used by the
application.

The free() implementation in RTEMS supports that allocated memory is
freed in interrupt context.  Since the heap is protected by a mutex, the
frees issued in interrupt context cannot immediately be freed to the
heap, instead they are placed on a deferred free list.  This list is
emptied by the core allocation function
rtems_heap_allocate_aligned_with_boundary().  This adds a dependency to
free() in rtems_heap_allocate_aligned_with_boundary(). In order to
better support applications which only allocate memory and never free
it, this dependency should be avoided.  Provide a weak default
implementation of _Malloc_Process_deferred_frees() for
rtems_heap_allocate_aligned_with_boundary().  In the free() module
provide the strong implementation.

Close #4032.
2020-07-24 07:14:02 +02:00
Sebastian Huber
6f94a830bd score: Add RTEMS_WEAK
Update #4032.
2020-07-24 07:12:58 +02:00
Sebastian Huber
b2ff5fe310 spintrcritical_support: Remove
This test support was replaced by T_interrupt_test() is no longer used.
2020-07-23 09:27:48 +02:00