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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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
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.
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.
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.
_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
_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
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.
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
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>
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>
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
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
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>
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>
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>
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.
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>
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