38280 Commits
Author SHA1 Message Date
Vijay Banerjee aa9699509b powerpc/shared/console: Fix uart build for beatnik
This commit fixes implicit declaration error with "BSP_REG_OFF"
2026-08-19 00:03:31 +00:00
Vijay Banerjee 7690646ff5 spec: Add strict align flag for mvme5100
This BSP does not allow unaligned access
2026-08-18 19:28:51 +00:00
Mazen Adel Elmessady b7233f9f03 cpukit: fix compilation error for BSPs that use wkspaceinitmulti.h
fix compilation error for BSPs that use wkspaceinitmulti.h
like the arm/altcycv_devkit
2026-08-18 21:40:08 +03:00
Mazen Adel Elmessady 1be9a4d989 cpukit/include: Refactor heapimpl.h
This commit splits heapimpl.h
to heapimpl.h and heapfirstfitimpl.h.
By moving first-fit-specific definitions into
heapfirstfitimpl.h and keeping only generic
heap helper definitions in heapimpl.h.

Updates:
rtems/rtos/rtems#5620
2026-08-15 20:52:02 +03:00
Yang Zhang 687e15cfac dosfs: Avoid FAT file cache update after failed write
Signed-off-by: Yang Zhang <zhangyang03@kylinos.cn>
2026-08-14 21:20:42 -04:00
Gedare Bloom ddd3c0f885 bsps/riscv: add support for SV48 and SV57
Allow using 48-bit and 57-bit virtual addresses in s-mode with RISC-V.

Also fixes a few formatting issues in mmu-setup.c

Updates #5630

Updates #3337
2026-08-14 12:21:38 -06:00
Gedare Bloom 76962d9a2a bsps/riscv: initialize page tables to 0
Updates #3337
2026-08-14 12:21:38 -06:00
Gedare Bloom bb90ebe84f bsps/riscv: refactor riscv_create_pte
simplify the translation of a page to the ppn
2026-08-14 12:21:38 -06:00
Gedare Bloom f29da813de riscv: set defaults for RISCV_MMU_VIRTUAL_ADDRESS_BITS
Use 32 for rv32 ABI and otherwise use 39 bit virtual addresses.

Fixes #5630
2026-08-14 12:21:38 -06:00
Samuel Viegas 2aca6495ae score: Use uintptr_t type for TLS DTV generation number
- Change TLS_Dynamic_thread_vector
generation_number from uint32_t to uintptr_t.

- Using a machine-word type resolves the FIXME concern
about correctness across architectures, since uintptr_t
is guaranteed to match size on both 32-bit and 64-bit
targets.

Updates #4827
2026-08-13 18:21:38 -05:00
Samuel Viegas 05bd049a02 rtems/msgq: Reject oversized MP queues and add mp11 coverage
- Removed #if 1 clause and error comment section.

- Updated the RTEMS_INVALID_SIZE doxygen comments for
queue create and construct directives.

- Added mp11 checks for oversized global message
queues to verify both rtems_message_queue_create()
and rtems_message_queue_construct() return
RTEMS_INVALID_SIZE when size is
max_packet_payload_size + 1.

- Updated mp11 documentation and expected output
to include these checks.

Updates #4819.
2026-08-13 18:17:41 -05:00
Samuel Viegas 9b8e36803b cpukit/include/rtems/confdefs: Improved comments on #pragmas section
- Added a description to the _CONFIGURE_ASSERT_NOT_NULL() macro
definition in doxygen format.

- Improved comment section above the #pragmas to ignore warnings.

Updates #4831.
2026-08-13 18:12:26 -05:00
Yang Zhang 4400e4521f libcsupport: Fix return value and errno on duplicate open failure
In duplicate_iop() and duplicate2_iop(), when the open handler
(open_h) returns a non-zero status (e.g. positive errno), the
open descriptor was freed via rtems_libio_free(), but the non-zero
status value was returned directly to fcntl()/dup2().

If open_h returned a positive errno value, fcntl()/dup2() would
return it as a positive file descriptor even though the descriptor
had been freed, leading to Use-After-Free (UAF) vulnerabilities.

Fix this by setting errno if rv > 0 and ensuring rv = -1 is
returned on error, satisfying POSIX compliance.
2026-08-13 17:59:57 -05:00
Matteo Concas 0c339acf22 bsps/leon3: Add support for IRQMP IRQMAP
This support is added in the form of two public functions,
`leon3_irqmap_get_unchecked()` that will directly return the mapped
interrupt and `leon3_irqmap_get()` that will perform a check (<63) before
reading the mapping.
2026-08-13 17:55:57 -05:00
Matteo Concas 021d96b86e bsps/irq: Add bsp_interrupt_vector_modify function 2026-08-13 17:55:57 -05:00
Matteo Concas 9a94009a81 bsps/leon3: Check IPI is valid 2026-08-13 17:55:57 -05:00
Matteo Concas 45ff833caa grlib/ambapp: Add support for >31 IRQ PnP info
The second piece of the IRQ number is contained in bits 10
and 11 of the Identification Register
2026-08-13 17:55:57 -05:00
Sebastian Huber 827861d9c1 libtest: Sweep the time point when search stalls
T_interrupt_test() bisects a busy wait to place an interrupt inside the
action of a test.  It adjusts the bracket on an early and on a late
interrupt, but T_INTERRUPT_TEST_CONTINUE fell through both cases: the
bounds stayed as they were, the sample index did not advance, and the
next iteration used the very same busy count.  A test whose interrupt
reliably lands inside the action, yet which is not satisfied by that
particular time point, therefore repeated one time point until it ran
out of iterations.

A continue says the interrupt hit the action but reports nothing about
early or late, so there is no gradient to bisect on.  Count them, and
once the search has produced nothing else for a while, step the time
point through the bracket instead of using its middle.  A stepped time
point which leaves the action yields an early or a late result again,
which clears the counter and lets the bisection narrow the bracket
around the action.  A search which does make progress never reaches the
counter and keeps the behaviour it had.

The bracket is covered in a fixed number of steps rather than in steps
of one busy count.  This is not needed to make the search converge, it
keeps the sweep predictable: the step follows the width of the bracket,
a bracket narrower than the step count degrades to a step of one, and
there is no division by a width which may be zero.  The last point
needs the lower bound to stay below the upper bound.  The bisection did
not guarantee this, since a busy count taken from the bracket of all
samples is accounted to one sample only.  Pull the opposite bound along
in this case.

spintrcritical20 on the erc32 BSP hit exactly this.  It reported
T_INTERRUPT_TEST_TIMEOUT with 9997 of its 10000 iterations landing
inside the action and none of them satisfying the test.  It now
completes.  All twenty spintrcritical tests pass on erc32, leon2,
gr712rc, gr740 and gr740 in SMP configuration.

The simulator is deterministic, so repeating a test under it adds no
information.  A host simulation of the search over randomised action
windows, satisfied only after three distinct outcomes, completes in 200
of 200 runs with the sweep and in 1 of 200 without it.

Assisted-by: Claude:claude-opus-5 claude-code
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-08-13 17:55:06 -05:00
Sebastian Huber 3c8572d74f spintrcritical21: Fix sporadic test failures
The interrupt handler runs on every clock tick, also between the test
iterations.  Sending the event outside of the action left it pending, so
the event receive of the next action returned immediately instead of
blocking and the interrupt could no longer hit the critical section.
Send the event only if the action is in progress.

Assisted-by: Claude:claude-opus-5 claude-code
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-08-13 17:55:06 -05:00
Sebastian Huber f8d6c05397 spintrcritical0[1-5]: Fix sporadic test failures
The interrupt handler runs on every clock tick, also between the test
iterations.  Releasing the semaphore outside of the action left a count
behind, so the semaphore obtain of the next action returned immediately
instead of blocking and the interrupt could no longer hit the critical
section.  Release the semaphore only if the action is in progress.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-08-13 17:55:06 -05:00
Sebastian Huber 6aced47117 libtest: Use spaces for comment indentation
Several comments in this file were indented with tabs while the rest of
the file uses spaces.  Convert them.  This is a whitespace only change.

Assisted-by: Claude:claude-opus-5 claude-code
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-08-13 17:55:06 -05:00
Samuel PriceandClaude Opus 5 4645e241a8 testsuites/psxstat: Expect statvfs() on IMFS to succeed
Commit e618b20215 ("imfs/imfs_statvfs: Added the statvfs functionality
to IMFS module") gave IMFS a real statvfs handler:
cpukit/libfs/src/imfs/imfs_statvfs.c is wired up as .statvfs_h in the
IMFS operations table and returns 0.  Before that commit no handler was
installed and the default handler made statvfs() fail with ENOSYS.

The psximfs01 test was updated along with that change, but psxstat was
not:  test_statvfs() still asserts that statvfs() on a valid path
returns -1 with errno set to ENOSYS, so the test fails.  Assert success
instead and update the expected output in psxstat.scn to match.

The stale expectation is architecture independent, so the test fails on
every BSP.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-13 17:47:33 -05:00
Chris Johns ec42cadd3b libfs/pipe: Add pipe and pipe2 indirect handler calls
- Add a default pipe2 which retuns an error.

- Add pipe and pipe2 handler register calls so implementations
  with different file descriptors can use these calls.

Closes #5673
2026-08-13 17:33:34 -05:00
Pavel Pisa 25a479d5e6 cpukit/dev/can: correct round-robin on same priority Tx
When the device is open multiple times and data
are sent to driver by multiple FIFOs/edges then
round-robin between same priority prevents
one application blocking whole bandwidth.

The problem has been introduced during switch
from original uLUt/LinCAN to NewLib provided TAILQ

Signed-off-by: Pavel Pisa <ppisa@pikron.com>
2026-08-13 17:30:05 -05:00
Pavel Pisa 818af27299 bsps/shared/dev/can/sja1000: option to enforce 32-bit access
On the ESP32C3, when registers are access by 8-bits
then writes to (at least some) registers are ignored.

Signed-off-by: Pavel Pisa <ppisa@pikron.com>
2026-08-13 17:30:05 -05:00
Pavel Pisa 0ecd851ffb bsps/shared/dev/can/sja1000: reenable I/O mapped support for i386 target
The I/O mapped SJA1000 is required to support Kvaser CanS/D/Q boards
which have emulation in mainline QEMU.

The I/O space mapping is enabled by RTEMS_CAN_SJA1000_ARCH_WITH_IO_PORTS
option set in hw_options during initialization.

Signed-off-by: Pavel Pisa <ppisa@pikron.com>
2026-08-13 17:30:05 -05:00
Aaron Nyholm 4361124764 bsps/aarch64/shared/pm: Add FPGA loading ZYNQMP
Added platform management for the ZYNQMP to load FPGA.
Added shell command for loading.
2026-08-13 17:27:33 -05:00
Aaron Nyholm c6e6de8577 contrib: Import xilpdi headers from Xilinx v2026.1
Upstream version: v2026.1
Upstream source: https://github.com/Xilinx/embeddedsw/

Files from lib/sw_services/xilpdi/src/
2026-08-13 17:27:33 -05:00
Aaron Nyholm ccbdb2a087 contrib: Import smccc from FreeBSD 15.1.0
Upstream version: 15.1.0
Upstream source: https://github.com/freebsd/freebsd-src/blob/release/15.1.0/

Files from sys/dev/psci/
2026-08-13 17:27:33 -05:00
Samuel Price a57178b5da testsuites/fstests: Include the FatFS headers in the FatFS tests
Add proper header file includes into fsfatfsformat01, fsfatfssync01.
Remove the duplicated structs, and duplicated extern calls.
Update test yaml files to include proper include folders to find header
files with defs.
2026-08-13 17:23:05 -05:00
Yang Zhang 8172a5cc5e libdl: Add check for NULL pointer after malloc call
In rtems_rap_app_alloc(), the return value of malloc() is passed
directly to memset() and rtems_chain_append() without being checked.
If the memory allocation fails, this results in a NULL pointer
dereference and a system crash. Explicitly check for NULL before
using the descriptor.
2026-08-11 15:18:31 +00:00
Sang Woo Kim 6b52a0c22d libcsupport: Let dup2() duplicate onto a descriptor that is not open
dup2() ran fstat() on fildes2 first, so duplicating onto a closed
descriptor - the normal use of dup2() - answered EBADF.  The checks
belong to fcntl(F_DUP2FD): fildes is validated before fildes2 is
touched and fildes2 is range checked there.

Closes #5669
2026-08-11 14:43:40 +10:00
Sang Woo Kim 4bb46046ad libcsupport: Duplicate onto a free descriptor with fcntl(F_DUP2FD)
duplicate2_iop() assumed its target is open.  A free target stayed on
the iop free list with no LIBIO_FLAGS_OPEN and no reference, so the
call answered success while the new descriptor answered EBADF to
everything and a later allocation handed the same iop out again.
Claim the target from the free list, release the previous location
when the target was open, publish LIBIO_FLAGS_OPEN only after the
open handler agreed, and answer the descriptor for a target that is
the source itself.

Closes #5670
2026-08-11 14:43:40 +10:00
Sang Woo Kim 1e5da72852 libcsupport: Honour the file descriptor minimum of fcntl(F_DUPFD)
vfcntl() never read the third argument: the duplicate was the next
free iop, whatever the caller asked for, an out-of-range minimum was
not refused, and a full table answered -1 with errno unset.  POSIX
wants the lowest available descriptor at or above the argument, EINVAL
for a negative or out-of-range argument and EMFILE for a full table.
The free list is kept in close order, so rtems_libio_allocate_minimum()
walks it for the lowest qualifying entry.

Closes #5668
2026-08-11 14:43:40 +10:00
Sang Woo Kim 7043f23ba0 libcsupport: Add fcntl(F_DUPFD_CLOEXEC)
vfcntl() had no case for it, so the command fell through to default and
answered EINVAL.  POSIX has required it since 2008 and newlib declares
it.  The duplicate carries LIBIO_FLAGS_CLOSE_ON_EXEC, the flag F_GETFD
and F_SETFD already maintain.

Closes #5667
2026-08-11 14:43:40 +10:00
Vijay Banerjee 20f7811bf2 motorola_powerpc: Fix reset for MVME2100
This commit fixes the reset register write for mvme2100
2026-08-05 15:26:54 -05:00
Vijay Banerjee 47ffb323e5 motorola_powerpc: Add support for MVME5100
This patch adds a variant of the motorola_powerpc
BSP to support MVME5100
2026-08-04 09:45:23 -05:00
Yang Zhang befb19c81f libblock: Return RTEMS_NO_MEMORY on allocation failure
In rtems_bdpart_register(), when create_logical_disk_name() fails to
allocate memory and returns NULL, the error code variable 'esc' was
incorrectly assigned 'sc' (which evaluates to RTEMS_SUCCESSFUL).

This caused the function to falsely return RTEMS_SUCCESSFUL even when
memory allocation failed. Fix it by assigning RTEMS_NO_MEMORY.
2026-08-03 10:08:40 +08:00
Avi Weiss 6eb8a4a2f0 bsps/shared/dev/flash: Fix JFFS2 flashdev file leaks
Close the flash file before returning from these 5 early setup failure
paths. Otherwise the file descriptor and selected flash region remain
allocated.
2026-08-02 20:24:23 +03:00
Avi Weiss f3536b2927 bsps/shared/dev/flash: Fix read-only JFFS2 mount option
Open works correclty with the read_only argument but mount
ignores and always uses READ_WRITE.

Use RTEMS_FILESYSTEM_READ_ONLY when read_only is true so the
filesystem rejects write operations and does not perform erase
operations when under a read-only mount.
2026-08-02 18:03:16 +03:00
Aaron Nyholm fa81c05170 cpukit/dev/io: Add NULL check to iodev
Added check to prevent NULL access in rtems_iodev_destory_unregistered.
2026-07-29 15:50:58 +00:00
Avi Weiss 67bd3ea530 bsps/shared/dev/can/sja1000/sja1000.c: Fix RX overflow error data byte
The RX overflow handling uses CAN_ERR_ID_LOSTARB, which is an
err_frame.header.can_id mask, as an err_frame.data index.

Correct it to use CAN_ERR_DATA_BYTE_TRX_CTRL as intended.
2026-07-29 02:57:58 +00:00
Avi Weiss 76575d65c3 bsps/shared/dev/can/sja1000/sja1000.c: Mark error counters valid
The Error Active frame populates the TX and RX error counter bytes
but does not set CAN_ERR_ID_CNT.

Set CAN_ERR_ID_CNT so consumers know the counter fields are valid.
2026-07-29 02:57:58 +00:00
Avi Weiss 8a41720437 bsps/shared/dev/can/sja1000/sja1000.c: Set error frame payload length
Set dlen to CAN_FRAME_STANDARD_DLEN so diagnostic data is actually delivered.
Upstream Linux initializes this in alloc_can_err_skb().
2026-07-29 02:57:58 +00:00
Avi Weiss d8dee2c2ff bsps/shared/dev/can/ctucanfd/ctucanfd_txb.h: Fix TXB_MASK undef typo
TXB_M apparently intended as TXB_MASK.
2026-07-29 02:57:58 +00:00
Avi Weiss fbcc85b7cb bsps/shared/dev/can/ctucanfd/ctucanfd.c: Mark error counters valid
The Error Active frame populates the TX and RX error counter bytes
but does not set CAN_ERR_ID_CNT.

Set CAN_ERR_ID_CNT so consumers know the counter fields are valid.
2026-07-29 02:57:58 +00:00
Avi Weiss 93262b33bb bsps/shared/dev/can/ctucanfd/ctucanfd.c: Set error frame payload length
Set dlen to CAN_FRAME_STANDARD_DLEN so diagnostic data is actually delivered.
Upstream Linux initializes this in alloc_can_err_skb().
2026-07-29 02:57:58 +00:00
Avi Weiss a0b9ae2f56 bsps/shared/dev/can/ctucanfd/ctucanfd.c: Remove duplicate command
TXT_CMD_SET_READY command issued twice apparently without need.
Remove one.
2026-07-29 02:57:58 +00:00
Avi Weiss 88b801f7f5 bsps/shared/dev/can/ctucanfd/ctucanfd.c: Fix documentation typos
Typos and swapped comments corrected.
2026-07-29 02:57:58 +00:00
Avi Weiss cfeb26fa90 bsps/shared/dev/can/ctucanfd/ctucanfd.c: Update error frame comments
Add clarifying comments to avoid regression after some subtle
error frame bugs were corrected.
2026-07-29 02:57:58 +00:00