Commit Graph

34970 Commits

Author SHA1 Message Date
Sebastian Huber
d69acf87dc config: CONFIGURE_DISABLE_NEWLIB_REENTRANCY
Do not initialize Thread_Control::libc_reent if
CONFIGURE_DISABLE_NEWLIB_REENTRANCY is defined.  This helps to catch errors
with a NULL pointer exception rather than a corruption of the thread control
block.
2022-02-21 11:08:30 +01:00
Christian Mauderer
6fe6622489 bsp/imxrt: Enforce alignment for devicetree
A device tree binary has to be 8 byte aligned in memory. This is checked
since RTEMS commit 34052ef78c "libfdt: Add
FDT alignment check to fdt_check_header()".
2022-02-21 09:30:05 +01:00
Chris Johns
1e0a163388 bsp/arm/zynq: Cadence I2C has moved, update to the new path 2022-02-17 16:55:03 +11:00
Matt Joyce
d24da94f62 newlib01: Edit asserts to check initialization
Edit assert statements in worker thread to check initialization against the
__cleanup member of struct _reent instead of __sdidinit.  This will allow the
removal of sdidinit in a follow up Newlib patch.
2022-02-16 08:25:42 +01:00
Christian Mauderer
cff16379c9 bsp/atsam: Improve UART / USART tx performance
Put the next character into the send buffer if the buffer is empty and
not when the last character has been sent out to the line. This improves
the performance slightly.

Before that patch, the receive path was faster than the transmit path.
Therefore a simple echo could drop characters on a busy connection.
With this patch sending and receiving has about the same performance so
that no characters are lost.

Fixes #4610
2022-02-11 09:03:42 +01:00
Christian Mauderer
0074c9ecf3 bsp/atsam/i2c: Add error return and fix edge cases
The driver didn't return with an error on (for example) a NACK on the
bus. This adds the expected error return. Due to the new case that a
transfer can be interrupted on an error, there were some new edge cases.
This patch therefore also fixes these edge cases by removing the
transfer_state that more or less duplicated the interrupt states.

Fixes #4592
2022-02-10 09:08:03 +01:00
Christian Mauderer
974d24f8a8 bsp/atsam/i2c: Simplify driver
Do some clean ups. Remove superfluous variables. Eliminate some overly
complex logic (information about transfer and remaining bytes has been
tracked redundantly in multiple variables).

This patch doesn't change the behavior of the driver.

Update #4592
2022-02-10 09:07:46 +01:00
Christian Mauderer
7b5948d4d2 termios: Pass number of sent chars to l_start
At the moment the line discipline start function (l_start) has no
possibility to get feedback about the number of characters that have
been sent. This patch passes that information via an additional
parameter.

The change might trigger a warning on existing code because of a pointer
mismatch but it shouldn't break it. An existing function with the old
API will just ignore the additional parameter.

Update #4493
2022-02-10 09:07:26 +01:00
Kinsey Moore
17e05426ca cpukit/microblaze: Simplify dispatch assembly
The dispatch code was unnecessarily saving and restoring an extra
interrupt frame. This avoids the extra frame and folds the dispatch call
into a fallthrough to the interrupt frame restoration code.
2022-02-04 11:31:00 -06:00
Kinsey Moore
c6d8d1cb2b cpukit/microblaze: Clarify interrupt frame usage
Avoid use of magic numbers in favor of named constants and add MSR to
the interrupt frame so that thread dispatch can occur on exceptions as
well.
2022-02-04 11:30:59 -06:00
Kinsey Moore
ace9955fc4 cpukit/microblaze: Add exception extensions
Add the functions necessary to support RTEMS_EXCEPTION_EXTENSIONS and
mark this functionality as available on MicroBlaze.
2022-02-04 11:30:59 -06:00
Kinsey Moore
530a8c2494 cpukit/microblaze: Add debug vector and handler
This patch adds a vector for debug events along with a hook similar to
the exception framework. The debug vector generates an exception frame
for use by libdebugger.
2022-02-04 11:30:59 -06:00
Kinsey Moore
127980c799 cpukit/microblaze: Add exception framework
This patch updates the CPU_Exception_frame to include all necessary
registers, combines hardware snd software exception handlers into a
shared vector, provides an architecture-specific hook for taking
control of exception handling, and moves exception handling over to
actually using the CPU_Exception_frame instead of a minimal interrupt
stack frame. As the significant contents of _exception_handler.S have
been entirely rewritten, the copyright information on this file has been
updated to reflect that.
2022-02-04 11:30:59 -06:00
Alex White
37543e1968 microblaze: Add support for libbsd networking
This includes fixes and improvements necessary to get libbsd networking
running.
2022-02-01 16:58:24 -06:00
Jennifer Averett
50a6580da0 microblaze: Add support for libbsd. 2022-02-01 16:58:24 -06:00
Sebastian Huber
20ca3b09ba sparc: Mark dl06 as expected fail 2022-01-28 08:43:19 +01:00
Sebastian Huber
b519e509a9 sptests: Avoid a dependency on errno
Avoid a dependency on errno which might be a thread-local object.  The tests
sp01, spstkalloc02, and sptls03 assume that no thread-local storage object is
present.

Update #4560.
2022-01-28 08:03:48 +01:00
Kinsey Moore
b539af865e cpukit: Prevent error with disabled stack checker
When the stack checker is not enabled, the stack checker reporting
function can still be called. This prevents that call from performing a
null memory access in trying to find the high water mark if the stack
checker was never initialized.

This also introduces a test to ensure this call does not cause a crash.

Closes #4588
2022-01-27 13:07:30 -06:00
Sebastian Huber
2145e0c7bf Remove obsolete rtems_gxx_*() implementation
GCC versions prior to 6.1 used a RTEMS thread model based on
rtems_gxx_*() functions. GCC version 6.1 or later uses the
self-contained synchronization objects of Newlib <sys/lock.h> for the
RTEMS thread model.

Remove the obsolete implementation.

Close #3143.
2022-01-27 11:06:46 +01:00
Sebastian Huber
e3f70b379b bsps: Avoid use of memcpy() in bsp_fdt_copy()
The memcpy() function may be not loaded at the time bsp_fdt_copy() is
called.
2022-01-19 08:11:20 +01:00
Christian Mauderer
aa95122c17 bsp/atsam: Optionally use DMA for UART Rx
If the system is busy with other interrupts and the UART is set to a
fast baud rate, it's possible to loose UART interrupts and therefore
characters. This allows to optionally enable a DMA for the UARTs so that
a number of lost interrupts can be tolerated.

The number of DMAs on this chip is limited and not not all applications
need that feature. Therefore the DMA is disabled by default.

Close #4578
2022-01-18 08:41:15 +01:00
Christian Mauderer
fbd18c09af bsp/atsam: Merge USART and UART driver
If no extended features of the USART are used and if the comparison
feature of the UART is not used, the two modules are compatible. The
drivers were nearly identical except for some names of the defines.

This patch merges the two drivers into one.

Update #4578
2022-01-18 08:41:11 +01:00
Sebastian Huber
12a2a8e442 arm: Optimize interrupt handling
Use the SRS (Store Return State) instruction if available.  This
considerably simplifies the context save and restore.
2022-01-17 08:14:12 +01:00
Sebastian Huber
84ba194477 arm: Fix stack alignment during interrupt handling
On a public interface, the stack pointer must be aligned on an 8-byte
boundary.  However, it may temporarily be only aligned on a 4-byte
boundary.  The interrupt handling code must ensure that the stack
pointer is properly aligned before it calls a function.  See also:

https://developer.arm.com/documentation/den0013/d/Interrupt-Handling/External-interrupt-requests/Nested-interrupt-handling

Update #4579.
2022-01-17 08:14:12 +01:00
Sebastian Huber
41a1903dd9 arm: Avoid duplicate move from CPSR
Update #4579.
2022-01-17 08:12:15 +01:00
Sebastian Huber
0290e44b28 arm: Rework per-CPU control in interrupt handling
Use volatile register r0 for the per-CPU control of the current
processor instead of the non-volatile register r7.  This enables the use
of r7 in a follow up patch.  Do the interrupt handling in ARM mode.

Update #4579.
2022-01-15 19:49:41 +01:00
Sebastian Huber
2d1ea1abae arm: Use push/pop instructions for readability
Update #4579.
2022-01-15 19:49:41 +01:00
Sebastian Huber
4e530464b0 bsps: Default to CPU counter benchmark timer
Most BSPs which used the stubbed benachmark timer provide a CPU counter.
All BSPs provide at least a stub CPU counter.  Simply use the benchmark
timer implementation using the CPU counter.
2022-01-15 19:49:41 +01:00
Sebastian Huber
944c210b3d bsp/imx7: dl06 fails expectedly 2022-01-14 16:26:54 +01:00
Sebastian Huber
93ebc9da69 libtests/dl10: Enter shell on demand
Use rtems_shell_wait_for_input() similar to other potentially
interactive test programs.
2022-01-14 08:02:38 +01:00
Sebastian Huber
671f126a3a libtests/ofw01: Fix device tree blob alignment
A device tree blob must be aligned on an 8-byte boundary.
2022-01-13 15:15:52 +01:00
Gedare Bloom
6c36cb7a48 aarch64: always boot into EL1NS
Always start the executive in Exception Level 1, Non-Secure mode.
If we boot in EL3 Secure with GICv3 then we have to initialize
the distributor and redistributor to set up G1NS interrupts
early in the boot sequence before stepping down from EL3S to EL1NS.

Now there is no need to distinguish between secure and non-secure
world execution after the primary core boots, so get rid of the
AARCH64_IS_NONSECURE configuration option.
2022-01-12 09:00:19 -07:00
Gedare Bloom
63d27156cb arm/gicv3: refactor DIST initialization to helper 2022-01-12 09:00:19 -07:00
Gedare Bloom
ea7b1b79f8 bsps/aarch64: refactor register init and hooks 2022-01-12 09:00:19 -07:00
Sebastian Huber
37377b0f9d spintrcritical21: Clear pending events
The test runner checks that there are no pending events after a test
case.
2022-01-12 14:24:23 +01:00
Sebastian Huber
00081b30a8 Fix device tree blob alignment
A device tree blob must be aligned on an 8-byte boundary.
2022-01-11 18:01:17 +01:00
Sebastian Huber
cbc92325a1 bsp/qoriq: Implement Interrupt Manager directives
Update #3269.
2022-01-11 16:18:11 +01:00
Sebastian Huber
963a26c34b libtests/ofw01: Fix wrapped in bsp_fdt_get()
Use the stack pointer to check if we have to return the real device tree
since bsp_fdt_get() may get called before the BSS is cleared to zero.
2022-01-11 16:18:11 +01:00
Sebastian Huber
b982b8d44f build: Fix build item format 2022-01-11 16:18:11 +01:00
Sebastian Huber
8657986989 libtest: Check for pending events
Make sure there are no pending events after a test case.
2021-12-22 10:29:13 +01:00
Sebastian Huber
d40477161e rtems: Fix Clock Manager parameter descriptions
Update #4572.
2021-12-22 08:17:50 +01:00
Sebastian Huber
18e47db518 bsp/mrm332: Fix TLS support in linker command file 2021-12-22 08:17:49 +01:00
Joel Sherrill
e92bc25453 Remove powerpc/haleakala board
Closes #4302.
2021-12-17 10:28:07 -06:00
Ryan Long
98ab69323e libmisc/rtems-fdt: close() file 'bf'
close() file 'bf' to avoid leaking descriptor.

CID 1437645: Resource leak in rtems_fdt_load().

Closes #4297
2021-12-17 10:27:27 -06:00
Sebastian Huber
60cec828e7 dtc: Update VERSION 2021-12-14 16:06:19 +01:00
Vikram Garhwal
75b3f48aa3 libfdt: overlay: make overlay_get_target() public
This is done to get the target path for the overlay nodes which is very useful
in many cases. For example, Xen hypervisor needs it when applying overlays
because Xen needs to do further processing of the overlay nodes, e.g. mapping of
resources(IRQs and IOMMUs) to other VMs, creation of SMMU pagetables, etc.

Signed-off-by: Vikram Garhwal <fnu.vikram@xilinx.com>
Message-Id: <1637204036-382159-2-git-send-email-fnu.vikram@xilinx.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-12-14 16:00:44 +01:00
Elvira Khabirova
8b21a1b9b2 libfdt: fix an incorrect integer promotion
UINT32_MAX is an integer of type unsigned int. UINT32_MAX + 1 overflows
unless explicitly computed as unsigned long long. This led to some
invalid addresses being treated as valid.

Cast UINT32_MAX to uint64_t explicitly.

Signed-off-by: Elvira Khabirova <e.khabirova@omp.ru>
2021-12-14 16:00:44 +01:00
Georg Kotheimer
4c05a91712 libfdt: Add ALIGNMENT error string
The ALIGNMENT error was missing a string, leading to <unknown error>
being returned.

Signed-off-by: Georg Kotheimer <georg.kotheimer@kernkonzept.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-12-14 16:00:44 +01:00
Andre Przywara
c07e23899b fdtget: Fix signedness comparisons warnings
With -Wsign-compare, compilers warn about a mismatching signedness in
the different legs of the conditional operator, in fdtget.c.

In the questionable expression, we are constructing a 16-bit value out of
two unsigned 8-bit values, however are relying on the compiler's
automatic expansion of the uint8_t to a larger type, to survive the left
shift. This larger type happens to be an "int", so this part of the
expression becomes signed.

Fix this by explicitly blowing up the uint8_t to a larger *unsigned* type,
before doing the left shift. And while we are at it, convert the hardly
readable conditional operator usage into a sane switch/case expression.

This fixes "make fdtget", when compiled with -Wsign-compare.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Message-Id: <20210618172030.9684-3-andre.przywara@arm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-12-14 16:00:44 +01:00
David Gibson
21351a2f79 Fix CID 1461557
Coverity gets a bit confused by loading fdt_size_dt_strings() and
using it in a memmove().  In fact this is safe because the callers
have verified this information (via FDT_RW_PROBE() in fdt_pack() or
construction in fdt_open_into()).

Passing in strings_size like we already do struct_size seems to get
Coverity to follow what's going on here.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-12-14 16:00:44 +01:00