Commit Graph
1026 Commits
Author SHA1 Message Date
Sebastian Huber d0545d272c testsuites/validation: Take the interrupted stack
ScoreIsrValIsr checks that the context which an interrupt during the
multitasking start interrupted ran on the stack of the thread which was
running.  A wrapper of the interrupt dispatch of the architecture takes
the address of that stack, and there is one for six architectures only.
Everywhere else the address stays zero, the check cannot pass, and it
reports nothing but a line number, which says neither that the
architecture is unsupported nor what was expected.

Add the wrapper for mips, i386 and x86_64, and say in the check what a
zero address means, so that the next port is told why it fails rather
than left to find out.

The frame which the mips dispatch receives is built on the stack of the
interrupted context, so the address of the frame is an address within
that stack.  Its stack pointer member is not used.  Only the path which
the debugger stub takes fills it, and the interrupt path leaves it zero.

The two x86 ports keep the frame base of the interrupted context in the
frame pointer register and may then switch to the interrupt stack, so
the wrapper has to take the value before the compiler establishes a
frame of its own.  A register variable does not do that, because the
compiler emits its prologue first and the wrapper then reads its own
frame.  They get the same treatment as sparc, which has the problem for
the same reason.

Close #5712.

Assisted-by: Claude:claude-opus-5 claude-code
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-08-20 17:56:47 -05:00
Sebastian Huber ccc830b004 cpukit/score/cpu/moxie: Validate the context
The two routines were empty, so the validation task of spcontext01 spun
in a loop which checked nothing.

The frame pointer stays out of the pattern, since the return
instruction of this architecture unwinds through it.

Close #5701.

Assisted-by: Claude:claude-opus-5 claude-code
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-08-20 17:55:30 -05:00
Sebastian Huber e848c24981 bsps/moxie/moxiesim: Exclude the failing tests
The BSP has neither a clock driver nor interrupt support.  Its clock is
the idle thread, which calls rtems_clock_tick() in a loop, so time only
advances while the system is idle.  The CPU port leaves the interrupt
disable, enable and level routines empty.  Fifty three tests fail as a
result or for reasons of their own, thread local storage among them.

Exclude them with the reason recorded, so that the results of this BSP
show what the target can do rather than a list nobody reads.  The run
reports no regression afterwards.

Update #5701.

Assisted-by: Claude:claude-opus-5 claude-code
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-08-20 17:55:30 -05:00
Sebastian Huber cf5c60a725 bsps/moxie/moxiesim: Exit the simulator on reset
The BSP used the reset loop, so the simulator never stopped.  Every
test ran to completion and then spun until the test runner killed it.
The output was lost, because the standard output of the simulator is
buffered and is flushed by the exit of its process.

The simulator stops if the application issues the exit system call.
Use it and pass a status which tells a successful run from a fatal
error.

Update #5701.

Assisted-by: Claude:claude-opus-5 claude-code
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-08-20 17:55:30 -05:00
Sebastian Huber db08506d40 bsps/x86_64/amd64: Add a PVH boot entry
The BSP is booted by the FreeBSD loader, which hands over in long
mode.  Qemu cannot load such an image with -kernel.  It supports the
x86/HVM direct boot ABI instead, which selects its entry through a
note of the ELF file and enters in 32 bit protected mode.

Add the note and an entry which builds the identity mapping, switches
to long mode and enables the floating point unit, then joins the
existing start code.  Qemu does not provide the location of the ACPI
tables on this path, so search for them if the boot information has
none.

This makes every test executable bootable by a plain Qemu command
line.  A boot image would have to be built for each of the roughly
700 executables otherwise, which needs tools outside the tool chain
and costs seconds per test.

Close #5694.

Assisted-by: Claude:claude-opus-5 claude-code
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-08-20 17:50:50 -05:00
Sebastian Huber b8b572abb0 bsps/i386/pc386: Drop stale expected failures
The five tests pass on this BSP.

Update #5698.

Assisted-by: Claude:claude-opus-5 claude-code
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-08-20 17:47:07 -05:00
Sebastian Huber ef6f279569 bsps/microblaze: Add petalogix_s3adsp1800 BSP
Upstream Qemu has a petalogix-s3adsp1800 machine.  Its UART, interrupt
controller and timer are the peripherals the microblaze_fpga family
drives, so the family needs only a new variant to run on it.  The
existing kcu105_qemu variant needs the microblaze-fdt-plnx machine of
the Xilinx fork.

The peripheral addresses are taken from the machine definition in
hw/microblaze/petalogix_s3adsp1800_mmu.c of Qemu.

Close #5700.

Assisted-by: Claude:claude-opus-5 claude-code
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-08-20 17:45:25 -05:00
Sebastian Huber c7cfd1db3a build: Mark dl06 expected-fail for all BSPs
The test fails because rtems-ld and the RAP format have no TLS
support.  That is a property of the linker and not of a BSP, so the
test fails wherever libdl is built.  Four BSPs stated it individually
through a link to tst-xfail-dl06 while every other BSP reported a
failure.

Move the state into the general test states and drop the item.

Close #5715.

Assisted-by: Claude:claude-opus-5 claude-code
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-08-20 17:43:42 -05:00
Sebastian Huber 4ea45303f6 cpukit/score/cpu/x86_64: Validate the context
The two routines were empty, so the validation task of spcontext01 spun
in a loop which checked nothing.

The floating point context of this port is the control word of the x87
unit and the control and status register of the SSE unit.  Only their
rounding mode carries the pattern, so that no exception is unmasked and
the precision does not change.

Close #5692.

Assisted-by: Claude:claude-opus-5 claude-code
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-08-20 17:42:07 -05:00
Sebastian Huber 7989b9773a bsps/x86_64/amd64: Deliver the CPU exceptions
The BSP installed the interrupt prologue of the interrupt manager on all
of the vectors, so a processor exception was dispatched as an interrupt
with no handler and ended as a spurious interrupt.  A divide by zero in
ts-unit-no-clock-0 terminated the run and spfatal26 got no exception at
all.  The prologue is also wrong for the ten vectors on which the
processor pushes an error code, since the frame it assumes has none.

Give the vectors below the first Local APIC vector their own prologues.
They build a CPU_Exception_frame, pushing a zero error code where the
processor pushes none, and terminate with RTEMS_FATAL_SOURCE_EXCEPTION
and the frame, which is what a fatal handler expects.

Those vectors are no longer vectors of the interrupt manager, so the BSP
gets its own bsp_interrupt_is_valid_vector().  This also removes the
places where the interrupt manager operations had to answer for a vector
which the processor raises.

Update #5692.

Assisted-by: Claude:claude-opus-5 claude-code
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-08-20 17:42:07 -05:00
Sebastian Huber 6f53982853 build: Fix the psxfenv01 test state
The tree wide expected-fail state of psxfenv01 carries no reason and
dates back to the commit which added the waf build system.  The test
passes on eight of the eleven architectures which run a full test suite
here, where the test runner reports it as an unexpected pass.

Drop the tree wide state.  State it once for the three architectures
which really fail.  On microblaze, moxie and or1k fesetenv() returns
-134, which is -ENOTSUP, because the C library declares the floating
point environment macros without implementing them.

Link the state from the microblaze and or1k architecture groups and from
the moxie BSP, so that it covers every BSP of those architectures rather
than the variants which run here.

Close #5711.

Assisted-by: Claude:claude-opus-5 claude-code
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-08-19 13:18:07 -05:00
Sebastian Huber 0788428d48 Revert "build: Add explicit dependencies"
This reverts commit 37163afc97.
2026-08-19 12:24:36 -05:00
Sebastian Huber f0acecec2a bsps/aarch64/a53: Enable the MMU and the caches
The BSP used the MMU stub, so the MMU stayed off and all memory was
Device-nGnRnE.  Unaligned accesses and DC ZVA are not permitted for
this memory type.  The memset() of the C library uses both, so
bsp_start_clear_bss() raised an alignment fault whenever the size of
the .bss section was not a multiple of 16 bytes.  That is the case for
almost every executable, so no test could run.

The memcpy() of the C library has the same problem.  It is latent
because bsp_start_copy_sections() skips a copy if the load address
equals the run address, which holds for this BSP.

Set up the translation table and enable the MMU and the caches before
the .bss section is cleared, like the other AArch64 BSPs do.

Close #5704.

Assisted-by: Claude:claude-opus-5 claude-code
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-08-19 11:45:04 -05: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 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
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
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
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
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
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
Shaunak Datar 7e9b5d7d9d bsps/aarch64/raspberrypi: Add framebuffer driver
Add a framebuffer driver for the Raspberry Pi 4 BSP using the VideoCore
mailbox property tags interface.
2026-07-24 18:06:11 +00:00
Wayne Thornton 2eba833517 cpukit/score/.../cpu.h: Add _CPU_Spin_wait to i386
Added _CPU_Spin_wait() assembly function to i386 architecture
and updated smpspinwait01.yaml to build test for i386
2026-07-24 08:13:39 -06:00
Wayne Thornton a1635abadd cpukit/score/.../cpu.h: Implement _CPU_Spin_wait()
_CPU_Spin_wait() is an assembly function which prevents
aggressive speculative execution by the CPU during spin-wait
loops. Added benefit is reduction of thermal load.

Closes rtems/rtos/rtems#5644
2026-07-23 16:40:26 -06:00
Wayne Thornton 95b8aa4b10 [arm] cpukit/score/.../cpu.h: Implement _CPU_Spin_wait()
_CPU_Spin_wait() is an assembly function which prevents
aggressive speculative execution by the CPU during spin-wait
loops. Added benefit is reduction of thermal load.

Closes rtems/rtos/rtems#5642
2026-07-23 16:25:04 -06:00
Wayne Thornton 33205ab2ef testsuites/smptests: Modify smpspinwait01 test to use Classic API
As a result of review comments, changes made to test in order
to utilize RTEMS_BARRIER_CREATE and other Classic API functions
2026-07-23 16:09:49 -06:00
Wayne Thornton 8e7ba95423 testsuites/smptests: Add smpspinwait01 test
Add smpspinwait01 to thoroughly exercise the new _CPU_Spin_wait()
architectural hint and compiler memory barrier in concurrent SMP
environments.

The test validates:

- Read-Shared bus contention: Verifies that a master core broadcast
  wake to secondary cores spinning on a shared cache line cleanly
  transitions to exclusive ownership without bus lockups.

- Compiler memory barrier enforcement: Spins on a non-volatile
  shared flag to prove RTEMS_COMPILER_MEMORY_BARRIER() prevents
  compiler optimization levels >= -O2 from hoisting loads into
  core-local registers, avoiding SMP deadlocks.

- MESI cache-line bouncing: Executes a multi-core ring token pass
  for 5,000 iterations per core. This forces continuous Modified-to-
  Invalid cache invalidation traffic across the interconnect while
  cores execute the architecture-specific spin-wait hint.
2026-07-23 08:12:13 -06:00
Ran Hong b4e6231d23 bsps/powerpc: Update and add the u-boot support
uboot_environment and uboot_environment_size are configured through
 build options UBOOT_ENV_BASE and UBOOT_ENV_SIZE.

 Support for powerpc/qoriq is added.

 For qoriq boards with u-boot, user can use the same environment
 access fuctions shared with other bsps like gen83xx.

 Closes #5481
2026-07-09 13:43:33 +00:00
Michal Lenc 7f98bd8469 i2c: move drivers from cpukit to bsps/shared
More i2c drivers from cpukit to bsps/shared to allow them use BSP
infrastructure if needed. The framework code i2c-bus.c and i2c-dev.c
kept at its original location.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2026-07-02 18:33:01 -05:00
Michal Lenc 5ebf57e2af can: move drivers from cpukit to bsps/shared
Move CAN controllers from cputik to bsps/shared directory. This will
allow to use BSP level interface which may be needed for some
controllers. Generic CAN stack implementation is still kept in the
original directory as this shoudl be independent from the low level
driver interface.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2026-07-02 18:33:01 -05:00
Sebastian Huber 5ea6c565f6 validation: Test rtems_barrier_get_number_waiting()
Add a validation test for rtems_barrier_get_number_waiting() based on an
action requirement.

Update #5336.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de
2026-07-02 17:55:53 -05:00
M Mithilesh 77eda6f760 cpukit/confdefs: Add CAN stack resource calculation
The CAN/CAN FD stack requires a worker task per configured queue.
Empirical profiling confirms the CAN worker task utilizes ~404 bytes
of stack space on 32-bit architectures.

This patch introduces CONFIGURE_MAXIMUM_CAN_QUEUES to dynamically
inject the required CAN worker tasks into the master _CONFIGURE_TASKS
pool. Because the 404-byte usage falls below RTEMS_MINIMUM_STACK_SIZE,
provisioning them as standard system tasks automatically guarantees
sufficient stack space overhead.

Additionally, this patch removes the hardcoded +0x1000 stack padding
in rtems_task_create to prevent workspace exhaustion, and adds the
spcan01 test to verify the CONFIGURE_MAXIMUM_CAN_QUEUES macro behavior.

Closes #5193
2026-07-02 17:36:27 -05:00
Sebastian Huber 184957d88d fstests: Remove duplicate test program
The fsclose01 test program contains general test cases for fclose().  It
does not depend on a particular filesystem.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-07-01 04:12:42 +02:00
Chris Johns 2f16291408 powerpc/beatnik: Convert MOTLoad GEV variables into env variables
Closes #5573
2026-06-27 09:46:32 +10:00
Aaron Nyholm ed072a2501 iodev: Add iodev driver
Add iodev driver and related test
2026-06-25 17:37:09 -05:00
Chris Johns 639444039d powerpc/motorola_powerpc: Convert PPCBug NVRAM vars into env vars
Closes #5621
2026-06-25 10:08:11 +10:00
Sebastian Huber 4420185b44 bsps/sparc: SPARC_Clear_and_unmask_interrupt()
Remove SPARC_Clear_and_unmask_interrupt(). This functionality is
available through the Interrupt Manager:

- rtems_interrupt_clear()

- rtems_interrupt_vector_enable()

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-06-23 13:35:52 -05:00
Sebastian Huber c12b4d5881 bsps/noel: Fix build
Declare and provide riscv_send_ipi().

Build issue was introduced by commit
128106b2f1.

Update #3337.
Update #5617.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-06-23 14:28:46 +02:00
Sebastian Huber 60ea0d6897 validation: Rework get/set interrupt priorities
For some interrupt controllers like the RISC-V PLIC, a maximum interrupt
priority value of UINT32_MAX is valid. Adjust the validation tests to
take this into account.

In general, all the present interrupt controller API validation tests
have a structural issue. They contain the loop over all interrupt
vectors directly in the action requirement. This is not the right
approach. It is better to use an action requirement which produces a
test run function by defining a test header through the `test-header`
attribute. Then call the test run function for all interrupt vectors.
This approach allows to using the `${.:skip}` feature.

In this commit, this is new approach is applied to the interrupt get/set
priority validation tests.

Close #5578.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-06-22 10:10:05 +00:00
Sebastian Huber 8ee33e32c1 validation: Test no scheduler assignment 2026-06-18 17:31:33 -05:00
Sam Price d55f44cfb5 microblaze: Install uartlite/xil-compat headers
Microblaze is most likely built with uartlite for uart.
We will install the <bsp/uartlite.h> / <bsp/uartlite_l.h>
header files for users to use.
2026-06-18 14:52:46 -05:00
Moksh Panicker 73ac0c9674 bsps/arm/stm32f4: Add SPI bus driver
Adds an interrupt-driven SPI bus driver for the STM32F4 SPI
peripheral implementing the RTEMS spi_bus API (dev/spi/spi.h).

The STM32F4 SPI has no hardware FIFO - the data register holds
a single byte - so the driver handles one byte per TXE/RXNE
interrupt pair. This is a hardware constraint, not an
implementation choice. DMA support can be added in a future
version.

Supports 8-bit full-duplex master mode, SPI modes 0-3 (all
CPOL/CPHA combinations), MSB/LSB-first, and automatic baud-rate
prescaler selection. Chip select is left to the application
via GPIO.

New files:
- stm32f4xxxx_spi.h: register definitions (RM0090 section 28.5)
- stm32f4-spi.h: public driver interface
- spi.c: driver implementation

stm32f4.h updated with STM32F4_SPI1/2/3 peripheral accessors.
SPI base addresses per RM0090 table 1: SPI1 on APB2 at
0x40013000, SPI2 and SPI3 on APB1 at 0x40003800 and 0x40003C00.

Verified to compile cleanly for arm/stm32f4 and
arm/realview_pbx_a9_qemu with GCC 15.2.0.
2026-06-17 00:45:02 +00:00
Sebastian Huber 2582a21ade build: Update GCC build key
This is required for matching bitset type definitions provided by
Newlib.

Update #4864.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-06-16 16:39:09 +02:00
Gedare Bloom 1fff7e564b testsuites/libtests: add fdt02 for more rtems-fdt tests
Closes #5607.
2026-06-05 23:23:51 +00:00
Sebastian Huber 37163afc97 build: Add explicit dependencies
Tests using the bld.cc() and bld.cxx() rules do not profit from the
automatic compiler dependency generation provided by the gccdeps.py waf
plugin.

Add "cpukit/include/rtems/score/cpuopts.h" as a hard-coded dependency to
these tests to account for configuration changes.  This fixes linker
errors, for example if the configuration changed the RTEMS_SMP option.

Close #5482.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2026-06-04 18:06:08 -05:00
Chris Johns 156d429516 spec/ftd01: Fix the DTB python generation code
Closes #5605
2026-06-02 15:28:03 +10:00
Shivam Deolankar 99ea420b1b cpukit: Move FatFs core to contrib and update build integration
Move the upstream FatFs sources from cpukit/libfs/src/fatfs to
contrib/fatfs.Keep the RTEMS integration layer (rtems-fatfs-*.c and
rtems-diskio.c) in libfs. Introduce a wrapper header under rtems/fatfs
and update internal sources to use it.

Update the build specification to reference the new location without
introducing global include paths.

Fixes #5433
2026-06-01 18:37:44 +00:00
Gedare Bloom b6fb679d44 spec/build: add explicit dependency in fdt01
Updates #5482.
2026-05-28 18:55:53 -06:00
Gedare Bloom 27fc98a01d spec/build: add fdt01 test to build
Also uses the new dtc command to generate the dtbs at compile time.
Reads dts from elsewhere in the rtems tree.
2026-05-28 18:55:53 -06:00
Gedare Bloom 296d3872ff libmisc/rtems-fdt: add rtems-fdtimpl.h
Refactor implementation details to rtems-fdtimpl.h to allow further
refactoring of the main source file and access to internal structures
for testing.
2026-05-28 18:55:53 -06:00